Versions in this module Expand all Collapse all v0 v0.1.0 Jul 20, 2022 Changes in this version + const BinaryMessage + const CloseMessage + const DEFAULT_BUFFER_SIZE + const DEFAULT_CHUNK_SIZE + const DEFAULT_COMPRESS_LEVEL + const DEFAULT_MAGIC_KEY + const DEFAULT_MAX_STREAMS + const DEFAULT_POOL_WAIT + const DEFAULT_TIMEOUT + const MAX_STREAMS_IN_THEORY + const PingMessage + const PongMessage + const StatusClosed + const StatusReady + const StatusTimeout + const StatusYetReady + const TextMessage + type Adapter interface + Close func() + Dispatch func(MessageType, []byte) error + DispatchReader func(MessageType, io.Reader) error + Group func() string + KeepPing func(int, int) + Name func() string + Ping func() error + Pong func() error + RefreshPongTime func() + type CantWriteYet struct + func (e CantWriteYet) Error() string + type ClientConfig struct + ExtraHeaders map[string]string + TLSConfig *tls.Config + UseTLS bool + type Config struct + AlwaysMask bool + BufferSize int + ChunkSize int + CompressLevel int + EnableCompress bool + EnableStreams bool + HeaderVerify func(http.Header) bool + MagicKey []byte + MaxPayloadSize int + MaxStreams int + PingInterval int + PrivateMask []byte + Synchronize bool + Timeout *Timeout + TriggerOnStart bool + type Connection struct + func Dial(addr string, c *DialConfig) (*Connection, error) + func TakeOver(w http.ResponseWriter, r *http.Request, c *Config) (*Connection, error) + func (con *Connection) Apply(h EventHandler) + func (con *Connection) Close() + func (con *Connection) Dispatch(t MessageType, p []byte) error + func (con *Connection) DispatchReader(t MessageType, r io.Reader) (e error) + func (con *Connection) Group() string + func (con *Connection) KeepPing(pingInterval, pongTimeout int) + func (con *Connection) Name() string + func (con *Connection) OnMessage(t MessageType, action func(*Message, Adapter)) + func (con *Connection) OnReady(action func(Adapter)) + func (con *Connection) OnStatus(s Status, action func(Status, Adapter)) + func (con *Connection) Ping() error + func (con *Connection) Pong() error + func (con *Connection) ReStart() error + func (con *Connection) RefreshPongTime() + func (con *Connection) Revoke(name string) + func (con *Connection) Start() error + type DialConfig struct + type EventHandler interface + Name func() string + OnMessage func(*Message, Adapter) + OnStatus func(Status, Adapter) + type Message struct + Type MessageType + func (m *Message) IsComplete() bool + func (m *Message) IsControl() bool + func (m *Message) Read() ([]byte, error) + func (m *Message) ReadIter(chanSize int) <-chan []byte + type MessageType int + type MsgTooLarge struct + func (e MsgTooLarge) Error() string + type MsgYetComplete struct + func (e MsgYetComplete) Error() string + type NodeConfig struct + Group string + Name string + type Pool struct + func NewPool(c *PoolConfig) *Pool + func (p *Pool) Add(c *Connection, config *NodeConfig) error + func (p *Pool) CastOut(c *Connection) + func (p *Pool) CastOutByName(name string) bool + func (p *Pool) Close() + func (p *Pool) Dispatch(t MessageType, payload []byte) + func (p *Pool) Except(name string, t MessageType, payload []byte) + func (p *Pool) Name() string + func (p *Pool) OnMessage(action func(*Message, Adapter)) + func (p *Pool) OnStatus(action func(Status, Adapter)) + func (p *Pool) ToClients(t MessageType, payload []byte) + func (p *Pool) ToGroup(gName string, t MessageType, payload []byte) + func (p *Pool) ToPick(name string, t MessageType, payload []byte) bool + func (p *Pool) ToServers(t MessageType, payload []byte) + func (p *Pool) Wait() + type PoolConfig struct + ClientRetry int + Name string + RetryInterval int + Size int + type Status int + type Timeout struct + CloseTimeout int + HandshakeTimeout int + PongTimeout int + type WriteAfterClose struct + func (e WriteAfterClose) Error() string