agent

package
v0.1.20 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package agent provides application services for the agent

Index

Constants

View Source
const (
	// TextJSON is the content type for JSON.
	TextJSON = "text/json"
	// TextYAML is the content type for YAML.
	TextYAML = "text/yaml"
	// Empty is the content type for empty.
	// Empty content type is treated as YAML by default.
	// Due to spec miss, old otel-collector sends empty content type even though it should be YAML.
	Empty = ""
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Mapper added in v0.1.18

type Mapper struct{}

Mapper is a struct that provides methods to map between domain models and API models.

func NewMapper added in v0.1.18

func NewMapper() *Mapper

NewMapper creates a new instance of Mapper.

func (*Mapper) MapAgentToAPI added in v0.1.18

func (mapper *Mapper) MapAgentToAPI(agent *model.Agent) *v1agent.Agent

MapAgentToAPI maps a domain model Agent to an API model Agent.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service is a struct that implements the AgentManageUsecase interface.

func New

func New(
	agentUsecase domainport.AgentUsecase,
	commandUsecase domainport.CommandUsecase,
) *Service

New creates a new instance of the Service struct.

func (*Service) GetAgent

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

GetAgent implements port.AgentManageUsecase.

func (*Service) ListAgents

func (s *Service) ListAgents(
	ctx context.Context,
	options *model.ListOptions,
) (*v1agent.ListResponse, error)

ListAgents implements port.AgentManageUsecase.

func (*Service) SendCommand

func (s *Service) SendCommand(ctx context.Context, targetInstanceUID uuid.UUID, command *model.Command) error

SendCommand implements port.AgentManageUsecase.

Jump to

Keyboard shortcuts

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