bbgo_origin/pkg/bbgo/strategycontroller_callbacks.go

36 lines
768 B
Go

// Code generated by "callbackgen -type StrategyController strategy_controller.go"; DO NOT EDIT.
package bbgo
import ()
func (s *StrategyController) OnSuspend(cb func()) {
s.suspendCallbacks = append(s.suspendCallbacks, cb)
}
func (s *StrategyController) EmitSuspend() {
for _, cb := range s.suspendCallbacks {
cb()
}
}
func (s *StrategyController) OnResume(cb func()) {
s.resumeCallbacks = append(s.resumeCallbacks, cb)
}
func (s *StrategyController) EmitResume() {
for _, cb := range s.resumeCallbacks {
cb()
}
}
func (s *StrategyController) OnEmergencyStop(cb func()) {
s.emergencyStopCallbacks = append(s.emergencyStopCallbacks, cb)
}
func (s *StrategyController) EmitEmergencyStop() {
for _, cb := range s.emergencyStopCallbacks {
cb()
}
}