Documentation ¶
Index ¶
- type ArgStartService
- type Service
- type ServiceManager
- func (srvMngr *ServiceManager) AddServices(services ...Service)
- func (srvMngr *ServiceManager) Call(ctx *context.Context, serviceMethod string, args any, reply any) error
- func (srvMngr *ServiceManager) GetConfig() *config.CGRConfig
- func (srvMngr *ServiceManager) GetService(subsystem string) (srv Service)
- func (srvMngr *ServiceManager) StartServices() (err error)
- func (srvMngr *ServiceManager) V1ServiceStatus(args ArgStartService, reply *string) error
- func (srvMngr *ServiceManager) V1StartService(args ArgStartService, reply *string) (err error)
- func (srvMngr *ServiceManager) V1StopService(args ArgStartService, reply *string) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArgStartService ¶
type ArgStartService struct {
ServiceID string
}
ArgStartService are passed to Start/StopService/Status RPC methods
type Service ¶
type Service interface { // Start should handle the sercive start Start() error // Reload handles the change of config Reload() error // Shutdown stops the service Shutdown() error // IsRunning returns if the service is running IsRunning() bool // ShouldRun returns if the service should be running ShouldRun() bool // ServiceName returns the service name ServiceName() string }
Service interface that describes what functions should a service implement
type ServiceManager ¶
type ServiceManager struct { sync.RWMutex // lock access to any shared data // contains filtered or unexported fields }
ServiceManager handles service management ran by the engine
func NewServiceManager ¶
func NewServiceManager(cfg *config.CGRConfig, engineShutdown chan bool) *ServiceManager
NewServiceManager returns a service manager
func (*ServiceManager) AddServices ¶
func (srvMngr *ServiceManager) AddServices(services ...Service)
AddServices adds given services
func (*ServiceManager) GetConfig ¶
func (srvMngr *ServiceManager) GetConfig() *config.CGRConfig
GetConfig returns the Configuration
func (*ServiceManager) GetService ¶
func (srvMngr *ServiceManager) GetService(subsystem string) (srv Service)
GetService returns the named service
func (*ServiceManager) StartServices ¶
func (srvMngr *ServiceManager) StartServices() (err error)
StartServices starts all enabled services
func (*ServiceManager) V1ServiceStatus ¶
func (srvMngr *ServiceManager) V1ServiceStatus(args ArgStartService, reply *string) error
V1ServiceStatus returns the service status
func (*ServiceManager) V1StartService ¶
func (srvMngr *ServiceManager) V1StartService(args ArgStartService, reply *string) (err error)
V1StartService starts a service with ID
func (*ServiceManager) V1StopService ¶
func (srvMngr *ServiceManager) V1StopService(args ArgStartService, reply *string) (err error)
V1StopService shuts-down a service with ID
Click to show internal directories.
Click to hide internal directories.