bbgo_origin/pkg/exchange/bybit/stream_callbacks.go

38 lines
841 B
Go
Raw Normal View History

// Code generated by "callbackgen -type Stream"; DO NOT EDIT.
package bybit
import (
"github.com/c9s/bbgo/pkg/exchange/bybit/bybitapi"
)
func (s *Stream) OnBookEvent(cb func(e BookEvent)) {
s.bookEventCallbacks = append(s.bookEventCallbacks, cb)
}
func (s *Stream) EmitBookEvent(e BookEvent) {
for _, cb := range s.bookEventCallbacks {
cb(e)
}
}
func (s *Stream) OnWalletEvent(cb func(e []bybitapi.WalletBalances)) {
s.walletEventCallbacks = append(s.walletEventCallbacks, cb)
}
func (s *Stream) EmitWalletEvent(e []bybitapi.WalletBalances) {
for _, cb := range s.walletEventCallbacks {
cb(e)
}
}
2023-08-08 03:40:50 +00:00
func (s *Stream) OnOrderEvent(cb func(e []OrderEvent)) {
2023-08-08 03:40:50 +00:00
s.orderEventCallbacks = append(s.orderEventCallbacks, cb)
}
func (s *Stream) EmitOrderEvent(e []OrderEvent) {
2023-08-08 03:40:50 +00:00
for _, cb := range s.orderEventCallbacks {
cb(e)
}
}