client

package
v0.0.0-...-0ed3018 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2020 License: GPL-2.0, GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTimeout            = errors.New("connection timed out")
	ErrSubdomainOccupied  = errors.New("subdomain occupied")
	ErrConnectTokenFailed = errors.New("failed to obtain connect token")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Domain    string
	Subdomain string
	LocalPort int
	Secure    bool
}

type LeapClient

type LeapClient struct {
	Config *Config

	OnError       func(error)
	OnConnect     func()
	OnDisconnect  func()
	OnStateChange func(State)
	OnRequest     func(r *http.Request)
	// contains filtered or unexported fields
}

func New

func New(config *Config) *LeapClient

func (*LeapClient) Run

func (c *LeapClient) Run(ctx context.Context) error

func (*LeapClient) SetState

func (c *LeapClient) SetState(state State)

func (*LeapClient) Subdomain

func (c *LeapClient) Subdomain() string

type State

type State uint8
const (
	GettingToken State = iota
	Connecting
	Connected
	Disconnecting
	Disconnected
)

func (State) String

func (s State) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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