Documentation
¶
Overview ¶
Package agent provides application services for the agent
Index ¶
- Variables
- type Service
- func (s *Service) DeleteAgent(ctx context.Context, namespace string, instanceUID uuid.UUID) error
- func (s *Service) GetAgent(ctx context.Context, namespace string, instanceUID uuid.UUID) (*v1.Agent, error)
- func (s *Service) ListAgents(ctx context.Context, namespace string, options *model.ListOptions) (*v1.ListResponse[v1.Agent], error)
- func (s *Service) SearchAgents(ctx context.Context, namespace string, query string, ...) (*v1.ListResponse[v1.Agent], error)
- func (s *Service) UpdateAgent(ctx context.Context, namespace string, instanceUID uuid.UUID, api *v1.Agent) (*v1.Agent, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrRestartCapabilityNotSupported is returned when agent doesn't support restart capability. ErrRestartCapabilityNotSupported = errors.New("agent does not support restart capability") // ErrAgentNamespaceMismatch is returned when the agent does not belong to the specified namespace. // It aliases the application port sentinel so the HTTP layer can map it to a 404 while existing // references to this package-level name keep working. ErrAgentNamespaceMismatch = applicationport.ErrAgentNamespaceMismatch )
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is a struct that implements the AgentManageUsecase interface.
func New ¶
func New( agentUsecase agentport.AgentUsecase, agentNotificationUsecase agentport.AgentNotificationUsecase, logger *slog.Logger, ) *Service
New creates a new instance of the Service struct.
func (*Service) DeleteAgent ¶
func (s *Service) DeleteAgent( ctx context.Context, namespace string, instanceUID uuid.UUID, ) error
DeleteAgent implements [port.AgentManageUsecase].
Only disconnected agents may be deleted. The connection guard is enforced by the domain DeleteAgent (against a fresh read), so a still-connected agent is rejected with applicationport.ErrAgentConnected; this method just scopes the delete to the requested namespace.
func (*Service) GetAgent ¶
func (s *Service) GetAgent( ctx context.Context, namespace string, instanceUID uuid.UUID, ) (*v1.Agent, error)
GetAgent implements port.AgentManageUsecase.
func (*Service) ListAgents ¶
func (s *Service) ListAgents( ctx context.Context, namespace string, options *model.ListOptions, ) (*v1.ListResponse[v1.Agent], error)
ListAgents implements port.AgentManageUsecase.
func (*Service) SearchAgents ¶
func (s *Service) SearchAgents( ctx context.Context, namespace string, query string, options *model.ListOptions, ) (*v1.ListResponse[v1.Agent], error)
SearchAgents implements port.AgentManageUsecase.
Click to show internal directories.
Click to hide internal directories.