diff --git a/config/config.go b/config/config.go index ad7d75257..6104bf551 100644 --- a/config/config.go +++ b/config/config.go @@ -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 diff --git a/config/parser.go b/config/parser.go index 7f7844fdf..662d34f47 100644 --- a/config/parser.go +++ b/config/parser.go @@ -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"` @@ -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,