Skip to content

Commit 0279416

Browse files
committed
update config and doc
1 parent 6988249 commit 0279416

File tree

3 files changed

+51
-51
lines changed

3 files changed

+51
-51
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,6 @@ To avoid circular dependencies, the following strategies can be adopted:
10521052

10531053
Gopherd/core provides several useful command line arguments:
10541054

1055-
- `-v`: Print version information and exit
10561055
- `-p`: Print parsed configuration and exit
10571056
- `-t`: Test configuration validity and exit
10581057
- `-T`: Enable configuration template processing

README_ZH.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1056,7 +1056,6 @@ Gopherd/core 的组件依赖机制基于以下几个关键概念:
10561056

10571057
Gopherd/core 提供了几个有用的命令行参数:
10581058

1059-
- `-v`: 打印版本信息并退出
10601059
- `-p`: 打印解析后的配置并退出
10611060
- `-t`: 测试配置有效性并退出
10621061
- `-T`: 启用配置模板处理

config.json

Lines changed: 51 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,59 @@
11
{
2-
"Context": {
3-
"Namespace": "example",
4-
"Name": "example-server",
5-
"ID": 1001,
6-
"R": {
7-
"HTTPServer": "httpserver",
8-
"EventSystem": "eventsystem"
9-
}
10-
},
11-
"Components": [
2+
// Global context, which can be used in templates
3+
"Context": {
4+
"Namespace": "example",
5+
"Name": "example-server",
6+
"ID": 1001,
7+
"R": {
8+
"HTTPServer": "httpserver",
9+
"EventSystem": "eventsystem"
10+
}
11+
},
12+
// List of components, each containing a required `Name` and optional `UUID`, `Refs`, `Options`
13+
"Components": [
1214
{
1315
"Name": "github.com/gopherd/example/components/logger",
1416
"Options": {
1517
"Level": "DEBUG",
1618
"Output": "stdout"
1719
}
1820
},
19-
{
20-
"Name": "github.com/gopherd/example/components/eventsystem",
21-
"UUID": "{{.R.EventSystem}}",
22-
"Options": {
23-
"Ordered": true
24-
}
25-
},
26-
{
27-
"Name": "github.com/gopherd/example/components/auth",
28-
"Refs": {
29-
"HTTPServer": "{{.R.HTTPServer}}",
30-
"EventSystem": "{{.R.EventSystem}}"
31-
},
32-
"Options": {
33-
"Secret": "{{.Namespace}}-secret"
34-
}
35-
},
36-
{
37-
"Name": "github.com/gopherd/example/components/users",
38-
"Refs": {
39-
"HTTPServer": "{{.R.HTTPServer}}",
40-
"EventSystem": "{{.R.EventSystem}}"
41-
},
42-
"Options": {
43-
"MaxUsers": 1000
44-
}
45-
},
46-
{
47-
"Name": "github.com/gopherd/example/components/httpserver",
48-
"UUID": "{{.R.HTTPServer}}",
49-
"Options": {
50-
"Addr": ":{{add 8000 .ID}}"
51-
}
52-
},
53-
{
54-
"Name": "github.com/gopherd/example/components/blockexit"
55-
}
56-
]
57-
}
21+
{
22+
"Name": "github.com/gopherd/example/components/eventsystem",
23+
"UUID": "{{.R.EventSystem}}",
24+
"Options": {
25+
"Ordered": true
26+
}
27+
},
28+
{
29+
"Name": "github.com/gopherd/example/components/auth",
30+
"Refs": {
31+
"HTTPServer": "{{.R.HTTPServer}}",
32+
"EventSystem": "{{.R.EventSystem}}"
33+
},
34+
"Options": {
35+
"Secret": "{{.Namespace}}-secret"
36+
}
37+
},
38+
{
39+
"Name": "github.com/gopherd/example/components/users",
40+
"Refs": {
41+
"HTTPServer": "{{.R.HTTPServer}}",
42+
"EventSystem": "{{.R.EventSystem}}"
43+
},
44+
"Options": {
45+
"MaxUsers": 1000
46+
}
47+
},
48+
{
49+
"Name": "github.com/gopherd/example/components/httpserver",
50+
"UUID": "{{.R.HTTPServer}}",
51+
"Options": {
52+
"Addr": ":{{add 8000 .ID}}"
53+
}
54+
},
55+
{
56+
"Name": "github.com/gopherd/example/components/blockexit"
57+
}
58+
]
59+
}

0 commit comments

Comments
 (0)