liteclient

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2022 License: Apache-2.0 Imports: 22 Imported by: 90

Documentation

Index

Constants

View Source
const ADNLQuery int32 = -1265895046
View Source
const ADNLQueryResponse int32 = 262964246
View Source
const LiteServerQuery int32 = 2039219935
View Source
const TCPPing int32 = 1292381082
View Source
const TCPPong int32 = -597034237

Variables

View Source
var ErrNoActiveConnections = errors.New("no active connections")

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient() *Client

func (*Client) Connect

func (c *Client) Connect(ctx context.Context, addr, serverKey string) error

func (*Client) DefaultReconnect added in v0.2.0

func (c *Client) DefaultReconnect(waitBeforeReconnect time.Duration, maxTries int) OnDisconnectCallback

func (*Client) Do

func (c *Client) Do(ctx context.Context, typeID int32, payload []byte) (*LiteResponse, error)

func (*Client) SetOnDisconnect added in v0.2.0

func (c *Client) SetOnDisconnect(cb OnDisconnectCallback)

type LiteRequest

type LiteRequest struct {
	TypeID   int32
	QueryID  []byte
	Data     []byte
	RespChan chan *LiteResponse
}

type LiteResponse

type LiteResponse struct {
	TypeID int32
	Data   []byte
	// contains filtered or unexported fields
}

type OnDisconnectCallback added in v0.2.0

type OnDisconnectCallback func(addr, key string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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