Skip to content

Commit

Permalink
Merge pull request #140 from devopsfaith/service_name
Browse files Browse the repository at this point in the history
service name added
  • Loading branch information
kpacha authored Jul 7, 2018
2 parents a911912 + 1960f85 commit 1e232ac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ var RoutingPattern = ColonRouterPatternBuilder

// ServiceConfig defines the krakend service
type ServiceConfig struct {
// name of the service
Name string `mapstructure:"name"`
// set of endpoint definitions
Endpoints []*EndpointConfig `mapstructure:"endpoints"`
// defafult timeout
Expand Down
2 changes: 2 additions & 0 deletions config/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func (p parser) Parse(configFile string) (ServiceConfig, error) {
}

type parseableServiceConfig struct {
Name string `json:"name"`
Endpoints []*parseableEndpointConfig `json:"endpoints"`
Timeout string `json:"timeout"`
CacheTTL string `json:"cache_ttl"`
Expand Down Expand Up @@ -72,6 +73,7 @@ type parseableServiceConfig struct {

func (p *parseableServiceConfig) normalize() ServiceConfig {
cfg := ServiceConfig{
Name: p.Name,
Timeout: parseDuration(p.Timeout),
CacheTTL: parseDuration(p.CacheTTL),
Host: p.Host,
Expand Down

0 comments on commit 1e232ac

Please sign in to comment.