Documentation ¶
Index ¶
Constants ¶
View Source
const ( // MsgServiceInitializing message to return when subsystem is initializing. MsgServiceInitializing = " subsystem initializing..." // MsgServiceInitialized message to return when subsystem has initialized. MsgServiceInitialized = " subsystem initializing... Success." // MsgServiceStarting message to return when subsystem is starting up. MsgServiceStarting = " subsystem starting..." // MsgServiceStarted message to return when subsystem has started. MsgServiceStarted = " subsystem starting... Success." // MsgServiceShuttingDown message to return when a subsystem is shutting down. MsgServiceShuttingDown = " subsystem shutting down..." // MsgServiceShutdown message to return when a subsystem has shutdown. MsgServiceShutdown = " subsystem shutting down ... Success" )
Variables ¶
View Source
var ( // ErrServiceAlreadyStarted message to return when a service is called to start but is already running. ErrServiceAlreadyStarted = errors.New("service already started") // ErrServiceNotStarted message to return when service not started. ErrServiceNotStarted = errors.New("service not started") // ErrNilService is returned when service functions are called but the service is not instantiated. ErrNilService = errors.New("service not setup") // ErrServiceNotEnabled is returned when a service is called to start but is not enabled. ErrServiceNotEnabled = errors.New("service not enabled") // ErrServiceNotInitialized is returned when a service is called to start but has not been initialized. ErrServiceNotInitialized = errors.New("service not initialized") // ErrServiceNotFound is returned when a service can not be found. ErrServiceNotFound = errors.New("service not found") // ErrServiceNilWaitGroup is returned when a service has nil wait group. ErrServiceNilWaitGroup = errors.New("service nil wait group received") )
Functions ¶
This section is empty.
Types ¶
type IService ¶
type IService interface { // Start spawns all processes done by the service. Start(wg *sync.WaitGroup) // Stop terminates all processes belonging to the service, blocking until they are all terminated. Stop() error // IsRunning returns true if the service is currently running. IsRunning() bool // IsEnabled returns true if the service is allowed to run. IsEnabled() bool // GetName returns the name of the service. GetName() string }
IService exports an interface to the Service type.
type Service ¶
type Service struct { Shutdown chan struct{} // contains filtered or unexported fields }
Service is the base type for all services defined in the project.
func NewService ¶
NewService creates a pointer to a new Service struct with the provided values.
Click to show internal directories.
Click to hide internal directories.