summaryrefslogtreecommitdiff
path: root/service/env/service.go
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-07-26 17:09:53 +0300
committerWolfy-J <[email protected]>2018-07-26 17:09:53 +0300
commit2f73d679b884616c49f4eba3342b350c001d949f (patch)
treee93f4f9505bcb0d597f8a258b046c735e4ff3245 /service/env/service.go
parent8226b1f064ba1dca8f817bb882e0e570fc057e43 (diff)
more tests
Diffstat (limited to 'service/env/service.go')
-rw-r--r--service/env/service.go14
1 files changed, 6 insertions, 8 deletions
diff --git a/service/env/service.go b/service/env/service.go
index b0721971..9fb110c3 100644
--- a/service/env/service.go
+++ b/service/env/service.go
@@ -5,22 +5,20 @@ const ID = "env"
// Service provides ability to map _ENV values from config file.
type Service struct {
- // Default is default set of values.
- Default map[string]string
- cfg *Config
+ // values is default set of values.
+ values map[string]string
}
// NewService creates new env service instance for given rr version.
func NewService(version string) *Service {
- return &Service{Default: map[string]string{"rr": version}}
+ return &Service{values: 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
+ for k, v := range cfg.Values {
+ s.values[k] = v
}
return true, nil
@@ -28,5 +26,5 @@ func (s *Service) Init(cfg *Config) (bool, error) {
// GetEnv must return list of env variables.
func (s *Service) GetEnv() (map[string]string, error) {
- return s.cfg.Values, nil
+ return s.values, nil
}