Documentation
¶
Index ¶
- func LoadConfigurationFromFile(filePath string, target interface{}) error
- func RegisterComponent(ctx *common.Context, system types.SystemInterface, ...) error
- func StartService(ctx *common.Context, system types.SystemInterface, ...) error
- func StopService(ctx *common.Context, system types.SystemInterface, id string) error
- type BaseSystemComponent
- type BaseSystemOperation
- type BaseSystemService
- type SystemImpl
- func (s *SystemImpl) ComponentRegistry() types.ComponentRegistrarInterface
- func (s *SystemImpl) Configuration() *types.Configuration
- func (s *SystemImpl) EventBus() common.EventBusInterface
- func (s *SystemImpl) ExecuteOperation(ctx *common.Context, operationID string, data *types.SystemOperationInput) (*types.SystemOperationOutput, error)
- func (s *SystemImpl) Initialize(ctx *common.Context) error
- func (s *SystemImpl) Logger() common.LoggerInterface
- func (s *SystemImpl) MultiStore() types.MultiStore
- func (s *SystemImpl) PluginManager() types.PluginManagerInterface
- func (s *SystemImpl) RestartService(ctx *common.Context, serviceID string) error
- func (s *SystemImpl) Start(ctx *common.Context) error
- func (s *SystemImpl) StartService(ctx *common.Context, serviceID string) error
- func (s *SystemImpl) Stop(ctx *common.Context) error
- func (s *SystemImpl) StopService(ctx *common.Context, serviceID string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadConfigurationFromFile ¶
LoadConfigurationFromFile loads the configuration from a file at the given path.
func RegisterComponent ¶
func RegisterComponent(ctx *common.Context, system types.SystemInterface, config *types.ComponentConfig, factory types.ComponentFactoryInterface) error
func StartService ¶
func StartService( ctx *common.Context, system types.SystemInterface, config *types.ComponentConfig) error
func StopService ¶
Types ¶
type BaseSystemComponent ¶
type BaseSystemComponent struct {
component.BaseComponent // Embedding BaseComponent
System types.SystemInterface
}
BaseSystemComponent.
func NewBaseSystemComponent ¶
func NewBaseSystemComponent(id, name, description string) *BaseSystemComponent
func (*BaseSystemComponent) Initialize ¶
func (bo *BaseSystemComponent) Initialize(ctx *common.Context, system types.SystemInterface) error
Initialize initializes the module. Returns an error if the initialization fails.
func (*BaseSystemComponent) Type ¶
func (bo *BaseSystemComponent) Type() types.ComponentType
Type returns the type of the component.
type BaseSystemOperation ¶
type BaseSystemOperation struct {
BaseSystemComponent // Embedding BaseComponent
}
BaseSystemOperation.
func NewBaseSystemOperation ¶
func NewBaseSystemOperation(id, name, description string) *BaseSystemOperation
func (*BaseSystemOperation) Execute ¶
func (bo *BaseSystemOperation) Execute(ctx *common.Context, input *types.SystemOperationInput) (*types.SystemOperationOutput, error)
Execute performs the operation with the given context and input parameters, and returns any output or error encountered.
func (*BaseSystemOperation) Type ¶
func (bo *BaseSystemOperation) Type() types.ComponentType
Type returns the type of the component.
type BaseSystemService ¶
type BaseSystemService struct {
types.SystemServiceInterface
BaseSystemComponent
}
BaseSystemService.
func NewBaseSystemService ¶
func NewBaseSystemService(id, name, description string) *BaseSystemService
NewBaseSystemService creates a new instance of BaseSystemService.
func (*BaseSystemService) Start ¶
func (bo *BaseSystemService) Start(ctx *common.Context) error
Start starts the component. Returns an error if the start operation fails.
func (*BaseSystemService) Stop ¶
func (bo *BaseSystemService) Stop(ctx *common.Context) error
Stop stops the component. Returns an error if the stop operation fails.
func (*BaseSystemService) Type ¶
func (bo *BaseSystemService) Type() types.ComponentType
Type returns the type of the component.
type SystemImpl ¶
type SystemImpl struct {
types.SystemInterface
// contains filtered or unexported fields
}
SystemImpl represents the core system in the application.
func NewSystem ¶
func NewSystem( logger common.LoggerInterface, eventBus common.EventBusInterface, configuration *types.Configuration, pluginManager types.PluginManagerInterface, componentReg types.ComponentRegistrarInterface, store types.MultiStore) *SystemImpl
NewSystem creates a new instance of the SystemImpl.
func (*SystemImpl) ComponentRegistry ¶
func (s *SystemImpl) ComponentRegistry() types.ComponentRegistrarInterface
ComponentRegistry returns the component registry.
func (*SystemImpl) Configuration ¶
func (s *SystemImpl) Configuration() *types.Configuration
Configuration returns the system configuration.
func (*SystemImpl) EventBus ¶
func (s *SystemImpl) EventBus() common.EventBusInterface
EventBus returns the system event bus.
func (*SystemImpl) ExecuteOperation ¶
func (s *SystemImpl) ExecuteOperation(ctx *common.Context, operationID string, data *types.SystemOperationInput) (*types.SystemOperationOutput, error)
ExecuteOperation executes the operation with the given ID and input data. Returns the output of the operation and an error if the operation is not found or if execution fails.
func (*SystemImpl) Initialize ¶
func (s *SystemImpl) Initialize(ctx *common.Context) error
Initialize initializes the system component by executing the initialize operation.
func (*SystemImpl) Logger ¶
func (s *SystemImpl) Logger() common.LoggerInterface
Logger returns the system logger.
func (*SystemImpl) MultiStore ¶
func (s *SystemImpl) MultiStore() types.MultiStore
MultiStore returns the multistore
func (*SystemImpl) PluginManager ¶
func (s *SystemImpl) PluginManager() types.PluginManagerInterface
ComponentRegistry returns the component registry.
func (*SystemImpl) RestartService ¶
func (s *SystemImpl) RestartService(ctx *common.Context, serviceID string) error
RestartService restarts the service with the given ID. Returns an error if the service ID is not found or other error.
func (*SystemImpl) Start ¶
func (s *SystemImpl) Start(ctx *common.Context) error
Start starts the system component along with all registered services.
func (*SystemImpl) StartService ¶
func (s *SystemImpl) StartService(ctx *common.Context, serviceID string) error
StartService starts the service with the given ID. Returns an error if the service ID is not found or other error
func (*SystemImpl) Stop ¶
func (s *SystemImpl) Stop(ctx *common.Context) error
Stop stops the system component along with all registered services.
func (*SystemImpl) StopService ¶
func (s *SystemImpl) StopService(ctx *common.Context, serviceID string) error
StopService stops the service with the given ID. Returns an error if the service ID is not found or other error.