bbgo_origin/pkg/bbgo/positionupdater_callbacks.go
2022-07-29 11:52:20 +08:00

44 lines
924 B
Go

// 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())
}