agentclient

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package agentclient provides a connection pool for the epochd node agent's gRPC API. One gRPC connection is maintained per node IP and reused across calls. Connections are created lazily on first use and closed by Close.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pool

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

Pool manages gRPC connections to node agents, keyed by "nodeIP:port".

func NewPool

func NewPool(agentPort string) *Pool

NewPool creates a Pool that dials agents on agentPort (e.g. "9100").

func (*Pool) Close

func (p *Pool) Close()

Close closes all pooled connections.

func (*Pool) GetStatus

func (p *Pool) GetStatus(ctx context.Context, nodeIP, handleID string) (*api.HandleStatus, error)

GetStatus calls the agent's Status RPC and returns the live injection state.

func (*Pool) Inject

func (p *Pool) Inject(ctx context.Context, nodeIP, containerID string, target time.Time, freeze bool) (string, error)

Inject calls the agent's Inject RPC on the node at nodeIP. When freeze is true the agent starts the clock in freeze mode.

func (*Pool) Reset

func (p *Pool) Reset(ctx context.Context, nodeIP, handleID string) error

Reset calls the agent's Reset RPC on the node at nodeIP.

func (*Pool) SetTime

func (p *Pool) SetTime(ctx context.Context, nodeIP, handleID string, target time.Time, freeze bool) error

SetTime calls the agent's SetTime RPC on the node at nodeIP. When freeze is true the agent switches the clock to freeze mode at target.

Jump to

Keyboard shortcuts

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