pluginengine

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(configFile string, continueDirectly bool) error

func Create

Create loads the plugin and calls the Create method of that plugin.

func Delete

func Delete(tool *configmanager.Tool) (bool, error)

Delete loads the plugin and calls the Delete method of that plugin.

func Destroy

func Destroy(configFile string, continueDirectly bool, isForceDestroy bool) error

func HandleOutputsReferences

func HandleOutputsReferences(smgr statemanager.Manager, options configmanager.RawOptions) []error

HandleOutputsReferences renders outputs references in config file recursively. The parameter options will be changed.

func Remove

func Remove(configFile string, continueDirectly bool, isForceDelete bool) error

func ResourceDrifted added in v0.9.0

func ResourceDrifted(resourceStatusFromState, resourceStatusFromRead statemanager.ResourceStatus) (bool, error)

func Update

Update loads the plugin and calls the Update method of that plugin.

func Verify

func Verify(configFile string) bool

Verify returns true if all the comments in this function are met

Types

type Change

type Change struct {
	Tool        *configmanager.Tool
	ActionName  statemanager.ComponentAction
	Result      *ChangeResult
	Description string
}

Change is a wrapper for a single Tool and its Action to be executed.

func GetChangesForApply

func GetChangesForApply(smgr statemanager.Manager, cfg *configmanager.Config) (changes []*Change, err error)

GetChangesForApply takes "State Manager" & "Config" then do some calculate and return a Plan. All actions should be executed is included in this Plan.changes. It generates "changes" according to: - config - state - resource status (by calling the Read() interface of the plugin)

func GetChangesForDelete

func GetChangesForDelete(smgr statemanager.Manager, cfg *configmanager.Config, isForceDelete bool) (changes []*Change, err error)

GetChangesForDelete takes "State Manager" & "Config" then do some calculation and return a Plan to delete all plugins in the Config. All actions should be executed is included in this Plan.changes.

func GetChangesForDestroy added in v0.4.0

func GetChangesForDestroy(smgr statemanager.Manager, isForceDestroy bool) (changes []*Change, err error)

func (*Change) String

func (c *Change) String() string

type ChangeResult

type ChangeResult struct {
	Succeeded   bool
	Error       error
	Time        string
	ReturnValue statemanager.ResourceStatus
}

ChangeResult holds the result of a change action.

type DevStreamPlugin

type DevStreamPlugin interface {
	// Create, Read, and Update return two results, the first being the "state"
	Create(configmanager.RawOptions) (statemanager.ResourceStatus, error)
	Read(configmanager.RawOptions) (statemanager.ResourceStatus, error)
	Update(configmanager.RawOptions) (statemanager.ResourceStatus, error)
	// Delete returns (true, nil) if there is no error; otherwise it returns (false, error)
	Delete(configmanager.RawOptions) (bool, error)
}

DevStreamPlugin is a struct, on which Create/Read/Update/Delete interfaces are defined.

Jump to

Keyboard shortcuts

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