diff --git a/config/config.go b/config/config.go index be42816b8..c8cbc1964 100644 --- a/config/config.go +++ b/config/config.go @@ -12,10 +12,24 @@ type Maintainers struct { Email string } +type Grpc struct { + Port int +} + +type Graphql struct { + Enabled bool + Port int +} + +type Http struct { + Enabled bool + Port int +} + type Network struct { - HTTPPort int `yaml:"http-port,omitempty"` - GrpcPort int `yaml:"grpc-port,omitempty"` - GraphqlPort int `yaml:"graphql-port,omitempty"` + Grpc Grpc + Http Http + Graphql Graphql } type Service struct { @@ -49,6 +63,6 @@ func LoadConfig(filePath string) *SproutConfig { } func (c *SproutConfig) Print() { - pp.Print(c) + pp.Println(c) } diff --git a/example/sprout.yml b/example/sprout.yml index cfd454fab..ca22a0843 100644 --- a/example/sprout.yml +++ b/example/sprout.yml @@ -8,9 +8,14 @@ maintainers: email: bob@test.com network: - http-port: 8080 - grpc-port: 3000 - graphql-port: 8082 + grpc: + port: 3000 + http: + enabled: true + port: 8080 + graphql: + enabled: true + port: 8082 services: - name: helloworld