mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-25 16:25:16 +00:00
16862e7208
binance
152 lines
4.2 KiB
Go
152 lines
4.2 KiB
Go
// Code generated by "callbackgen -type Stream -interface"; DO NOT EDIT.
|
|
|
|
package binance
|
|
|
|
import ()
|
|
|
|
func (s *Stream) OnDepthEvent(cb func(e *DepthEvent)) {
|
|
s.depthEventCallbacks = append(s.depthEventCallbacks, cb)
|
|
}
|
|
|
|
func (s *Stream) EmitDepthEvent(e *DepthEvent) {
|
|
for _, cb := range s.depthEventCallbacks {
|
|
cb(e)
|
|
}
|
|
}
|
|
|
|
func (s *Stream) OnKLineEvent(cb func(e *KLineEvent)) {
|
|
s.kLineEventCallbacks = append(s.kLineEventCallbacks, cb)
|
|
}
|
|
|
|
func (s *Stream) EmitKLineEvent(e *KLineEvent) {
|
|
for _, cb := range s.kLineEventCallbacks {
|
|
cb(e)
|
|
}
|
|
}
|
|
|
|
func (s *Stream) OnKLineClosedEvent(cb func(e *KLineEvent)) {
|
|
s.kLineClosedEventCallbacks = append(s.kLineClosedEventCallbacks, cb)
|
|
}
|
|
|
|
func (s *Stream) EmitKLineClosedEvent(e *KLineEvent) {
|
|
for _, cb := range s.kLineClosedEventCallbacks {
|
|
cb(e)
|
|
}
|
|
}
|
|
|
|
func (s *Stream) OnMarkPriceUpdateEvent(cb func(e *MarkPriceUpdateEvent)) {
|
|
s.markPriceUpdateEventCallbacks = append(s.markPriceUpdateEventCallbacks, cb)
|
|
}
|
|
|
|
func (s *Stream) EmitMarkPriceUpdateEvent(e *MarkPriceUpdateEvent) {
|
|
for _, cb := range s.markPriceUpdateEventCallbacks {
|
|
cb(e)
|
|
}
|
|
}
|
|
|
|
func (s *Stream) OnContinuousKLineEvent(cb func(e *ContinuousKLineEvent)) {
|
|
s.continuousKLineEventCallbacks = append(s.continuousKLineEventCallbacks, cb)
|
|
}
|
|
|
|
func (s *Stream) EmitContinuousKLineEvent(e *ContinuousKLineEvent) {
|
|
for _, cb := range s.continuousKLineEventCallbacks {
|
|
cb(e)
|
|
}
|
|
}
|
|
|
|
func (s *Stream) OnContinuousKLineClosedEvent(cb func(e *ContinuousKLineEvent)) {
|
|
s.continuousKLineClosedEventCallbacks = append(s.continuousKLineClosedEventCallbacks, cb)
|
|
}
|
|
|
|
func (s *Stream) EmitContinuousKLineClosedEvent(e *ContinuousKLineEvent) {
|
|
for _, cb := range s.continuousKLineClosedEventCallbacks {
|
|
cb(e)
|
|
}
|
|
}
|
|
|
|
func (s *Stream) OnBalanceUpdateEvent(cb func(event *BalanceUpdateEvent)) {
|
|
s.balanceUpdateEventCallbacks = append(s.balanceUpdateEventCallbacks, cb)
|
|
}
|
|
|
|
func (s *Stream) EmitBalanceUpdateEvent(event *BalanceUpdateEvent) {
|
|
for _, cb := range s.balanceUpdateEventCallbacks {
|
|
cb(event)
|
|
}
|
|
}
|
|
|
|
func (s *Stream) OnOutboundAccountInfoEvent(cb func(event *OutboundAccountInfoEvent)) {
|
|
s.outboundAccountInfoEventCallbacks = append(s.outboundAccountInfoEventCallbacks, cb)
|
|
}
|
|
|
|
func (s *Stream) EmitOutboundAccountInfoEvent(event *OutboundAccountInfoEvent) {
|
|
for _, cb := range s.outboundAccountInfoEventCallbacks {
|
|
cb(event)
|
|
}
|
|
}
|
|
|
|
func (s *Stream) OnOutboundAccountPositionEvent(cb func(event *OutboundAccountPositionEvent)) {
|
|
s.outboundAccountPositionEventCallbacks = append(s.outboundAccountPositionEventCallbacks, cb)
|
|
}
|
|
|
|
func (s *Stream) EmitOutboundAccountPositionEvent(event *OutboundAccountPositionEvent) {
|
|
for _, cb := range s.outboundAccountPositionEventCallbacks {
|
|
cb(event)
|
|
}
|
|
}
|
|
|
|
func (s *Stream) OnExecutionReportEvent(cb func(event *ExecutionReportEvent)) {
|
|
s.executionReportEventCallbacks = append(s.executionReportEventCallbacks, cb)
|
|
}
|
|
|
|
func (s *Stream) EmitExecutionReportEvent(event *ExecutionReportEvent) {
|
|
for _, cb := range s.executionReportEventCallbacks {
|
|
cb(event)
|
|
}
|
|
}
|
|
|
|
func (s *Stream) OnBookTickerEvent(cb func(event *BookTickerEvent)) {
|
|
s.bookTickerEventCallbacks = append(s.bookTickerEventCallbacks, cb)
|
|
}
|
|
|
|
func (s *Stream) EmitBookTickerEvent(event *BookTickerEvent) {
|
|
for _, cb := range s.bookTickerEventCallbacks {
|
|
cb(event)
|
|
}
|
|
}
|
|
|
|
func (s *Stream) OnOrderTradeUpdateEvent(cb func(e *OrderTradeUpdateEvent)) {
|
|
s.orderTradeUpdateEventCallbacks = append(s.orderTradeUpdateEventCallbacks, cb)
|
|
}
|
|
|
|
func (s *Stream) EmitOrderTradeUpdateEvent(e *OrderTradeUpdateEvent) {
|
|
for _, cb := range s.orderTradeUpdateEventCallbacks {
|
|
cb(e)
|
|
}
|
|
}
|
|
|
|
type StreamEventHub interface {
|
|
OnDepthEvent(cb func(e *DepthEvent))
|
|
|
|
OnKLineEvent(cb func(e *KLineEvent))
|
|
|
|
OnKLineClosedEvent(cb func(e *KLineEvent))
|
|
|
|
OnMarkPriceUpdateEvent(cb func(e *MarkPriceUpdateEvent))
|
|
|
|
OnContinuousKLineEvent(cb func(e *ContinuousKLineEvent))
|
|
|
|
OnContinuousKLineClosedEvent(cb func(e *ContinuousKLineEvent))
|
|
|
|
OnBalanceUpdateEvent(cb func(event *BalanceUpdateEvent))
|
|
|
|
OnOutboundAccountInfoEvent(cb func(event *OutboundAccountInfoEvent))
|
|
|
|
OnOutboundAccountPositionEvent(cb func(event *OutboundAccountPositionEvent))
|
|
|
|
OnExecutionReportEvent(cb func(event *ExecutionReportEvent))
|
|
|
|
OnBookTickerEvent(cb func(event *BookTickerEvent))
|
|
|
|
OnOrderTradeUpdateEvent(cb func(e *OrderTradeUpdateEvent))
|
|
}
|