agent

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package agent provides a gRPC client for agent services.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client handles authenticated access to the AgentService

func NewClient

func NewClient(logger *slog.Logger, cfg Config) (*Client, error)

NewClient creates a new agent gRPC client wrapper

func (*Client) Close

func (c *Client) Close() error

Close shuts down the underlying gRPC connection

func (*Client) ReceiveKeyRequests

func (c *Client) ReceiveKeyRequests(ctx context.Context, handler KeyRequestHandler) error

ReceiveKeyRequests starts receiving key generation requests from the server

func (*Client) StreamFiles

func (c *Client) StreamFiles(ctx context.Context, rcvr *receiver.Receiver) error

StreamFiles subscribes to server-sent files and writes them using the provided receiver.

func (*Client) SubmitHealthReports

func (c *Client) SubmitHealthReports(ctx context.Context, reportChan <-chan health.Report) error

SubmitHealthReports maintains a persistent stream and sends reports periodically

func (*Client) SubmitPublicKeys

func (c *Client) SubmitPublicKeys(ctx context.Context, publicKeys map[string]string) error

SubmitPublicKeys sends generated public keys to the agent service. Note that Certificates are returned via the StreamFiles RPC.

type Config

type Config struct {
	ServerAddress string
	ServerCACert  x509.Certificate
	ClientCert    *x509.Certificate
	PrivateKey    crypto.PrivateKey
	InstanceID    string
}

Config holds the connection settings for the agent gRPC client

type KeyRequestHandler

type KeyRequestHandler interface {
	HandleKeyRequest(keyNames []string) error
}

KeyRequestHandler is called when the server sends key generation requests

Jump to

Keyboard shortcuts

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