service

package
v0.1.2-debug-auth Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package service provides the service layer for the opampcommander application.

Index

Constants

This section is empty.

Variables

View Source
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) GetAgent

func (s *AgentService) GetAgent(ctx context.Context, instanceUID uuid.UUID) (*model.Agent, error)

GetAgent retrieves an agent by its instance UID.

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

func (s *AgentService) ListAgents(ctx context.Context) ([]*model.Agent, error)

ListAgents retrieves all agents from the persistence layer.

func (*AgentService) SaveAgent

func (s *AgentService) SaveAgent(ctx context.Context, agent *model.Agent) error

SaveAgent saves the agent to 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

func (s *CommandService) ListCommands(context.Context) ([]*model.Command, error)

ListCommands implements port.CommandUsecase.

func (*CommandService) SaveCommand

func (s *CommandService) SaveCommand(ctx context.Context, command *model.Command) error

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

func (s *Service) DeleteConnection(_ context.Context, connection *model.Connection) error

DeleteConnection implements port.ConnectionUsecase.

func (*Service) GetConnectionByID added in v0.0.15

func (s *Service) GetConnectionByID(_ context.Context, id any) (*model.Connection, error)

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

func (s *Service) ListConnections(_ context.Context) ([]*model.Connection, error)

ListConnections implements port.ConnectionUsecase.

func (*Service) SaveConnection added in v0.0.15

func (s *Service) SaveConnection(_ context.Context, connection *model.Connection) error

SaveConnection implements port.ConnectionUsecase.

Jump to

Keyboard shortcuts

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