ws

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: GPL-3.0 Imports: 7 Imported by: 17

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(connWs ConnectorWs, s string)

func Error

func Error(connWs ConnectorWs, errName string, err error, data interface{}, errText string)

func Login added in v0.0.7

func Login(connWs ConnectorWs)

function to enter the private channel of the exchange. If exchange haven't private channel, an error will be returned

func ResponceFromUnknownChannel added in v0.1.1

func ResponceFromUnknownChannel(connWs ConnectorWs, message string)

func Start

func Start(connWs ConnectorWs)

подключение к серверу и постоянное чтение приходящих ответов так же поддерживает переподключение при повторном запуске

func Stop added in v0.1.1

func Stop(connWs ConnectorWs)

func Subscribe

func Subscribe(connWs ConnectorWs, channel string, args interface{})

for Binance, Bibit args - symbols for subscrybe for OKX args- structure for subscrybe to channel (without op)

Types

type ConnectorWs

type ConnectorWs interface {
	GetExchangeName() string
	GetPair(args ...string) string
	GetTradingType() string
	GetConfiguration() config.Configuration
	GetConnection() *websocket.Conn
	SetConnection(c *websocket.Conn)
	GetOperations() []config.Operation
	ClearOperations()
	GetEmitter() *emission.Emitter
	GetLogger() *zap.Logger
	GetIsConnStable() bool       // получение состояния подключения
	SetIsConnStable(stable bool) // обновление состояния получения НЕОБХОДИМ ДЛЯ ОБЩЕЙ БИБЛИОТЕКИ
	GetErrorChan() chan error    // получение канала с ошибками
	SetErrorChan(ch chan error)  // Обновление канала с ошибками
	SendToErrorChan(err error)   // отправка ошибки в канал с ошибками
	MessageHandler(data []byte)
	GetRequest(op string, channel string, args interface{}) (interface{}, error)
	GetPingMessage() (int, string)
}

Jump to

Keyboard shortcuts

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