bbgo/pkg/bbgo/strategycontroller_callbacks.go

44 lines
876 B
Go

// Code generated by "callbackgen -type StrategyController -interface"; 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()
}
}
type StrategyControllerEventHub interface {
OnSuspend(cb func())
OnResume(cb func())
OnEmergencyStop(cb func())
}