action

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2018 License: Apache-2.0 Imports: 8 Imported by: 24

Documentation

Overview

Package action defines a base action (actions get born a result of policy diff calculation), as well as context which gets passed to all actions during apply phase.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base interface {
	runtime.Storable
	Apply(*Context) error
}

Base interface for all actions which perform actual state updates

type Context

type Context struct {
	DesiredPolicy      *lang.Policy
	DesiredState       *resolve.PolicyResolution
	ActualState        *resolve.PolicyResolution
	ActualStateUpdater actual.StateUpdater
	ExternalData       *external.Data
	Plugins            plugin.Registry
	EventLog           *event.Log
}

Context is a data struct that will be passed into all state update actions, giving actions access to desired policy/state, and actual state and a way to updatae it, list of plugins, event log, etc

func NewContext

func NewContext(desiredPolicy *lang.Policy, desiredState *resolve.PolicyResolution,
	actualState *resolve.PolicyResolution, actualStateUpdater actual.StateUpdater, externalData *external.Data,
	plugins plugin.Registry, eventLog *event.Log) *Context

NewContext creates a new instance of Context

type Metadata

type Metadata struct {
	Name string
}

Metadata is an object metadata for all state update actions

func NewMetadata

func NewMetadata(kind string, keys ...string) *Metadata

NewMetadata creates new Metadata

func (*Metadata) GetName

func (meta *Metadata) GetName() string

GetName returns an action name

func (*Metadata) GetNamespace

func (meta *Metadata) GetNamespace() string

GetNamespace returns a namespace for an action (it's always a system namespace)

func (*Metadata) String

func (meta *Metadata) String() string

Directories

Path Synopsis
Package component defines all component-specific actions, which get generated by the policy diff when component changes occur for specific component instances.
Package component defines all component-specific actions, which get generated by the policy diff when component changes occur for specific component instances.
Package global defines a global post-processing action, which gets generated by the policy diff only once after processing all component instances.
Package global defines a global post-processing action, which gets generated by the policy diff only once after processing all component instances.

Jump to

Keyboard shortcuts

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