action

package
v0.7.1-beta1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrBlockedAction indicates that the requested action was not allowed.
	ErrBlockedAction = errors.New("action not allowed")
	// ErrUndefinedAction indicates that a bundle does not define this action.
	ErrUndefinedAction = errors.New("action not defined for bundle")
)

Functions

This section is empty.

Types

type Action

type Action interface {
	// Run an action, and record the status in the given claim
	Run(*claim.Claim, credentials.Set, ...OperationConfigFunc) error
}

Action describes one of the primary actions that can be executed in CNAB.

The actions are: - install - upgrade - uninstall - downgrade - status

type Install

type Install struct {
	Driver driver.Driver // Needs to be more than a string
}

Install describes an installation action

func (*Install) Run

func (i *Install) Run(c *claim.Claim, creds credentials.Set, opCfgs ...OperationConfigFunc) error

Run performs an installation and updates the Claim accordingly

type OperationConfigFunc

type OperationConfigFunc func(op *driver.Operation) error

OperationConfigFunc is a configuration function that can be applied to an operation.

type OperationConfigs

type OperationConfigs []OperationConfigFunc

OperationConfigs is a set of configuration functions that can be applied as a unit to an operation.

func (OperationConfigs) ApplyConfig

func (cfgs OperationConfigs) ApplyConfig(op *driver.Operation) error

ApplyConfig safely applies the configuration function to the operation, if defined, and stops immediately upon the first error.

type RunCustom

type RunCustom struct {
	Driver driver.Driver
	Action string
}

RunCustom allows the execution of an arbitrary target in a CNAB bundle.

func (*RunCustom) Run

func (i *RunCustom) Run(c *claim.Claim, creds credentials.Set, opCfgs ...OperationConfigFunc) error

Run executes a status action in an image

type Status

type Status struct {
	Driver driver.Driver
}

Status runs a status action on a CNAB bundle.

func (*Status) Run

func (i *Status) Run(c *claim.Claim, creds credentials.Set, opCfgs ...OperationConfigFunc) error

Run executes a status action in an image

type Uninstall

type Uninstall struct {
	Driver driver.Driver
}

Uninstall runs an uninstall action

func (*Uninstall) Run

func (u *Uninstall) Run(c *claim.Claim, creds credentials.Set, opCfgs ...OperationConfigFunc) error

Run performs the uninstall steps and updates the Claim

type Upgrade

type Upgrade struct {
	Driver driver.Driver
}

Upgrade runs an upgrade action

func (*Upgrade) Run

func (u *Upgrade) Run(c *claim.Claim, creds credentials.Set, opCfgs ...OperationConfigFunc) error

Run performs the upgrade steps and updates the Claim

Jump to

Keyboard shortcuts

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