Documentation
¶
Index ¶
- type Action
- type Context
- type Driver
- type DummyStrategy
- func (d *DummyStrategy) ActionsCh() *types.Channel[*Action]
- func (f *DummyStrategy) EndCurIteration(*Context)
- func (d *DummyStrategy) Finalize(*Context)
- func (d *DummyStrategy) NextIteration(*Context)
- func (d *DummyStrategy) Start() error
- func (d *DummyStrategy) Step(event *types.Event, c *Context)
- func (d *DummyStrategy) Stop() error
- type Strategy
- type StrategyConfig
- type StrategyWithProperty
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶ added in v0.1.3
func ActionSequence ¶ added in v0.1.4
func DeliverMany ¶ added in v0.2.2
func DeliverMessage ¶ added in v0.1.3
type Context ¶ added in v0.1.1
type Context struct {
*sm.Context
ActionSequence *types.List[*Action]
// contains filtered or unexported fields
}
func (*Context) CurIteration ¶ added in v0.1.3
func (*Context) NextIteration ¶ added in v0.1.3
func (c *Context) NextIteration()
type Driver ¶
type Driver struct {
*types.BaseService
// contains filtered or unexported fields
}
func NewStrategyDriver ¶ added in v0.1.3
func NewStrategyDriver( config *config.Config, mp types.MessageParser, strategy Strategy, sConfig *StrategyConfig, ) *Driver
func (*Driver) SetupRouter ¶
func (srv *Driver) SetupRouter(router *gin.RouterGroup)
SetupRouter for setting up the dashboard routes implements DashboardRouter
type DummyStrategy ¶ added in v0.1.1
type DummyStrategy struct {
*types.BaseService
Actions *types.Channel[*Action]
}
func NewDummyStrategy ¶ added in v0.1.1
func NewDummyStrategy() *DummyStrategy
func (*DummyStrategy) ActionsCh ¶ added in v0.2.7
func (d *DummyStrategy) ActionsCh() *types.Channel[*Action]
func (*DummyStrategy) EndCurIteration ¶ added in v0.1.5
func (f *DummyStrategy) EndCurIteration(*Context)
func (*DummyStrategy) Finalize ¶ added in v0.1.4
func (d *DummyStrategy) Finalize(*Context)
func (*DummyStrategy) NextIteration ¶ added in v0.1.3
func (d *DummyStrategy) NextIteration(*Context)
func (*DummyStrategy) Start ¶ added in v0.1.1
func (d *DummyStrategy) Start() error
func (*DummyStrategy) Step ¶ added in v0.1.1
func (d *DummyStrategy) Step(event *types.Event, c *Context)
func (*DummyStrategy) Stop ¶ added in v0.1.1
func (d *DummyStrategy) Stop() error
type Strategy ¶
type Strategy interface {
types.Service
ActionsCh() *types.Channel[*Action]
Step(*types.Event, *Context)
EndCurIteration(*Context)
NextIteration(*Context)
Finalize(*Context)
}
func NewStrategyWithProperty ¶ added in v0.2.0
func NewStrategyWithProperty(strategy Strategy, prop *sm.StateMachine) Strategy
type StrategyConfig ¶ added in v0.1.4
type StrategyConfig struct {
// Iterations the number of iterations to be run
Iterations int `json:"iterations"`
// IterationTimeout timeout for each iteration
IterationTimeout time.Duration `json:"iteration_timeout"`
// SetupFunc invoked at the start of every iteration
SetupFunc func(*Context)
// StepFunc invoked for every event in all iterations
StepFunc func(*types.Event, *Context)
// FinalizeFunc is invoked after all the iterations are completed
FinalizeFunc func(*Context)
}
StrategyConfig store the config used for running strategies
type StrategyWithProperty ¶ added in v0.2.0
type StrategyWithProperty struct {
Strategy
Property *sm.StateMachine
// contains filtered or unexported fields
}
func (*StrategyWithProperty) EndCurIteration ¶ added in v0.2.0
func (s *StrategyWithProperty) EndCurIteration(ctx *Context)
func (*StrategyWithProperty) Finalize ¶ added in v0.2.0
func (s *StrategyWithProperty) Finalize(ctx *Context)
func (*StrategyWithProperty) NextIteration ¶ added in v0.2.0
func (s *StrategyWithProperty) NextIteration(ctx *Context)
Click to show internal directories.
Click to hide internal directories.