ing
This commit is contained in:
parent
b8ad668263
commit
af7be47293
|
@ -8,8 +8,8 @@ import (
|
|||
type Service interface {
|
||||
InitService() error
|
||||
StartService() error
|
||||
StopService() error
|
||||
DestroyService() error
|
||||
StopService()
|
||||
DestroyService()
|
||||
}
|
||||
|
||||
type ServiceMethodType int
|
||||
|
@ -73,9 +73,14 @@ func ExecServices(services []interface{}, method ServiceMethodType, orderedTypes
|
|||
iv := reflect.ValueOf(i)
|
||||
m := iv.MethodByName(method.String())
|
||||
rvs := m.Call([]reflect.Value{})
|
||||
|
||||
switch method {
|
||||
case ServiceMethodInit, ServiceMethodStart:
|
||||
if nil != rvs && 1 == len(rvs) && nil != rvs[0].Interface() {
|
||||
return rvs[0].Interface().(error)
|
||||
}
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
Loading…
Reference in New Issue
Block a user