client

package
v3.5.4 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusNormal = uint32(1)
	StatusStop   = uint32(2)
)

Variables

Functions

This section is empty.

Types

type Client

type Client struct {
	BufferSize           int
	WriteWait            time.Duration
	PingPeriod           time.Duration
	PongWait             time.Duration
	TextMessageHandler   func(message []byte)
	BinaryMessageHandler func(message []byte)
	ErrorHandler         func(err error)
	SendMessageHandler   func(envelope *Envelope)
	// contains filtered or unexported fields
}

func NewClient

func NewClient(conn *websocket.Conn, sendChanLength uint) *Client

func (*Client) Close

func (c *Client) Close()

func (*Client) GetEnvelope

func (c *Client) GetEnvelope() *Envelope

func (*Client) IsRunning

func (c *Client) IsRunning() bool

func (*Client) PutEnvelope

func (c *Client) PutEnvelope(envelope *Envelope)

func (*Client) ReadPump

func (c *Client) ReadPump()

func (*Client) Send

func (c *Client) Send(envelope *Envelope)

func (*Client) WritePump

func (c *Client) WritePump()

type Envelope

type Envelope struct {
	Type int
	Msg  *bytes.Buffer
}

func (*Envelope) Reset

func (e *Envelope) Reset()

type EnvelopePool

type EnvelopePool struct {
	// contains filtered or unexported fields
}
var GlobalEnvelopePool EnvelopePool

func (*EnvelopePool) Get

func (ep *EnvelopePool) Get() *Envelope

func (*EnvelopePool) Put

func (ep *EnvelopePool) Put(epv *Envelope)

type WSAction

type WSAction struct {
	Action string          `json:"action"`
	Args   json.RawMessage `json:"args"`
}

Jump to

Keyboard shortcuts

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