Skip to content

Commit

Permalink
update config
Browse files Browse the repository at this point in the history
  • Loading branch information
Pritesh-Patel committed Aug 22, 2019
1 parent c225d00 commit 64c99a3
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 7 deletions.
22 changes: 18 additions & 4 deletions config/config.go
Expand Up @@ -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 {
Expand Down Expand Up @@ -49,6 +63,6 @@ func LoadConfig(filePath string) *SproutConfig {
}

func (c *SproutConfig) Print() {
pp.Print(c)
pp.Println(c)

}
11 changes: 8 additions & 3 deletions example/sprout.yml
Expand Up @@ -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
Expand Down

0 comments on commit 64c99a3

Please sign in to comment.