Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { Close() error CloseWithCode(code websocket.StatusCode, reason string) error OnWithAck(event string, f func(data []byte) []byte) Client Dial(ctx context.Context, url string) error Ping(ctx context.Context) error // If registered, all unknown events will be handled here. OnDefault(f func(event string, data []byte)) Client On(event string, f func(data []byte)) Client Unsubscribe(event string) Client OnConnect(f func()) Client OnDisconnect(f func(error)) Client OnError(f func(error)) Client Emit(ctx context.Context, event string, body []byte) error EmitWithAck(ctx context.Context, event string, body []byte) ([]byte, error) Closed() bool }
type Config ¶
type Config struct { // By default, the connection has a message read limit of 32768 bytes. // When the limit is hit, the connection will be closed with StatusMessageTooBig. ConnectionReadLimit int64 // May be nil HttpClient *http.Client // May be nil HttpHeaders http.Header // Default is defaultWorkersNum WorkersNum int // Default is defaultWorkersBufferMultiplier WorkersBufferMultiplier int }
Click to show internal directories.
Click to hide internal directories.