pluginengine

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultPluginDir = ".devstream"

Variables

This section is empty.

Functions

func Apply

func Apply(configFile string, continueDirectly bool) error

func Create

func Create(tool *configloader.Tool) (map[string]interface{}, error)

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

func Delete

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

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

func Destroy

func Destroy(configFile string, continueDirectly bool) error

func HandleOutputsReferences

func HandleOutputsReferences(smgr statemanager.Manager, options map[string]interface{}) []error

func Read

func Read(tool *configloader.Tool) (map[string]interface{}, error)

func Remove

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

func Update

func Update(tool *configloader.Tool) (map[string]interface{}, error)

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        *configloader.Tool
	ActionName  statemanager.ComponentAction
	Result      *ChangeResult
	Description string
}

Change is a wrapper with a single Tool and its Action should be execute.

func GetChangesForApply

func GetChangesForApply(smgr statemanager.Manager, cfg *configloader.Config) ([]*Change, 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.

func GetChangesForDelete

func GetChangesForDelete(smgr statemanager.Manager, cfg *configloader.Config, isForceDelete bool) ([]*Change, 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) ([]*Change, error)

func (*Change) String

func (c *Change) String() string

type ChangeResult

type ChangeResult struct {
	Succeeded   bool
	Error       error
	Time        string
	ReturnValue map[string]interface{}
}

ChangeResult holds the result with a change action.

type CommandType

type CommandType string
const (
	CommandApply  CommandType = "apply"
	CommandDelete CommandType = "delete"
)

type DevStreamPlugin

type DevStreamPlugin interface {
	// Create, Read, and Update return two results, the first being the "state"
	Create(map[string]interface{}) (map[string]interface{}, error)
	Read(map[string]interface{}) (map[string]interface{}, error)
	Update(map[string]interface{}) (map[string]interface{}, error)
	// Delete returns (true, nil) if there is no error; otherwise it returns (false, error)
	Delete(map[string]interface{}) (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