Added GetService to ServiceManager

This commit is contained in:
Trial97
2019-09-20 15:17:20 +03:00
committed by Dan Christian Bogos
parent 32c606467f
commit 9824406198

View File

@@ -458,6 +458,15 @@ func (srvMngr *ServiceManager) reloadService(srv Service, shouldRun bool) (err e
return
}
// GetService returns the named service
func (srvMngr *ServiceManager) GetService(subsystem string) (srv Service, err error) {
var has bool
if srv, has = srvMngr.subsystems[subsystem]; !has {
return nil, utils.ErrNotFound
}
return
}
// ServiceProvider should implement this to provide information for service
type ServiceProvider interface {
// GetDM returns the DataManager