chclient

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: MIT Imports: 27 Imported by: 30

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*cio.Logger
	// contains filtered or unexported fields
}

Client represents a client instance

func NewClient

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

NewClient creates a new client instance

func (*Client) Close

func (c *Client) Close() error

Close manually stops the client

func (*Client) Ready added in v1.12.0

func (c *Client) Ready(ctx context.Context) bool

Ready blocks until the client has an active connection to the server, returning false if the context is cancelled or the connection wait times out first

func (*Client) Run

func (c *Client) Run() error

Run starts client and blocks while connected

func (*Client) Start

func (c *Client) Start(ctx context.Context) error

Start client and does not block

func (*Client) Wait

func (c *Client) Wait() error

Wait blocks while the client is running.

type Config

type Config struct {
	Fingerprint      string                                                            `` /* 506-byte string literal not displayed */
	Auth             string                                                            `` /* 246-byte string literal not displayed */
	KeepAlive        time.Duration                                                     `` /* 317-byte string literal not displayed */
	MaxRetryCount    int                                                               `opts:"name=max-retry-count,short=-" help:"Maximum number of times to retry before exiting. Defaults to unlimited."`
	MinRetryInterval time.Duration                                                     `opts:"name=min-retry-interval,short=-" help:"Minimum wait time before retrying after a disconnection. Defaults to 1 second."`
	MaxRetryInterval time.Duration                                                     `opts:"name=max-retry-interval,short=-" help:"Maximum wait time before retrying after a disconnection. Defaults to 5 minutes."`
	Server           string                                                            `opts:"name=server,mode=arg"`
	Proxy            string                                                            `` /* 476-byte string literal not displayed */
	Remotes          []string                                                          `opts:"name=remote,mode=arg,min=1"`
	Headers          http.Header                                                       `opts:"-"`
	TLS              TLSConfig                                                         `opts:"mode=embedded"`
	DialContext      func(ctx context.Context, network, addr string) (net.Conn, error) `opts:"-"`
	Verbose          bool                                                              `opts:"name=verbose,short=v" help:"Enable verbose logging"`
}

Config represents a client configuration

type TLSConfig added in v1.7.0

type TLSConfig struct {
	SkipVerify bool   `` /* 426-byte string literal not displayed */
	CA         string `` /* 222-byte string literal not displayed */
	Cert       string `` /* 176-byte string literal not displayed */
	Key        string `opts:"name=tls-key,short=-" help:"a path to a PEM encoded private key used for client authentication (mutual-TLS)."`
	ServerName string `opts:"-"`
}

TLSConfig for a Client

Jump to

Keyboard shortcuts

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