client

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NodeClient

type NodeClient struct {
	Node   *models.Node
	Conn   *grpc.ClientConn
	Client pb.DaemonServiceClient
}

NodeClient wraps a gRPC connection to a daemon

type Pool

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

Pool manages gRPC connections to multiple daemons

func NewPool

func NewPool(timeout time.Duration) *Pool

NewPool creates a new client pool

func (*Pool) CheckHealth

func (p *Pool) CheckHealth(ctx context.Context) (map[string]*pb.DaemonStatus, error)

CheckHealth checks the health of all connected nodes

func (*Pool) Close

func (p *Pool) Close() error

Close closes all connections

func (*Pool) Connect

func (p *Pool) Connect(ctx context.Context, node *models.Node) error

Connect establishes a connection to a node

func (*Pool) ConnectAll

func (p *Pool) ConnectAll(ctx context.Context, nodes []*models.Node) error

ConnectAll establishes connections to all nodes

func (*Pool) Count

func (p *Pool) Count() int

Count returns the number of connected clients

func (*Pool) GetAllClients

func (p *Pool) GetAllClients() []*NodeClient

GetAllClients returns all connected clients

func (*Pool) GetClient

func (p *Pool) GetClient(nodeID string) (*NodeClient, error)

GetClient returns the client for a node

func (*Pool) Initialize

func (p *Pool) Initialize(ctx context.Context, config *pb.InitializeRequest) error

Initialize initializes all connected daemons

func (*Pool) IsConnected

func (p *Pool) IsConnected(nodeID string) bool

IsConnected checks if a node is connected

func (*Pool) StopAll

func (p *Pool) StopAll(ctx context.Context) error

StopAll stops all processes on all nodes

Jump to

Keyboard shortcuts

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