Documentation
¶
Index ¶
- func NewComponentRegistry(opts ComponentRegistryOptions) (api.ComponentRegistry, error)
- func NewControllerRegistry(opts ControllerRegistryOptions) (api.ControllerRegistry, error)
- func NewMonitoringControllerRegistry(opts MonitoringControllerRegistryOptions) (api.MonitoringControllerRegistry, error)
- func NewMonitoringRegistry(opts MonitoringRegistryOptions) (api.MonitoringRegistry, error)
- func NewNullLogger() *logrus.Logger
- func NewPlanRegistry(opts PlanRegistryOptions) (api.PlanRegistry, error)
- func NewTaskRegistry(opts TaskRegistryOptions) (api.TaskRegistry, error)
- type ComponentRegistry
- func (cr *ComponentRegistry) Delete(id string) error
- func (cr *ComponentRegistry) Disable(id string) error
- func (cr *ComponentRegistry) Enable(id string) error
- func (cr *ComponentRegistry) Get(id string) (*model.Component, error)
- func (cr *ComponentRegistry) GetBy(key string, value string) ([]*model.Component, error)
- func (cr *ComponentRegistry) List() ([]*model.Component, error)
- func (cr *ComponentRegistry) Register(comp model.Component) (*model.Component, error)
- func (cr *ComponentRegistry) UpVersion(componentID string, version string)
- func (cr *ComponentRegistry) Update(id string, updatedComp *model.Component) error
- type ComponentRegistryOptions
- type ControllerRegistry
- func (cr *ControllerRegistry) Delete(c string) error
- func (cr *ControllerRegistry) Get(componentType string) (api.Controller, error)
- func (cr *ControllerRegistry) List() ([]api.Controller, error)
- func (cr *ControllerRegistry) ListType() ([]string, error)
- func (cr *ControllerRegistry) Register(controllerType string, controller api.Controller) error
- func (cr *ControllerRegistry) Update(c string, comp api.Controller) error
- type ControllerRegistryOptions
- type Core
- type CoreOptions
- type Events
- type MonitoringControllerRegistry
- func (mcr *MonitoringControllerRegistry) Delete(c string) error
- func (mcr *MonitoringControllerRegistry) Get(componentType string) (api.MonitoringController, error)
- func (mcr *MonitoringControllerRegistry) List() ([]api.MonitoringController, error)
- func (mcr *MonitoringControllerRegistry) Register(controllerType string, controller api.MonitoringController) error
- func (mcr *MonitoringControllerRegistry) Update(c string, comp api.MonitoringController) error
- type MonitoringControllerRegistryOptions
- type MonitoringRegistry
- func (mr *MonitoringRegistry) CheckConfig(compType string, compConfig map[string]string) error
- func (mr *MonitoringRegistry) Delete(id string) error
- func (mr *MonitoringRegistry) Get(id string) (*model.Monitoring, error)
- func (mr *MonitoringRegistry) List() ([]*model.Monitoring, error)
- func (mr *MonitoringRegistry) Register(tp string, m *model.Monitoring) (*model.Monitoring, error)
- func (mr *MonitoringRegistry) Update(id string, updated *model.Monitoring) error
- type MonitoringRegistryOptions
- type PlanRegistry
- func (pr *PlanRegistry) Delete(id string) error
- func (pr *PlanRegistry) Get(id string) (*model.Plan, error)
- func (pr *PlanRegistry) List() ([]*model.Plan, error)
- func (pr *PlanRegistry) Pause(planID string) error
- func (pr *PlanRegistry) Register(tasks []*model.Task) (*model.Plan, error)
- func (pr *PlanRegistry) Run(planID string, executionID string) (string, error)
- func (pr *PlanRegistry) RunAsync(planID string, executionID string) (string, error)
- func (pr *PlanRegistry) Status(planID string) (model.Status, error)
- func (pr *PlanRegistry) Stop(planID string) error
- func (pr *PlanRegistry) Update(id string, updated model.Plan) error
- type PlanRegistryOptions
- type StatusManager
- type TaskRegistry
- func (ts *TaskRegistry) Delete(id string) error
- func (ts *TaskRegistry) Fork(taskID string, executionID string) (string, error)
- func (ts *TaskRegistry) ForkAsync(taskID string, executionID string) (string, error)
- func (ts *TaskRegistry) Get(taskID string) (*model.Task, error)
- func (ts *TaskRegistry) IsValidCheck(checks []*model.Check) error
- func (ts *TaskRegistry) List() ([]*model.Task, error)
- func (ts *TaskRegistry) Pause(taskID string) error
- func (ts *TaskRegistry) Register(task *model.Task) (*model.Task, error)
- func (ts *TaskRegistry) RollBack(taskID string, executionID string) (string, error)
- func (ts *TaskRegistry) RollBackAsync(taskID string, executionID string) (string, error)
- func (ts *TaskRegistry) Status(taskID string) (string, error)
- func (ts *TaskRegistry) Stop(taskID string) error
- func (ts *TaskRegistry) Update(id string, updated *model.Task) error
- func (ts *TaskRegistry) UpdateTaskStatus(task *model.Task, status model.Status) error
- func (ts *TaskRegistry) Validate(task *model.Task) error
- type TaskRegistryOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewComponentRegistry ¶
func NewComponentRegistry(opts ComponentRegistryOptions) (api.ComponentRegistry, error)
func NewControllerRegistry ¶
func NewControllerRegistry(opts ControllerRegistryOptions) (api.ControllerRegistry, error)
func NewMonitoringControllerRegistry ¶
func NewMonitoringControllerRegistry(opts MonitoringControllerRegistryOptions) (api.MonitoringControllerRegistry, error)
func NewMonitoringRegistry ¶
func NewMonitoringRegistry(opts MonitoringRegistryOptions) (api.MonitoringRegistry, error)
func NewNullLogger ¶
NewNullLogger creates a logger that discards all log output. Useful for testing or when logging is not required.
Returns: *logrus.Logger - configured logger with output discarded
func NewPlanRegistry ¶
func NewPlanRegistry(opts PlanRegistryOptions) (api.PlanRegistry, error)
func NewTaskRegistry ¶
func NewTaskRegistry(opts TaskRegistryOptions) (api.TaskRegistry, error)
Types ¶
type ComponentRegistry ¶
type ComponentRegistry struct {
Controllers api.ControllerRegistry
*Events
*StatusManager
// contains filtered or unexported fields
}
func (*ComponentRegistry) Delete ¶
func (cr *ComponentRegistry) Delete(id string) error
func (*ComponentRegistry) Disable ¶
func (cr *ComponentRegistry) Disable(id string) error
func (*ComponentRegistry) Enable ¶
func (cr *ComponentRegistry) Enable(id string) error
func (*ComponentRegistry) Get ¶
func (cr *ComponentRegistry) Get(id string) (*model.Component, error)
func (*ComponentRegistry) UpVersion ¶
func (cr *ComponentRegistry) UpVersion(componentID string, version string)
type ComponentRegistryOptions ¶
type ComponentRegistryOptions struct {
Logger *logrus.Logger
Controllers api.ControllerRegistry
StatusManager *StatusManager
EventManager *Events
}
type ControllerRegistry ¶
type ControllerRegistry struct {
// contains filtered or unexported fields
}
func (*ControllerRegistry) Delete ¶
func (cr *ControllerRegistry) Delete(c string) error
func (*ControllerRegistry) Get ¶
func (cr *ControllerRegistry) Get(componentType string) (api.Controller, error)
func (*ControllerRegistry) List ¶
func (cr *ControllerRegistry) List() ([]api.Controller, error)
func (*ControllerRegistry) ListType ¶
func (cr *ControllerRegistry) ListType() ([]string, error)
func (*ControllerRegistry) Register ¶
func (cr *ControllerRegistry) Register(controllerType string, controller api.Controller) error
func (*ControllerRegistry) Update ¶
func (cr *ControllerRegistry) Update(c string, comp api.Controller) error
type Core ¶
type Core struct {
Logger *logrus.Logger // Central logger instance
Components api.ComponentRegistry // Registry for system components
Controllers api.ControllerRegistry // Registry for component controllers
Monitorings api.MonitoringRegistry // Registry for monitoring systems
MonitorControllers api.MonitoringControllerRegistry // Registry for monitoring controllers
Tasks api.TaskRegistry // Registry for task management
Plans api.PlanRegistry // Registry for execution plans
}
Core represents the central orchestrator that manages all system operations. It contains registries for different system aspects and coordinates their interactions.
func NewCore ¶
func NewCore(opt CoreOptions) *Core
NewCore creates a new Core instance with custom configurations. Any nil options will be replaced with default implementations.
Parameters:
- opt: CoreOptions containing custom configurations
Returns: *Core - initialized core instance with merged custom and default configurations
func NewDefaultCore ¶
func NewDefaultCore() *Core
NewDefaultCore creates a new Core instance with default implementations for all registries and a null logger.
Returns: *Core - initialized core instance with default configurations
type CoreOptions ¶
type CoreOptions struct {
Logger *logrus.Logger `json:"Logger"` // Custom logger instance
Components api.ComponentRegistry `json:"Components"` // Custom component registry
Controllers api.ControllerRegistry `json:"Controllers"` // Custom controller registry
Monitorings api.MonitoringRegistry `json:"Monitorings"` // Custom monitoring registry
MonitorControllers api.MonitoringControllerRegistry `json:"MonitorControllers"` // Custom monitoring controller registry
Tasks api.TaskRegistry `json:"Tasks"` // Custom task registry
Plans api.PlanRegistry `json:"Plans"` // Custom plan registry
}
CoreOptions provides configuration options for initializing a Core instance. All fields are optional - nil values will be replaced with default implementations.
func DefaultOpts ¶ added in v0.1.5
func DefaultOpts(opt CoreOptions) CoreOptions
DefaultOpts ensures all required options are set with default values where no custom implementation is provided.
Parameters:
- opt: CoreOptions containing partial or complete configurations
Returns: CoreOptions - complete options with defaults filled in
type MonitoringControllerRegistry ¶
type MonitoringControllerRegistry struct {
Logger *logrus.Logger
// contains filtered or unexported fields
}
func (*MonitoringControllerRegistry) Delete ¶
func (mcr *MonitoringControllerRegistry) Delete(c string) error
func (*MonitoringControllerRegistry) Get ¶
func (mcr *MonitoringControllerRegistry) Get(componentType string) (api.MonitoringController, error)
func (*MonitoringControllerRegistry) List ¶
func (mcr *MonitoringControllerRegistry) List() ([]api.MonitoringController, error)
func (*MonitoringControllerRegistry) Register ¶
func (mcr *MonitoringControllerRegistry) Register(controllerType string, controller api.MonitoringController) error
func (*MonitoringControllerRegistry) Update ¶
func (mcr *MonitoringControllerRegistry) Update(c string, comp api.MonitoringController) error
type MonitoringRegistry ¶
type MonitoringRegistry struct {
*StatusManager
*Events
// contains filtered or unexported fields
}
func (*MonitoringRegistry) CheckConfig ¶ added in v0.3.0
func (mr *MonitoringRegistry) CheckConfig(compType string, compConfig map[string]string) error
func (*MonitoringRegistry) Delete ¶
func (mr *MonitoringRegistry) Delete(id string) error
func (*MonitoringRegistry) Get ¶
func (mr *MonitoringRegistry) Get(id string) (*model.Monitoring, error)
func (*MonitoringRegistry) List ¶
func (mr *MonitoringRegistry) List() ([]*model.Monitoring, error)
func (*MonitoringRegistry) Register ¶
func (mr *MonitoringRegistry) Register(tp string, m *model.Monitoring) (*model.Monitoring, error)
func (*MonitoringRegistry) Update ¶
func (mr *MonitoringRegistry) Update(id string, updated *model.Monitoring) error
type MonitoringRegistryOptions ¶
type MonitoringRegistryOptions struct {
Logger *logrus.Logger
Controllers api.MonitoringControllerRegistry
StatusManager *StatusManager
EventManager *Events
}
type PlanRegistry ¶
type PlanRegistry struct {
Components api.ComponentRegistry
Tasks api.TaskRegistry
*StatusManager
*Events
// contains filtered or unexported fields
}
func (*PlanRegistry) Delete ¶
func (pr *PlanRegistry) Delete(id string) error
DeletePlan removes a plan from storage.
func (*PlanRegistry) Get ¶
func (pr *PlanRegistry) Get(id string) (*model.Plan, error)
GetPlan retrieves a plan by ID.
func (*PlanRegistry) List ¶
func (pr *PlanRegistry) List() ([]*model.Plan, error)
ListPlans returns all plans.
func (*PlanRegistry) Pause ¶
func (pr *PlanRegistry) Pause(planID string) error
Pause temporarily halts execution of a running plan
func (*PlanRegistry) Run ¶
func (pr *PlanRegistry) Run(planID string, executionID string) (string, error)
func (*PlanRegistry) RunAsync ¶
func (pr *PlanRegistry) RunAsync(planID string, executionID string) (string, error)
func (*PlanRegistry) Status ¶
func (pr *PlanRegistry) Status(planID string) (model.Status, error)
Status returns the current status of a plan
func (*PlanRegistry) Stop ¶
func (pr *PlanRegistry) Stop(planID string) error
Stop terminates execution of a running plan
type PlanRegistryOptions ¶
type PlanRegistryOptions struct {
Logger *logrus.Logger
Components api.ComponentRegistry
Tasks api.TaskRegistry
StatusManager *StatusManager
EventManager *Events
}
type StatusManager ¶
type StatusManager struct {
}
func (*StatusManager) NewStatus ¶
func (s *StatusManager) NewStatus(status model.Status) *model.StatusHistory
func (*StatusManager) NextStatus ¶
func (s *StatusManager) NextStatus(status model.Status, history *model.StatusHistory) *model.StatusHistory
type TaskRegistry ¶
type TaskRegistry struct {
Components api.ComponentRegistry
Controllers api.ControllerRegistry
Monitoring api.MonitoringRegistry
MonitorControllers api.MonitoringControllerRegistry
*StatusManager
*Events
MU *sync.RWMutex
// contains filtered or unexported fields
}
func (*TaskRegistry) Delete ¶
func (ts *TaskRegistry) Delete(id string) error
func (*TaskRegistry) Fork ¶
func (ts *TaskRegistry) Fork(taskID string, executionID string) (string, error)
func (*TaskRegistry) ForkAsync ¶
func (ts *TaskRegistry) ForkAsync(taskID string, executionID string) (string, error)
func (*TaskRegistry) IsValidCheck ¶
func (ts *TaskRegistry) IsValidCheck(checks []*model.Check) error
func (*TaskRegistry) Pause ¶
func (ts *TaskRegistry) Pause(taskID string) error
func (*TaskRegistry) RollBack ¶
func (ts *TaskRegistry) RollBack(taskID string, executionID string) (string, error)
func (*TaskRegistry) RollBackAsync ¶
func (ts *TaskRegistry) RollBackAsync(taskID string, executionID string) (string, error)
func (*TaskRegistry) Stop ¶
func (ts *TaskRegistry) Stop(taskID string) error
func (*TaskRegistry) UpdateTaskStatus ¶
type TaskRegistryOptions ¶
type TaskRegistryOptions struct {
Logger *logrus.Logger
Components api.ComponentRegistry
Controllers api.ControllerRegistry
Monitoring api.MonitoringRegistry
MonitorControllers api.MonitoringControllerRegistry
StatusManager *StatusManager
EventManager *Events
}