websockets

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2025 License: MIT Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	HEARTBEAT_CHECK_INTERVAL_SEC        = 5
	HEARTBEAT_CLOSE_ON_NO_HEARTBEAT_SEC = 20
)

Variables

View Source
var Logger = GoLogger{}

Functions

This section is empty.

Types

type BinanceWebsocket

type BinanceWebsocket struct {
	OnMessage   func(messageType int, msg []byte)
	OnReconnect func()
	// contains filtered or unexported fields
}

func CreateBinanceWebsocket

func CreateBinanceWebsocket(baseURL string, streams []string) *BinanceWebsocket

This function WILL block until a successful connection can be established

func (*BinanceWebsocket) Close

func (socket *BinanceWebsocket) Close()

func (*BinanceWebsocket) GetStreams

func (socket *BinanceWebsocket) GetStreams() []string

func (*BinanceWebsocket) ListSubscriptions

func (socket *BinanceWebsocket) ListSubscriptions(timeout_sec ...int) (subscriptions []string, err error)

func (*BinanceWebsocket) SendPrivateMessage

func (socket *BinanceWebsocket) SendPrivateMessage(message map[string]interface{}, timeout_sec ...int) (response []byte, hasTimedOut bool, err error)

func (*BinanceWebsocket) SetStreams

func (socket *BinanceWebsocket) SetStreams(streams []string)

func (*BinanceWebsocket) UpdateStreams

func (socket *BinanceWebsocket) UpdateStreams()

type CombinedStream_MSG

type CombinedStream_MSG struct {
	Stream string              `json:"stream"`
	Data   jsoniter.RawMessage `json:"data"`
}

type GoLogger

type GoLogger struct {
	PrintLogsLevel int

	LogLevel int
	LogFile  string
	// contains filtered or unexported fields
}

func (*GoLogger) DEBUG

func (logger *GoLogger) DEBUG(message string, err ...error)

func (*GoLogger) Disable

func (logger *GoLogger) Disable()

func (*GoLogger) ERROR

func (logger *GoLogger) ERROR(message string, err ...error)

func (*GoLogger) Enable

func (logger *GoLogger) Enable()

func (*GoLogger) IMPORTANT

func (logger *GoLogger) IMPORTANT(message string, err ...error)

func (*GoLogger) INFO

func (logger *GoLogger) INFO(message string, err ...error)

func (*GoLogger) SHOULDNT_HAPPEN

func (logger *GoLogger) SHOULDNT_HAPPEN(message string, err ...error)

func (*GoLogger) WARN

func (logger *GoLogger) WARN(message string, err ...error)

type Utils

type Utils struct{}

func (*Utils) CreateQueryString

func (*Utils) CreateQueryString(params map[string]interface{}, sorted bool) string

createQueryString transforms a map[string]interface{} into a query string

func (*Utils) RemoveDuplicates

func (*Utils) RemoveDuplicates(input []string) []string

func (*Utils) SignEd25519

func (*Utils) SignEd25519(message []byte, privateKey ed25519.PrivateKey) []byte

SignEd25519 signs a message with a private Ed25519 key.

Jump to

Keyboard shortcuts

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