Documentation
¶
Overview ¶
Package service provides the service layer for the opampcommander application.
Index ¶
- Variables
- type AgentService
- func (s *AgentService) GetAgent(ctx context.Context, instanceUID uuid.UUID) (*model.Agent, error)
- func (s *AgentService) GetOrCreateAgent(ctx context.Context, instanceUID uuid.UUID) (*model.Agent, error)
- func (s *AgentService) ListAgents(ctx context.Context) ([]*model.Agent, error)
- func (s *AgentService) SaveAgent(ctx context.Context, agent *model.Agent) error
- func (s *AgentService) UpdateAgentConfig(ctx context.Context, instanceUID uuid.UUID, config any) error
- type CommandService
- func (s *CommandService) GetCommand(ctx context.Context, commandID uuid.UUID) (*model.Command, error)
- func (s *CommandService) GetCommandByInstanceUID(ctx context.Context, instanceUID uuid.UUID) ([]*model.Command, error)
- func (s *CommandService) ListCommands(context.Context) ([]*model.Command, error)
- func (s *CommandService) SaveCommand(ctx context.Context, command *model.Command) error
- type Service
- func (s *Service) DeleteConnection(_ context.Context, connection *model.Connection) error
- func (s *Service) GetConnectionByID(_ context.Context, id any) (*model.Connection, error)
- func (s *Service) GetConnectionByInstanceUID(_ context.Context, instanceUID uuid.UUID) (*model.Connection, error)
- func (s *Service) ListConnections(_ context.Context) ([]*model.Connection, error)
- func (s *Service) SaveConnection(_ context.Context, connection *model.Connection) error
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotImplemented is returned when a method is not implemented. ErrNotImplemented = errors.New("not implemented") )
Functions ¶
This section is empty.
Types ¶
type AgentService ¶
type AgentService struct {
// contains filtered or unexported fields
}
AgentService is a struct that implements the AgentUsecase interface.
func NewAgentService ¶
func NewAgentService( agentPersistencePort port.AgentPersistencePort, ) *AgentService
NewAgentService creates a new instance of AgentService.
func (*AgentService) GetOrCreateAgent ¶
func (s *AgentService) GetOrCreateAgent(ctx context.Context, instanceUID uuid.UUID) (*model.Agent, error)
GetOrCreateAgent retrieves an agent by its instance UID.
func (*AgentService) ListAgents ¶
ListAgents retrieves all agents from the persistence layer.
func (*AgentService) UpdateAgentConfig ¶ added in v0.0.2
func (s *AgentService) UpdateAgentConfig(ctx context.Context, instanceUID uuid.UUID, config any) error
UpdateAgentConfig updates the agent configuration.
type CommandService ¶
type CommandService struct {
// contains filtered or unexported fields
}
CommandService is a struct that implements the CommandUsecase interface.
func NewCommandService ¶
func NewCommandService( commandPersistencePort port.CommandPersistencePort, ) *CommandService
NewCommandService creates a new instance of CommandService.
func (*CommandService) GetCommand ¶
func (s *CommandService) GetCommand(ctx context.Context, commandID uuid.UUID) (*model.Command, error)
GetCommand retrieves a command by its ID.
func (*CommandService) GetCommandByInstanceUID ¶
func (s *CommandService) GetCommandByInstanceUID(ctx context.Context, instanceUID uuid.UUID) ([]*model.Command, error)
GetCommandByInstanceUID retrieves a command by its instance UID.
func (*CommandService) ListCommands ¶ added in v0.0.2
ListCommands implements port.CommandUsecase.
func (*CommandService) SaveCommand ¶
SaveCommand saves the command to the persistence layer.
type Service ¶ added in v0.0.15
type Service struct {
// contains filtered or unexported fields
}
Service is a struct that implements the ConnectionUsecase interface.
func NewConnectionService ¶ added in v0.0.15
func NewConnectionService( agentUsecase port.AgentUsecase, logger *slog.Logger, ) *Service
NewConnectionService creates a new instance of the Service struct.
func (*Service) DeleteConnection ¶ added in v0.0.15
DeleteConnection implements port.ConnectionUsecase.
func (*Service) GetConnectionByID ¶ added in v0.0.15
GetConnectionByID implements port.ConnectionUsecase.
func (*Service) GetConnectionByInstanceUID ¶ added in v0.0.15
func (s *Service) GetConnectionByInstanceUID(_ context.Context, instanceUID uuid.UUID) (*model.Connection, error)
GetConnectionByInstanceUID implements port.ConnectionUsecase.
func (*Service) ListConnections ¶ added in v0.0.15
ListConnections implements port.ConnectionUsecase.
func (*Service) SaveConnection ¶ added in v0.0.15
SaveConnection implements port.ConnectionUsecase.