chclient

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: May 20, 2020 License: MIT Imports: 14 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 {
	*chshare.Logger
	// contains filtered or unexported fields
}

Client represents a client instance

func NewClient

func NewClient(config *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. Can only be called once.

type Config

type Config struct {
	Fingerprint      string
	Auth             string
	KeepAlive        time.Duration
	MaxRetryCount    int
	MaxRetryInterval time.Duration
	Server           string
	Proxy            string
	Remotes          []string
	Headers          http.Header
	DialContext      func(ctx context.Context, network, addr string) (net.Conn, error)
	// contains filtered or unexported fields
}

Config represents a client configuration

Jump to

Keyboard shortcuts

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