agent

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package agent provides the Agent gRPC service implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileStatus

type FileStatus interface {
	IsError() bool
	IsMissing() bool
}

FileStatus represents the status of a file from health reports

type Options

type Options struct {
	Storage              storage.Storage
	ConfigLoader         *config.Loader
	LocalDB              *localdb.DB
	SecretsStore         secrets.Store
	CACertPEM            []byte
	CAKeyPEM             []byte
	Shard                string
	Provider             infra.Provider
	Logger               *slog.Logger
	OnSpotTermination    func(instanceID string, notice *proto.TerminationNotice) error
	OnReconcileRequested func(groupKey, reason string) error
	OnInstanceDisconnect func(instanceID string, graceful bool) error
}

Options contains options for creating an AgentService

type PendingFile

type PendingFile struct {
	Filename     string
	Content      []byte
	LastModified time.Time
}

PendingFile represents a file waiting to be delivered to an agent

type PendingKeyRequest

type PendingKeyRequest struct {
	KeyNames []string
	Created  time.Time
}

PendingKeyRequest represents a key generation request waiting to be delivered to an agent

type ProtoFileStatus

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

ProtoFileStatus adapts proto.FileStatus to FileStatus interface

func (*ProtoFileStatus) IsError

func (p *ProtoFileStatus) IsError() bool

func (*ProtoFileStatus) IsMissing

func (p *ProtoFileStatus) IsMissing() bool

type Service

type Service struct {
	proto.UnimplementedAgentServiceServer
	// contains filtered or unexported fields
}

Service implements the AgentService gRPC service

func New

func New(opts Options) (*Service, error)

New creates a new AgentService

func (*Service) QueueFile

func (s *Service) QueueFile(instanceID, filename string, content []byte)

QueueFile implements FileDelivery interface

func (*Service) ReceiveFiles

func (s *Service) ReceiveFiles(req *emptypb.Empty, stream proto.AgentService_ReceiveFilesServer) error

ReceiveFiles provides a persistent stream of files to be sent to the agent

func (*Service) ReceiveKeyRequests

func (s *Service) ReceiveKeyRequests(req *emptypb.Empty, stream proto.AgentService_ReceiveKeyRequestsServer) error

ReceiveKeyRequests provides a persistent stream of key generation requests from server to agent

func (*Service) SubmitHealthReport

func (s *Service) SubmitHealthReport(stream proto.AgentService_SubmitHealthReportServer) error

SubmitHealthReport processes health reports from agents via persistent stream

func (*Service) SubmitPublicKeys

func (s *Service) SubmitPublicKeys(ctx context.Context, req *proto.PublicKeysRequest) (*emptypb.Empty, error)

SubmitPublicKeys processes public key submissions by storing them transactionally

Jump to

Keyboard shortcuts

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