mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 14:55:16 +00:00
44 lines
924 B
Go
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())
|
|
}
|