actions

package
v0.0.0-...-d5fbc43 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action interface {
	GetType() string
	Run(context.Context, transport.Connection, config.Config) error
	// contains filtered or unexported methods
}

func UnmarshalAction

func UnmarshalAction(actionType string, rawAction interface{}) (Action, error)

UnmarshalAction decodes an action into one of our action types using mapstructure

type ActionBase

type ActionBase struct {
	Type string
}

func (*ActionBase) GetType

func (a *ActionBase) GetType() string

type AptAction

type AptAction struct {
	ActionBase
	State string   `mapstructure:"state"`
	Pkg   []string `mapstructure:"pkg"`
}

func (*AptAction) Run

type FileAction

type FileAction struct {
	ActionBase
	Src   string `mapstructure:"src"`
	Dest  string `mapstructure:"dest"`
	Owner string `mapstructure:"owner"`
	Group string `mapstructure:"group"`
	Mode  string `mapstructure:"mode"`
}

func (*FileAction) Run

func (a *FileAction) Run(ctx context.Context, conn transport.Connection, conf config.Config) error

type ServiceAction

type ServiceAction struct {
	ActionBase
	Name  string `mapstructure:"name"`
	State string `mapstructure:"state"`
}

func (*ServiceAction) Run

type ShellAction

type ShellAction struct {
	ActionBase
	// Use the generic tag "data" because this action is represented
	// as `key: string_value` in the playbook YAML
	Command string `mapstructure:"data"`
}

func (*ShellAction) Run

type ValidateAction

type ValidateAction struct {
	ActionBase
	Scheme      string        `mapstructure:"scheme"`
	Port        uint          `mapstructure:"port"`
	UrlPath     string        `yaml:"url_path" mapstructure:"url_path"`
	Retries     uint          `mapstructure:"retries"`
	Timeout     time.Duration `mapstructure:"timeout"`
	StatusCode  int           `yaml:"status_code" mapstructure:"status_code"`
	BodyContent string        `yaml:"body_content" mapstructure:"body_content"`
}

func (*ValidateAction) Run

Jump to

Keyboard shortcuts

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