1
1
{
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" : [
12
14
{
13
15
"Name" : " github.com/gopherd/example/components/logger" ,
14
16
"Options" : {
15
17
"Level" : " DEBUG" ,
16
18
"Output" : " stdout"
17
19
}
18
20
},
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