system

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 28, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfigurationFromFile

func LoadConfigurationFromFile(filePath string, target interface{}) error

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

func StopService(ctx *common.Context, system types.SystemInterface, id string) error

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

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

Execute performs the operation with the given context and input parameters, and returns any output or error encountered.

func (*BaseSystemOperation) Type

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL