client

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

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 is a struct that holds the connection to the server

func NewClient

func NewClient(config Config) (*Client, error)

NewClient creates a new client with connection management and returns a pointer to it and an error

func (*Client) CheckAndReconnect

func (c *Client) CheckAndReconnect() error

CheckAndReconnect checks connection health and reconnects if necessary

func (*Client) Close

func (c *Client) Close()

Close closes the connection to the server

func (*Client) Reconnect

func (c *Client) Reconnect() error

Reconnect attempts to reconnect if the connection is down

func (*Client) SendCommands

func (c *Client) SendCommands(commands []*gen.Command, auth *gen.Auth) error

SendCommands sends a list of commands to the server

func (*Client) SendProcesses

func (c *Client) SendProcesses(processes []*gen.Process, auth *gen.Auth) error

SendProcesses sends a list of processes to the server

type Config

type Config struct {
	Address          string // The server address
	SecureConnection bool   // True for secure (HTTPS), false for insecure (HTTP)
	CertFile         string // Optional path to the TLS cert file for secure connections
	Timeout          int    // Timeout in seconds for the connection
}

Config holds configuration for the client connection.

Jump to

Keyboard shortcuts

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