mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 23:05:15 +00:00
90 lines
2.3 KiB
Go
90 lines
2.3 KiB
Go
// Code generated by "callbackgen -type Stream -interface"; DO NOT EDIT.
|
|
|
|
package binance
|
|
|
|
func (s *Stream) OnConnect(cb func(stream *Stream)) {
|
|
s.connectCallbacks = append(s.connectCallbacks, cb)
|
|
}
|
|
|
|
func (s *Stream) EmitConnect(stream *Stream) {
|
|
for _, cb := range s.connectCallbacks {
|
|
cb(stream)
|
|
}
|
|
}
|
|
|
|
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) 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) OnExecutionReportEvent(cb func(event *ExecutionReportEvent)) {
|
|
s.executionReportEventCallbacks = append(s.executionReportEventCallbacks, cb)
|
|
}
|
|
|
|
func (s *Stream) EmitExecutionReportEvent(event *ExecutionReportEvent) {
|
|
for _, cb := range s.executionReportEventCallbacks {
|
|
cb(event)
|
|
}
|
|
}
|
|
|
|
type StreamEventHub interface {
|
|
OnConnect(cb func(stream *Stream))
|
|
|
|
OnDepthEvent(cb func(e *DepthEvent))
|
|
|
|
OnKLineEvent(cb func(e *KLineEvent))
|
|
|
|
OnKLineClosedEvent(cb func(e *KLineEvent))
|
|
|
|
OnBalanceUpdateEvent(cb func(event *BalanceUpdateEvent))
|
|
|
|
OnOutboundAccountInfoEvent(cb func(event *OutboundAccountInfoEvent))
|
|
|
|
OnExecutionReportEvent(cb func(event *ExecutionReportEvent))
|
|
}
|