Documentation
¶
Index ¶
- type Client
- func (c *Client) Close() error
- func (c *Client) Connect(ctx context.Context, callbacks ...func(arg interface{})) error
- func (c *Client) Emit(event interface{}, args ...interface{}) error
- func (c *Client) On(event string, handler interface{})
- func (c *Client) SetHandshakeData(data map[string]interface{})
- type ClientOption
- func WithDefaultNamespace(ns string) ClientOption
- func WithEngineIOClient(engineIOClient EngineIOClient) ClientOption
- func WithLogger(logger Logger) ClientOption
- func WithParser(parser Parser) ClientOption
- func WithRawURL(rawUrl string) ClientOption
- func WithTimer(timer Timer) ClientOption
- func WithURL(url *url.URL) ClientOption
- type EngineIOClient
- type InitClient
- type Logger
- type Parser
- type Timer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(options ...ClientOption) (*Client, error)
func (*Client) SetHandshakeData ¶
type ClientOption ¶
type ClientOption func(*InitClient) error
func WithDefaultNamespace ¶
func WithDefaultNamespace(ns string) ClientOption
func WithEngineIOClient ¶
func WithEngineIOClient(engineIOClient EngineIOClient) ClientOption
func WithLogger ¶
func WithLogger(logger Logger) ClientOption
func WithParser ¶
func WithParser(parser Parser) ClientOption
func WithRawURL ¶
func WithRawURL(rawUrl string) ClientOption
func WithTimer ¶
func WithTimer(timer Timer) ClientOption
func WithURL ¶
func WithURL(url *url.URL) ClientOption
type EngineIOClient ¶
type EngineIOClient interface { Connect(ctx context.Context) error Send(message []byte) error On(event string, handler func([]byte)) Close() error }
EngineIOClient представляет интерфейс для клиента Engine.IO
type InitClient ¶
type InitClient struct { *Client // contains filtered or unexported fields }
type Logger ¶
type Logger interface { Debugf(format string, v ...any) Infof(format string, v ...any) Warnf(format string, v ...any) Errorf(format string, v ...any) }
Logger представляет интерфейс для логирования
type Parser ¶
type Parser interface { WrapCallback(callback interface{}) func(in []interface{}) Parse([]byte) (*socketio_v5.Message, error) Serialize(*socketio_v5.Message) ([]byte, error) }
Click to show internal directories.
Click to hide internal directories.