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
// 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
}
Click to show internal directories.
Click to hide internal directories.