vulinboxagentclient

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const Expire = 10 * time.Second

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func Connect

func Connect(addr string, options ...Option) (*Client, error)

func (*Client) Disconnect

func (c *Client) Disconnect()

func (*Client) MessageMux

func (c *Client) MessageMux(bytes []byte)

func (*Client) Msg

func (c *Client) Msg() *MsgPrepare

func (*Client) RegisterDataback added in v1.2.7

func (c *Client) RegisterDataback(kind string, f func(any))

RegisterDataback register databack handler attention that no racing protect here, so you should register databack handler before connect

func (*Client) Send

func (c *Client) Send(data any)

type MsgPrepare

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

func (*MsgPrepare) Callback

func (m *MsgPrepare) Callback(f func([]byte) error) *MsgPrepare

func (*MsgPrepare) Send

func (m *MsgPrepare) Send(data any)

Send wants a pointer

type Option

type Option func(c *Client)

func WithOnClose

func WithOnClose(f func()) Option

Jump to

Keyboard shortcuts

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