opamp

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package opamp provides the implementation of the OpAMP use case for managing connections and agents.

Index

Constants

View Source
const (
	// DefaultOnConnectionCloseTimeout is the default timeout for closing a connection.
	DefaultOnConnectionCloseTimeout = 5 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	OnConnectionCloseTimeout time.Duration
	// contains filtered or unexported fields
}

Service is a struct that implements the OpAMPUsecase interface.

func New

func New(
	agentUsecase domainport.AgentUsecase,
	commandUsecase domainport.CommandUsecase,
	connectionUsecase domainport.ConnectionUsecase,
	logger *slog.Logger,
) *Service

New creates a new instance of the OpAMP service.

func (*Service) Name added in v0.0.16

func (s *Service) Name() string

Name returns the name of the service.

func (*Service) OnConnected added in v0.0.15

func (s *Service) OnConnected(ctx context.Context, conn types.Connection)

OnConnected implements port.OpAMPUsecase.

func (*Service) OnConnectionClose added in v0.0.15

func (s *Service) OnConnectionClose(conn types.Connection)

OnConnectionClose implements port.OpAMPUsecase.

func (*Service) OnMessage added in v0.0.15

func (s *Service) OnMessage(
	ctx context.Context,
	conn types.Connection,
	message *protobufs.AgentToServer,
) *protobufs.ServerToAgent

OnMessage implements port.OpAMPUsecase.

func (*Service) OnReadMessageError added in v0.1.18

func (s *Service) OnReadMessageError(
	conn types.Connection,
	messageType int,
	msgByte []byte,
	err error,
)

OnReadMessageError implements port.OpAMPUsecase.

func (*Service) Run added in v0.0.15

func (s *Service) Run(ctx context.Context) error

Run starts a loop to handle asynchronous operations for the service.

Jump to

Keyboard shortcuts

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