diff options
author | Wolfy-J <[email protected]> | 2018-09-08 00:01:03 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2018-09-08 00:01:03 +0300 |
commit | fc7f7f7ac17ef0838bbdfd578b4e17821b287aee (patch) | |
tree | 71395ed820d9e685baec2875dc68176814834243 | |
parent | bf086da11191848ef3a74602d4c652034357e972 (diff) |
added support for logger in DI
-rw-r--r-- | service/container.go | 2 | ||||
-rw-r--r-- | service/env/service.go | 6 | ||||
-rw-r--r-- | service/rpc/service.go | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/service/container.go b/service/container.go index b6840375..1716b965 100644 --- a/service/container.go +++ b/service/container.go @@ -213,7 +213,7 @@ func (c *container) Stop() { func (c *container) initService(s interface{}, segment Config) (bool, error) { r := reflect.TypeOf(s) - m, ok := r.MethodByName("Init") + m, ok := r.MethodByName(InitMethod) if !ok { // no Init method is presented, assuming service does not need initialization. return true, nil diff --git a/service/env/service.go b/service/env/service.go index 561907a0..a4d3959c 100644 --- a/service/env/service.go +++ b/service/env/service.go @@ -4,8 +4,8 @@ const ( // ID contains default service name. ID = "env" - // RR_ENV contains default env key to indicate than php running in RR mode. - RR_ENV = "RR" + // RRKey contains default env key to indicate than php running in RR mode. + RRKey = "RR" ) // Service provides ability to map _ENV values from config file. @@ -25,7 +25,7 @@ func NewService(defaults map[string]string) *Service { func (s *Service) Init(cfg *Config) (bool, error) { if s.values == nil { s.values = make(map[string]string) - s.values[RR_ENV] = "yes" + s.values[RRKey] = "yes" } for k, v := range cfg.Values { diff --git a/service/rpc/service.go b/service/rpc/service.go index abeae240..9cd32755 100644 --- a/service/rpc/service.go +++ b/service/rpc/service.go @@ -12,9 +12,9 @@ const ( // ID contains default service name. ID = "rpc" - // ENV_KEY defines environment key to be used to store information about + // RRKey defines environment key to be used to store information about // rpc server connection. - ENV_KEY = "RR_RPC" + EnvKey = "RR_RPC" ) // Service is RPC service. type Service struct { @@ -35,7 +35,7 @@ func (s *Service) Init(cfg *Config, env env.Environment) (bool, error) { s.rpc = rpc.NewServer() if env != nil { - env.SetEnv(ENV_KEY, cfg.Listen) + env.SetEnv(EnvKey, cfg.Listen) } return true, nil |