operations

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrOperationInvalid     = errors.New("operation_invalid")
	ErrSnapshotEpochChanged = errors.New("snapshot_epoch_changed")
	ErrInvalidAgentResponse = errors.New("invalid_agent_response")
	ErrServiceClosed        = errors.New("agent operation service is closed")
	ErrAgentIdentityChanged = errors.New("agent_identity_changed")
)

Functions

This section is empty.

Types

type AgentFinder

type AgentFinder interface {
	FindAgent(ctx context.Context, agentID string) (models.Agent, error)
}

type ConnectionAuthorizer

type ConnectionAuthorizer interface {
	Authorize(agent models.Agent, operation connectivity.Operation) (connectivity.OperationLease, error)
}

type ControlOperator

type ControlOperator interface {
	CallSessionContext(ctx context.Context, agentID string, generation uint64, method string, params any, timeout time.Duration) (json.RawMessage, error)
}

type ProbeOperator

type ProbeOperator interface {
	EnqueueManualSession(ctx context.Context, sourceID string, expectedControlGeneration uint64, scope protocol.ProbeScope) (protocol.ProbeAck, error)
}

type RelayOperator

type RelayOperator interface {
	Drain(agentID string, generation uint64) error
	Disconnect(agentID string, generation uint64, cause error) error
}

type Service

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

func NewService

func NewService(ctx context.Context, agents AgentFinder, sources Sources) *Service

func (*Service) Authorize

func (s *Service) Authorize(ctx context.Context, req protocol.OperationRequest) error

func (*Service) Cancel

func (s *Service) Cancel()

func (*Service) Close

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

func (*Service) Done

func (s *Service) Done() <-chan struct{}

func (*Service) EnqueueProbe

func (*Service) Execute

func (*Service) ForceFullSync

func (*Service) Interrupt

func (s *Service) Interrupt(ctx context.Context, req protocol.OperationRequest) (bool, error)

type Sources

type Sources struct {
	Connections ConnectionAuthorizer
	Control     ControlOperator
	Relay       RelayOperator
	Probes      ProbeOperator
	Now         func() time.Time
}

Jump to

Keyboard shortcuts

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