socketio_v5_client

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2024 License: MIT Imports: 11 Imported by: 1

Documentation

Index

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) Close

func (c *Client) Close() error

func (*Client) Connect

func (c *Client) Connect(ctx context.Context, callbacks ...func(arg interface{})) error

func (*Client) Emit

func (c *Client) Emit(event interface{}, args ...interface{}) error

func (*Client) On

func (c *Client) On(event string, handler interface{})

func (*Client) SetHandshakeData

func (c *Client) SetHandshakeData(data map[string]interface{})

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)
}

type Timer

type Timer interface {
	After(d time.Duration) <-chan time.Time
}

Timer представляет интерфейс для работы с таймерами

Directories

Path Synopsis
Package mock_socketio_v5_client is a generated GoMock package.
Package mock_socketio_v5_client is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL