42 lines
1.1 KiB
Go
42 lines
1.1 KiB
Go
|
package pipeline
|
||
|
|
||
|
type Pipeline struct {
|
||
|
Name string `yaml:"name"`
|
||
|
Description string `yaml:"description"`
|
||
|
Steps []Step `yaml:"steps"`
|
||
|
}
|
||
|
|
||
|
type Step struct {
|
||
|
// TODO
|
||
|
// DependsOn *Step
|
||
|
// AllowParallel bool
|
||
|
// Trigger Trigger
|
||
|
Name string `yaml:"name"`
|
||
|
RateOfFire int `yaml:"rate_of_fire"`
|
||
|
Prepare Prepare `yaml:"prepare"`
|
||
|
Repeat int `yaml:"repeat"`
|
||
|
Shells []*Shell `yaml:"shells"`
|
||
|
}
|
||
|
|
||
|
type Prepare struct {
|
||
|
Type string `yaml:"type"` // http_call
|
||
|
Call Call `yaml:"call"` // TODO may be pretier
|
||
|
ReturnType string `yaml:"return_type"` // What is expected
|
||
|
ExpectedCodes []int `yaml:"expected_codes"`
|
||
|
SaveInto string `yaml:"save_into"` // Save the result into register X
|
||
|
GlobalSaveInto string `yaml:"global_save_into"`
|
||
|
}
|
||
|
|
||
|
type Shell struct {
|
||
|
Name string `yaml:"name"`
|
||
|
Call
|
||
|
// Onfail callback
|
||
|
}
|
||
|
|
||
|
type Call struct {
|
||
|
Target string `yaml:"traget"`
|
||
|
Headers map[string]string `yaml:"headers"`
|
||
|
Method string `yaml:"method"`
|
||
|
Body []byte `yaml:"body"`
|
||
|
}
|