Documentation
¶
Index ¶
- func AuthValidate(r *http.Request, auth *Authorizer) error
- func CORSValidate(r *http.Request, w http.ResponseWriter, cors map[string]interface{}) error
- func SetConfig(port int, prefix string)
- func Validate(r *http.Request, w http.ResponseWriter, wf *Workflow) error
- type APIStep
- type Authorizer
- type CORS
- type Config
- type ExecuteStep
- type JSONData
- type LogicStep
- type PrimaryKey
- type Resp
- type Step
- type StepError
- type Workflow
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthValidate ¶
func AuthValidate(r *http.Request, auth *Authorizer) error
AuthValidate : to validate incoming request
func CORSValidate ¶
CORSValidate : to validate the cors policy for the workflow
Types ¶
type APIStep ¶
type APIStep struct {
Endpoint string `json:"endpoint" yaml:"endpoint"`
Method string `json:"method" yaml:"method"`
IncludeHeaders bool `json:"include-headers" yaml:"include-headers"`
CustomHeaders map[string]string `json:"custom-headers" yaml:"custom-headers"`
Payload interface{} `json:"payload" yaml:"payload"`
}
APIStep - properties explicit to logic type step
type Authorizer ¶
type Authorizer struct {
Type string `json:"type" yaml:"type"`
AKey string `json:"key" yaml:"key"`
Input string `json:"input" yaml:"input"`
ExePath string `json:"exe-path" yaml:"exe-path"`
Handler string `json:"handler" yaml:"handler"`
}
Authorizer - To specify authorization method for the respective workflow
type CORS ¶
type CORS struct {
AllowOrigin string `json:"allow-origin" yaml:"allow-origin" default:"*"`
AllowMethods string `json:"allow-methods" yaml:"allow-methods" default:"*"`
AllowHeaders string `json:"allow-headers" yaml:"allow-headers" default:"*"`
MaxAge int64 `json:"maxage" yaml:"maxage"`
}
CORS - properties for the access control to workflow
type ExecuteStep ¶
type JSONData ¶
type JSONData struct {
// contains filtered or unexported fields
}
type JSONData struct{}
type LogicStep ¶
type LogicStep struct {
Runtime constants.Runtime `json:"runtime" yaml:"runtime"`
ExePath string `json:"exe-path" yaml:"exe-path"`
Handler string `json:"handler" yaml:"handler"`
Params interface{} `json:"params" yaml:"params"`
}
LogicStep - properties explicit to logic type step
type PrimaryKey ¶
type PrimaryKey struct {
PKey string `json:"key" yaml:"key"`
Input string `json:"input" yaml:"input"`
}
PrimaryKey - Unique key to identify a single instance
type Step ¶
type Step struct {
LogicStep `yaml:",inline"`
APIStep `yaml:",inline"`
Name string `json:"name" yaml:"name"`
ID string `json:"id" yaml:"id"`
Type constants.StepType `json:"type" yaml:"type"`
Async bool `json:"async" yaml:"async"`
Authorize bool `json:"authorize" yaml:"authorize"`
Delay string `json:"delay" yaml:"delay"`
Timeout string `json:"timeout" yaml:"timeout"`
NextStep string `json:"next-step" yaml:"next-step"`
Users []string `json:"users" yaml:"users"`
Break bool `json:"break" yaml:"break"`
Error *StepError `json:"on-error" yaml:"on-error"`
PreCondition interface{} `json:"pre-condition" yaml:"pre-condition"`
PostCondition interface{} `json:"post-condition" yaml:"post-condition"`
}
Step - It defines a single step
type StepError ¶
type StepError struct {
Retry bool `json:"retry" yaml:"retry"`
Goto string `json:"goto" yaml:"goto"`
}
StepError - properties defined for step error
type Workflow ¶
type Workflow struct {
Name string `json:"name" yaml:"name"`
ID string `json:"id" yaml:"id"`
Version string `json:"version" yaml:"version"`
PrimaryKey []PrimaryKey `json:"primary-key" yaml:"primary-key"`
Authorizer *Authorizer `json:"authorizer" yaml:"authorizer"`
CORS map[string]interface{} `json:"cors" yaml:"cors"`
Steps []Step `json:"steps" yaml:"steps"`
}
Workflow - Structure of workflow configuration
Click to show internal directories.
Click to hide internal directories.