add stream callbacks

This commit is contained in:
c9s 2021-05-27 01:07:38 +08:00
parent 2538824661
commit 8c50ce725c

View File

@ -0,0 +1,19 @@
// Code generated by "callbackgen -type Stream -interface"; DO NOT EDIT.
package okex
import ()
func (s *Stream) OnKline(cb func()) {
s.klineCallbacks = append(s.klineCallbacks, cb)
}
func (s *Stream) EmitKline() {
for _, cb := range s.klineCallbacks {
cb()
}
}
type StreamEventHub interface {
OnKline(cb func())
}