Skip to content

Commit 64c99a3

Browse files
committed
update config
1 parent c225d00 commit 64c99a3

File tree

2 files changed

+26
-7
lines changed

2 files changed

+26
-7
lines changed

config/config.go

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,24 @@ type Maintainers struct {
1212
Email string
1313
}
1414

15+
type Grpc struct {
16+
Port int
17+
}
18+
19+
type Graphql struct {
20+
Enabled bool
21+
Port int
22+
}
23+
24+
type Http struct {
25+
Enabled bool
26+
Port int
27+
}
28+
1529
type Network struct {
16-
HTTPPort int `yaml:"http-port,omitempty"`
17-
GrpcPort int `yaml:"grpc-port,omitempty"`
18-
GraphqlPort int `yaml:"graphql-port,omitempty"`
30+
Grpc Grpc
31+
Http Http
32+
Graphql Graphql
1933
}
2034

2135
type Service struct {
@@ -49,6 +63,6 @@ func LoadConfig(filePath string) *SproutConfig {
4963
}
5064

5165
func (c *SproutConfig) Print() {
52-
pp.Print(c)
66+
pp.Println(c)
5367

5468
}

example/sprout.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,14 @@ maintainers:
88
email: bob@test.com
99

1010
network:
11-
http-port: 8080
12-
grpc-port: 3000
13-
graphql-port: 8082
11+
grpc:
12+
port: 3000
13+
http:
14+
enabled: true
15+
port: 8080
16+
graphql:
17+
enabled: true
18+
port: 8082
1419

1520
services:
1621
- name: helloworld

0 commit comments

Comments
 (0)