diff options
author | Wolfy-J <[email protected]> | 2018-07-26 17:05:54 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2018-07-26 17:05:54 +0300 |
commit | 8226b1f064ba1dca8f817bb882e0e570fc057e43 (patch) | |
tree | 606261f4b57d3acc5c977f57253c848782f40952 /service/env/service.go | |
parent | 234995f297c4067f4dfdba305f3b16a90143cf12 (diff) |
default service value as version
Diffstat (limited to 'service/env/service.go')
-rw-r--r-- | service/env/service.go | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/service/env/service.go b/service/env/service.go index a90b0c48..b0721971 100644 --- a/service/env/service.go +++ b/service/env/service.go @@ -5,13 +5,24 @@ const ID = "env" // Service provides ability to map _ENV values from config file. type Service struct { - cfg *Config + // Default is default set of values. + Default map[string]string + cfg *Config +} + +// NewService creates new env service instance for given rr version. +func NewService(version string) *Service { + return &Service{Default: map[string]string{"rr": version}} } // Init must return configure svc and return true if svc hasStatus enabled. Must return error in case of // misconfiguration. Services must not be used without proper configuration pushed first. func (s *Service) Init(cfg *Config) (bool, error) { s.cfg = cfg + for k, v := range s.Default { + s.cfg.Values[k] = v + } + return true, nil } |