Documentation ¶
Index ¶
- type Config
- type Orderbook
- func (w *Orderbook) FlushBuffer()
- func (w *Orderbook) FlushOrderbook(p currency.Pair, a asset.Item) error
- func (w *Orderbook) GetOrderbook(p currency.Pair, a asset.Item) (*orderbook.Base, error)
- func (w *Orderbook) LoadSnapshot(book *orderbook.Base) error
- func (w *Orderbook) Setup(exchangeConfig *config.Exchange, c *Config, dataHandler chan<- interface{}) error
- func (w *Orderbook) Update(u *orderbook.Update) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // SortBuffer enables a websocket to sort incoming updates before processing. SortBuffer bool // SortBufferByUpdateIDs allows the sorting of the buffered updates by their // corresponding update IDs. SortBufferByUpdateIDs bool // UpdateEntriesByID will match by IDs instead of price to perform the an // action. e.g. update, delete, insert. UpdateEntriesByID bool // UpdateIDProgression requires that the new update ID be greater than the // prior ID. This will skip processing and not error. UpdateIDProgression bool // Checksum is a package defined checksum calculation for updated books. Checksum func(state *orderbook.Base, checksum uint32) error }
Config defines the configuration variables for the websocket buffer; snapshot and incremental update orderbook processing.
type Orderbook ¶
type Orderbook struct {
// contains filtered or unexported fields
}
Orderbook defines a local cache of orderbooks for amending, appending and deleting changes and updates the main store for a stream
func (*Orderbook) FlushBuffer ¶
func (w *Orderbook) FlushBuffer()
FlushBuffer flushes w.ob data to be garbage collected and refreshed when a connection is lost and reconnected
func (*Orderbook) FlushOrderbook ¶
FlushOrderbook flushes independent orderbook
func (*Orderbook) GetOrderbook ¶
GetOrderbook returns an orderbook copy as orderbook.Base
func (*Orderbook) LoadSnapshot ¶
LoadSnapshot loads initial snapshot of orderbook data from websocket
Click to show internal directories.
Click to hide internal directories.