Documentation
¶
Index ¶
- Constants
- func Apply(configFile string, continueDirectly bool) error
- func Create(tool *configloader.Tool) (map[string]interface{}, error)
- func Delete(tool *configloader.Tool) (bool, error)
- func Destroy(continueDirectly bool) error
- func HandleOutputsReferences(smgr statemanager.Manager, options map[string]interface{}) []error
- func Read(tool *configloader.Tool) (map[string]interface{}, error)
- func Remove(configFile string, continueDirectly bool, isForceDelete bool) error
- func Update(tool *configloader.Tool) (map[string]interface{}, error)
- func Verify(configFile string) bool
- type Change
- type ChangeResult
- type CommandType
- type DevStreamPlugin
Constants ¶
const ( // a legal output reference should be in the format of ${{ abc }} OUTPUT_REFERENCE_PREFIX = "${{" OUTPUT_REFERENCE_SUFFIX = "}}" // it has 4 sections, separated by "." OUTPUT_REFERENCE_TOTAL_SECTIONS = 4 SECTION_SEPARATOR = "." // the first section is the tool's name TOOL_NAME = 0 // the second section is the plugin's kind PLUGIN = 1 // the third section is a constant string "outputs" // and the last section is the key to refer to OUTPUT_REFERENCE_KEY = 3 )
const DefaultPluginDir = ".devstream"
Variables ¶
This section is empty.
Functions ¶
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 HandleOutputsReferences ¶
func HandleOutputsReferences(smgr statemanager.Manager, options map[string]interface{}) []error
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 execute 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 execute is included in this Plan.changes.
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.