Documentation
¶
Index ¶
- func Execute(definition *Definition, context *executionContext) error
- func NewExecutionContext(options ...ExecutionOption) (*executionContext, error)
- type Assert
- type CSVMap
- type Definition
- type ExecutionOption
- type Header
- type QueryParam
- type Request
- type RequestBody
- type Sequence
- type Step
- type StepList
- type Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Execute ¶
func Execute(definition *Definition, context *executionContext) error
func NewExecutionContext ¶
func NewExecutionContext(options ...ExecutionOption) (*executionContext, error)
Types ¶
type Assert ¶
Assert represents an assertion where the Value represents the expected value and Selector represents the GJSON string that is used to extract the value from the JSON response.
type Definition ¶
type Definition struct {
Version string
BaseUrl string `yaml:"base_url"`
Timeout uint
MaxRetry uint `yaml:"max_retry"`
Variables map[string]any `yaml:",flow"`
Headers Header `yaml:",flow"`
Sequence Sequence
}
func ParseConfig ¶
func ParseConfig(path string) (*Definition, error)
type ExecutionOption ¶
type ExecutionOption func(context *executionContext) error
func WithGlobalOptions ¶
func WithGlobalOptions(baseUrl string, header map[string][]string) ExecutionOption
func WithHttpClient ¶
func WithHttpClient(client *http.Client) ExecutionOption
func WithLogger ¶
func WithLogger(logger *log.Logger) ExecutionOption
func WithStore ¶
func WithStore(store *store.Store) ExecutionOption
type QueryParam ¶
type QueryParam CSVMap
QueryParam represents the HTTP query params for the workflow step.
func (*QueryParam) UnmarshalYAML ¶
func (q *QueryParam) UnmarshalYAML(value *yaml.Node) error
type Request ¶
type Request struct {
Type string
Name string
Description string
Url string
Method string
Body RequestBody `yaml:"body"`
Headers Header
QueryParams QueryParam `yaml:"query_params"`
Store map[string]string
Timeout uint
Delay uint
Validations Validator
}
Request represents the HTTP request in the workflow step.
type RequestBody ¶
RequestBody represents the body of the HTTP request in the workflow step.
func (*RequestBody) UnmarshalYAML ¶
func (rb *RequestBody) UnmarshalYAML(value *yaml.Node) error