bbgo_origin/pkg/exchange/kucoin/stream_callbacks.go

66 lines
1.8 KiB
Go
Raw Normal View History

2021-12-23 03:04:22 +00:00
// Code generated by "callbackgen -type Stream -interface"; DO NOT EDIT.
package kucoin
func (s *Stream) OnCandleEvent(cb func(candle *WebSocketCandleEvent, e *WebSocketEvent)) {
2021-12-23 03:04:22 +00:00
s.candleEventCallbacks = append(s.candleEventCallbacks, cb)
}
func (s *Stream) EmitCandleEvent(candle *WebSocketCandleEvent, e *WebSocketEvent) {
2021-12-23 03:04:22 +00:00
for _, cb := range s.candleEventCallbacks {
cb(candle, e)
2021-12-23 03:04:22 +00:00
}
}
func (s *Stream) OnOrderBookL2Event(cb func(e *WebSocketOrderBookL2Event)) {
2021-12-23 03:04:22 +00:00
s.orderBookL2EventCallbacks = append(s.orderBookL2EventCallbacks, cb)
}
func (s *Stream) EmitOrderBookL2Event(e *WebSocketOrderBookL2Event) {
2021-12-23 03:04:22 +00:00
for _, cb := range s.orderBookL2EventCallbacks {
cb(e)
2021-12-23 03:04:22 +00:00
}
}
func (s *Stream) OnTickerEvent(cb func(e *WebSocketTickerEvent)) {
2021-12-23 03:04:22 +00:00
s.tickerEventCallbacks = append(s.tickerEventCallbacks, cb)
}
func (s *Stream) EmitTickerEvent(e *WebSocketTickerEvent) {
2021-12-23 03:04:22 +00:00
for _, cb := range s.tickerEventCallbacks {
cb(e)
2021-12-23 03:04:22 +00:00
}
}
func (s *Stream) OnAccountBalanceEvent(cb func(e *WebSocketAccountBalanceEvent)) {
2021-12-23 03:04:22 +00:00
s.accountBalanceEventCallbacks = append(s.accountBalanceEventCallbacks, cb)
}
func (s *Stream) EmitAccountBalanceEvent(e *WebSocketAccountBalanceEvent) {
2021-12-23 03:04:22 +00:00
for _, cb := range s.accountBalanceEventCallbacks {
cb(e)
2021-12-23 03:04:22 +00:00
}
}
func (s *Stream) OnPrivateOrderEvent(cb func(e *WebSocketPrivateOrderEvent)) {
2021-12-23 03:04:22 +00:00
s.privateOrderEventCallbacks = append(s.privateOrderEventCallbacks, cb)
}
func (s *Stream) EmitPrivateOrderEvent(e *WebSocketPrivateOrderEvent) {
2021-12-23 03:04:22 +00:00
for _, cb := range s.privateOrderEventCallbacks {
cb(e)
2021-12-23 03:04:22 +00:00
}
}
type StreamEventHub interface {
OnCandleEvent(cb func(candle *WebSocketCandleEvent, e *WebSocketEvent))
2021-12-23 03:04:22 +00:00
OnOrderBookL2Event(cb func(e *WebSocketOrderBookL2Event))
2021-12-23 03:04:22 +00:00
OnTickerEvent(cb func(e *WebSocketTickerEvent))
2021-12-23 03:04:22 +00:00
OnAccountBalanceEvent(cb func(e *WebSocketAccountBalanceEvent))
2021-12-23 03:04:22 +00:00
OnPrivateOrderEvent(cb func(e *WebSocketPrivateOrderEvent))
2021-12-23 03:04:22 +00:00
}