bbgo_origin/pkg/bbgo/positionupdater_callbacks.go

44 lines
924 B
Go
Raw Normal View History

2022-07-29 03:52:20 +00:00
// Code generated by "callbackgen -type PositionUpdater -interface"; DO NOT EDIT.
package bbgo
import ()
func (s *PositionUpdater) OnUpdateBase(cb func()) {
s.updateBaseCallbacks = append(s.updateBaseCallbacks, cb)
}
func (s *PositionUpdater) EmitUpdateBase() {
for _, cb := range s.updateBaseCallbacks {
cb()
}
}
func (s *PositionUpdater) OnUpdateQuote(cb func()) {
s.updateQuoteCallbacks = append(s.updateQuoteCallbacks, cb)
}
func (s *PositionUpdater) EmitUpdateQuote() {
for _, cb := range s.updateQuoteCallbacks {
cb()
}
}
func (s *PositionUpdater) OnUpdateAverageCost(cb func()) {
s.updateAverageCostCallbacks = append(s.updateAverageCostCallbacks, cb)
}
func (s *PositionUpdater) EmitUpdateAverageCost() {
for _, cb := range s.updateAverageCostCallbacks {
cb()
}
}
type PositionUpdaterEventHub interface {
OnUpdateBase(cb func())
OnUpdateQuote(cb func())
OnUpdateAverageCost(cb func())
}