commands

package
v0.0.0-...-c677ff1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 15, 2023 License: GPL-3.0 Imports: 12 Imported by: 0

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

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) Execute

func (cmd S3CpyCommand) Execute(input *string) (*string, error)

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) Execute

func (cmd TemplateCommand) Execute(input *string) (*string, error)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL