From 64c99a3e7973e4fb6c8f4f4f9bcacf122440696c Mon Sep 17 00:00:00 2001 From: pritesh-patel Date: Wed, 21 Aug 2019 23:05:21 -0700 Subject: [PATCH] update config --- config/config.go | 22 ++++++++++++++++++---- example/sprout.yml | 11 ++++++++--- 2 files changed, 26 insertions(+), 7 deletions(-) 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