exchanges

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2021 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckDisconnections

func CheckDisconnections(c *websocket.Conn, logger zerolog.Logger) (context.Context, context.CancelFunc, error)

func GetExchange

func GetExchange(name string) (common.Exchange, bool)

func GetExchanges

func GetExchanges(enabledExchanges ...string) []common.Exchange

func RegisterExchange

func RegisterExchange(exchange common.Exchange)

Types

type Exchange

type Exchange struct {
	Ws         map[string]*websocket.Conn
	OrderBooks map[string]*orderbook.OrderBook

	Lock sync.Mutex

	Logger zerolog.Logger
	// contains filtered or unexported fields
}

func NewExchange

func NewExchange(name string, availablePairs []common.Pair) *Exchange

func (*Exchange) AvailablePairs

func (e *Exchange) AvailablePairs() []common.Pair

func (*Exchange) CheckDisconnections

func (e *Exchange) CheckDisconnections(c *websocket.Conn, logger zerolog.Logger) (context.Context, context.CancelFunc, error)

func (*Exchange) CheckResponse

func (e *Exchange) CheckResponse(resp *http.Response) error

func (*Exchange) Close

func (e *Exchange) Close() error

func (*Exchange) GetOrderBook

func (e *Exchange) GetOrderBook(pair common.Pair) *orderbook.OrderBook

func (*Exchange) GetSnapshot

func (e *Exchange) GetSnapshot(pair common.Pair) (common.Snapshot, error)

func (*Exchange) Name

func (e *Exchange) Name() string

func (*Exchange) NewOrderBook

func (e *Exchange) NewOrderBook(pair common.Pair, pairLogger zerolog.Logger) *orderbook.OrderBook

func (*Exchange) OnOrderBookUpdate

func (e *Exchange) OnOrderBookUpdate(initial bool, pair common.Pair)

func (*Exchange) PairAvailable

func (e *Exchange) PairAvailable(pair common.Pair) bool

func (*Exchange) SetMaxSnapshotSize

func (e *Exchange) SetMaxSnapshotSize(val int)

func (*Exchange) SubscribeUpdates

func (e *Exchange) SubscribeUpdates(pair common.Pair, chanSize int) chan uint64

func (*Exchange) UnsubscribeUpdates

func (e *Exchange) UnsubscribeUpdates(pair common.Pair) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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