Documentation ¶
Index ¶
- type WebsocketOrderbookLocal
- func (w *WebsocketOrderbookLocal) FlushCache()
- func (w *WebsocketOrderbookLocal) GetOrderbook(p currency.Pair, assetType string) *orderbook.Base
- func (w *WebsocketOrderbookLocal) LoadSnapshot(newOrderbook *orderbook.Base, overwrite bool) error
- func (w *WebsocketOrderbookLocal) Setup(obBufferLimit int, ...)
- func (w *WebsocketOrderbookLocal) Update(orderbookUpdate *WebsocketOrderbookUpdate) error
- type WebsocketOrderbookUpdate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WebsocketOrderbookLocal ¶
type WebsocketOrderbookLocal struct {
// contains filtered or unexported fields
}
WebsocketOrderbookLocal defines a local cache of orderbooks for amending, appending and deleting changes and updates the main store in wsorderbook.go
func (*WebsocketOrderbookLocal) FlushCache ¶
func (w *WebsocketOrderbookLocal) FlushCache()
FlushCache flushes w.ob data to be garbage collected and refreshed when a connection is lost and reconnected
func (*WebsocketOrderbookLocal) GetOrderbook ¶
GetOrderbook use sparingly. Modifying anything here will ruin hash calculation and cause problems
func (*WebsocketOrderbookLocal) LoadSnapshot ¶
func (w *WebsocketOrderbookLocal) LoadSnapshot(newOrderbook *orderbook.Base, overwrite bool) error
LoadSnapshot loads initial snapshot of ob data, overwrite allows full ob to be completely rewritten because the exchange is a doing a full update not an incremental one
func (*WebsocketOrderbookLocal) Setup ¶
func (w *WebsocketOrderbookLocal) Setup(obBufferLimit int, bufferEnabled, sortBuffer, sortBufferByUpdateIDs, updateEntriesByID bool, exchangeName string)
Setup sets private variables
func (*WebsocketOrderbookLocal) Update ¶
func (w *WebsocketOrderbookLocal) Update(orderbookUpdate *WebsocketOrderbookUpdate) error
Update updates a local cache using bid targets and ask targets then updates main orderbook Volume == 0; deletion at price target Price target not found; append of price target Price target found; amend volume of price target
type WebsocketOrderbookUpdate ¶
type WebsocketOrderbookUpdate struct { UpdateID int64 // Used when no time is provided UpdateTime time.Time AssetType string Action string // Used in conjunction with UpdateEntriesByID Bids []orderbook.Item Asks []orderbook.Item CurrencyPair currency.Pair }
WebsocketOrderbookUpdate stores orderbook updates and dictates what features to use when processing