mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 17:13:51 +00:00
44 lines
870 B
Go
44 lines
870 B
Go
// Code generated by "callbackgen -type Stream -interface"; DO NOT EDIT.
|
|
|
|
package okex
|
|
|
|
import ()
|
|
|
|
func (s *Stream) OnCancelData(cb func()) {
|
|
s.cancelDataCallbacks = append(s.cancelDataCallbacks, cb)
|
|
}
|
|
|
|
func (s *Stream) EmitCancelData() {
|
|
for _, cb := range s.cancelDataCallbacks {
|
|
cb()
|
|
}
|
|
}
|
|
|
|
func (s *Stream) OnBookData(cb func(data BookData)) {
|
|
s.bookDataCallbacks = append(s.bookDataCallbacks, cb)
|
|
}
|
|
|
|
func (s *Stream) EmitBookData(data BookData) {
|
|
for _, cb := range s.bookDataCallbacks {
|
|
cb(data)
|
|
}
|
|
}
|
|
|
|
func (s *Stream) OnEvent(cb func(event WebSocketEvent)) {
|
|
s.eventCallbacks = append(s.eventCallbacks, cb)
|
|
}
|
|
|
|
func (s *Stream) EmitEvent(event WebSocketEvent) {
|
|
for _, cb := range s.eventCallbacks {
|
|
cb(event)
|
|
}
|
|
}
|
|
|
|
type StreamEventHub interface {
|
|
OnCancelData(cb func())
|
|
|
|
OnBookData(cb func(data BookData))
|
|
|
|
OnEvent(cb func(event WebSocketEvent))
|
|
}
|