client

package
v1.0.21 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: Apache-2.0 Imports: 12 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 interface {
	Close()
	Connect(context.Context) error
	GetConnId() string
	OnMessageReceivedHandler(func([]byte))
	OnMessageParseHandler(func(net.Conn))
	SendError(err error)
	Send([]byte) error
}

func NewClient

func NewClient(ctx context.Context, addr string, protocol string) (Client, error)

type QuicClient

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

func NewQuicClient

func NewQuicClient() *QuicClient

func (*QuicClient) Close

func (qs *QuicClient) Close()

func (*QuicClient) Connect

func (qs *QuicClient) Connect(ctx context.Context) error

func (*QuicClient) GetConnId

func (qs *QuicClient) GetConnId() string

func (*QuicClient) OnMessageParseHandler

func (qs *QuicClient) OnMessageParseHandler(handler func(net.Conn))

func (*QuicClient) OnMessageReceivedHandler

func (qs *QuicClient) OnMessageReceivedHandler(handler func([]byte))

func (*QuicClient) Send added in v1.0.17

func (qs *QuicClient) Send(msg []byte) error

func (*QuicClient) SendError

func (qs *QuicClient) SendError(err error)

type TcpClient

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

func NewTcpClient

func NewTcpClient(address string) *TcpClient

func (*TcpClient) Close

func (ws *TcpClient) Close()

func (*TcpClient) Connect

func (ws *TcpClient) Connect(ctx context.Context) error

func (*TcpClient) GetConnId

func (ws *TcpClient) GetConnId() string

func (*TcpClient) OnMessageParseHandler

func (ws *TcpClient) OnMessageParseHandler(handler func(net.Conn))

func (*TcpClient) OnMessageReceivedHandler

func (ws *TcpClient) OnMessageReceivedHandler(handler func([]byte))

func (*TcpClient) Send

func (ws *TcpClient) Send(msg []byte) error

func (*TcpClient) SendError

func (ws *TcpClient) SendError(err error)

type WsClient

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

func NewWsClient

func NewWsClient(address string) *WsClient

func (*WsClient) Close

func (ws *WsClient) Close()

func (*WsClient) Connect

func (ws *WsClient) Connect(ctx context.Context) error

func (*WsClient) GetConnId

func (ws *WsClient) GetConnId() string

func (*WsClient) OnMessageParseHandler

func (ws *WsClient) OnMessageParseHandler(handler func(net.Conn))

func (*WsClient) OnMessageReceivedHandler

func (ws *WsClient) OnMessageReceivedHandler(handler func([]byte))

func (*WsClient) OnParseMsgHandler

func (ws *WsClient) OnParseMsgHandler(src *os.File)

func (*WsClient) Send

func (ws *WsClient) Send(msg []byte) error

func (*WsClient) SendError

func (ws *WsClient) SendError(err error)

Jump to

Keyboard shortcuts

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