diff options
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 } |