ws

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 22, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Ws_coin_futures = "dstream.binance.com/ws"

	Ws_format   = "%s://%s"
	Subscribe   = "SUBSCRIBE"
	Unsubscribe = "UNSUBSCRIBE"
)

Variables

This section is empty.

Functions

func StartSubscribe

func StartSubscribe[T WsClient](client T, cfg WsConfig) (cleanup func(), err error)

Types

type SubReq

type SubReq struct {
	Method string   `json:"method,omitempty"`
	Params []string `json:"params,omitempty"`
	Id     int64    `json:"id,omitempty"`
}

type WsClient

type WsClient interface {
	ErrHandler(err error)
	MsgHandler(msg []byte)
	GetEndpoint(cfg WsConfig) string
	GetServices(cfg WsConfig) []string
}

WsClient - an interface of websocket client

type WsConfig

type WsConfig struct {
	UseSSL  bool
	Name    string
	Symbols []string
	Service string
}

Jump to

Keyboard shortcuts

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