Documentation ¶
Overview ¶
Package commands are the base block to build Tasks
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNilInput = errors.New("input cannot be nil for http_request with POST Method")
View Source
var Registry = make(commandRegistry)
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command interface { // Setup configures a command from an environment.Environment Setup(env environment.Environment) error // Execute a command for a given input. Returns a string as output or an error if something fails. Execute(input *string) (*string, error) ValidateInput(input *string) error // Type returns the type of the command used to parse the spec: http_request, s3cpy, etc... Type() string }
type HTTPRequestCommand ¶
type HTTPRequestCommand struct { Endpoint string `json:"endpoint"` Method string `validate:"required,oneof=GET POST PUT DELETE PATCH" json:"method"` Body string // contains filtered or unexported fields }
HTTPRequestCommand implementation.
func (HTTPRequestCommand) Execute ¶
func (cmd HTTPRequestCommand) Execute(input *string) (*string, error)
Execute an HTTPRequestCommand.
func (*HTTPRequestCommand) Setup ¶
func (cmd *HTTPRequestCommand) Setup(env environment.Environment) error
Setup ...
func (HTTPRequestCommand) Type ¶
func (cmd HTTPRequestCommand) Type() string
Type returns the type of HTTPRequestCommand.
func (HTTPRequestCommand) ValidateInput ¶
func (HTTPRequestCommand) ValidateInput(input *string) error
type S3CpyCommand ¶
type S3CpyCommand struct { Bucket string `validate:"required"` Key string `validate:"required"` Path string // contains filtered or unexported fields }
func (*S3CpyCommand) Setup ¶
func (cmd *S3CpyCommand) Setup(environment environment.Environment) error
func (S3CpyCommand) Type ¶
func (cmd S3CpyCommand) Type() string
func (S3CpyCommand) ValidateInput ¶
func (cmd S3CpyCommand) ValidateInput(input *string) error
type TemplateCommand ¶
type TemplateCommand struct { Template string `validate:"required"` Encoding string `validate:"required,oneof=plain base64"` }
func (*TemplateCommand) Setup ¶
func (cmd *TemplateCommand) Setup(env environment.Environment) error
func (TemplateCommand) Type ¶
func (cmd TemplateCommand) Type() string
func (TemplateCommand) ValidateInput ¶
func (cmd TemplateCommand) ValidateInput(input *string) error
Click to show internal directories.
Click to hide internal directories.