mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-14 02:53:50 +00:00
36 lines
768 B
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()
|
|
}
|
|
}
|