chclient

package
v0.0.0-...-72a0dfd Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: MIT Imports: 30 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 {
	*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) 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        `yaml:"fingerprint,omitempty"`
	Auth             string        `yaml:"auth,omitempty"`
	KeepAlive        time.Duration `yaml:"keepalive,omitempty"`
	MaxRetryCount    int           `yaml:"max-retry-count,omitempty"`
	MaxRetryInterval time.Duration `yaml:"max-retry-interval,omitempty"`
	Server           string        `yaml:"server,omitempty"`
	Proxy            string        `yaml:"proxy,omitempty"`
	Remotes          []string      `yaml:"remotes,omitempty"`
	Headers          http.Header   `yaml:"headers,omitempty"`
	TLS              TLSConfig     `yaml:"tls,omitempty"`
	DialContext      func(ctx context.Context, network, addr string) (net.Conn, error)
	Verbose          bool `yaml:"verbose,omitempty"`
}

Config represents a client configuration

func NewClientConfig

func NewClientConfig(profileConfigPath string, cfg *Config) (*Config, error)

type TLSConfig

type TLSConfig struct {
	SkipVerify bool   `yaml:"tls-skip-verify,omitempty"`
	CA         string `yaml:"tls-ca,omitempty"`
	Cert       string `yaml:"tls-cert,omitempty"`
	Key        string `yaml:"tls-key,omitempty"`
	ServerName string `yaml:"hostname,omitempty"`
}

TLSConfig for a Client

Jump to

Keyboard shortcuts

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