mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 23:16:45 +00:00
* Expose trade feed websocket exchange data through data channel Most relevant to applications that import GCT as a lib, this allows them to (through configuration, disabled by default) receive trade data through the data channel similarly to the orderbook feed. * exchanges: allow exposure of trade websocket feed through data channel * Expose fill feed websocket abstracted exchange data through data channel * exchanges: allow exposure of fill websocket feed through data channel
23 lines
425 B
Go
23 lines
425 B
Go
package fill
|
|
|
|
// Setup sets up the fill processor
|
|
func (f *Fills) Setup(fillsFeedEnabled bool, c chan interface{}) {
|
|
f.dataHandler = c
|
|
f.fillsFeedEnabled = fillsFeedEnabled
|
|
}
|
|
|
|
// Update disseminates fill data through the data channel if so
|
|
// configured
|
|
func (f *Fills) Update(data ...Data) error {
|
|
if len(data) == 0 {
|
|
// nothing to do
|
|
return nil
|
|
}
|
|
|
|
if f.fillsFeedEnabled {
|
|
f.dataHandler <- data
|
|
}
|
|
|
|
return nil
|
|
}
|