ws

package
v0.0.0-...-39def3e Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WsUrl          = "wss://localhost:5000/v1/client/ws"
	MaxWsFrameSize = 1024 * 1024 * 4 // 4mb
)

Variables

View Source
var (
	ErrNilHandler  = errors.New("nil handler")
	ErrFrameTooBig = errors.New("frame too big")
)

Functions

This section is empty.

Types

type MarketDataHistorySubscription

type MarketDataHistorySubscription struct {
	Conid   int64
	Request model.MarketDataRequest
	// contains filtered or unexported fields
}

type MarketDataSubscription

type MarketDataSubscription struct {
	Conid   int64
	Request model.MarketDataRequest
	// contains filtered or unexported fields
}

type StatusCodeError

type StatusCodeError struct {
	Code int
}

func (StatusCodeError) Error

func (s StatusCodeError) Error() string

type WS

type WS struct {
	// contains filtered or unexported fields
}

func OpenWS

func OpenWS(url, auth string) (*WS, error)

func (*WS) SubscribeData

func (w *WS) SubscribeData(
	conid int64,
	request *model.MarketDataRequest,
	handler func(data *model.MarketDataMessage),
) (*MarketDataSubscription, error)

func (*WS) SubscribeDataHistory

func (w *WS) SubscribeDataHistory(
	conid int64,
	request *model.MarketDataRequest,
	handler func(data *model.MarketDataHistoryMessage),
) (error, *MarketDataHistorySubscription)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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