Documentation
¶
Index ¶
Constants ¶
View Source
const ( StatusNormal = uint32(1) StatusStop = uint32(2) )
View Source
const BufferSize4M = 4 * 1024 * 1024
View Source
const DefaultMessageTimeout = time.Minute * 5
View Source
const DefaultPingPeriod = (60 * time.Second * 9) / 10
View Source
const DefaultPongWait = 60 * time.Second
View Source
const DefaultWriteWait = 10 * time.Second
Variables ¶
View Source
var DefaultDialer = websocket.Dialer{ Proxy: http.ProxyFromEnvironment, HandshakeTimeout: 45 * time.Second, ReadBufferSize: BufferSize4M, WriteBufferSize: BufferSize4M, WriteBufferPool: &sync.Pool{}, }
View Source
var JsonI = jsoniter.ConfigCompatibleWithStandardLibrary
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 (*Client) GetEnvelope ¶
func (*Client) PutEnvelope ¶
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"`
}
Click to show internal directories.
Click to hide internal directories.