exec

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultDredgefileName  = "Dredgefile"
	DefaultDredgeRepo      = "https://github.com/dredge-dev/dredge-repo.git"
	LocalDredgeStorage     = ".dredge"
	LocalDredgeRepoStorage = LocalDredgeStorage + "/repo/"
)

Variables

View Source
var TEMPLATE_FUNCTIONS = template.FuncMap{
	"replace": func(s, old, new string) string {
		return strings.Replace(s, old, new, -1)
	},
	"date": func(format string) string {
		return time.Now().Format(format)
	},
	"join": func(s1, s2, sep string) string {
		if len(s1) == 0 {
			return s2
		}
		if len(s2) == 0 {
			return s1
		}
		return s1 + sep + s2
	},
	"trimSpace": func(s string) string {
		return strings.TrimSpace(s)
	},
	"isTrue":  isTrue,
	"isFalse": isFalse,
}

Functions

func MergeSources

func MergeSources(parent config.SourcePath, child config.SourcePath) config.SourcePath

func ReadDredgeFile

func ReadDredgeFile(source config.SourcePath) (config.SourcePath, *config.DredgeFile, error)

Types

type DredgeExec

type DredgeExec struct {
	Parent              *DredgeExec
	Source              config.SourcePath
	DredgeFile          *config.DredgeFile
	Env                 Env
	ResourceDefinitions []api.ResourceDefinition
	// contains filtered or unexported fields
}

func (*DredgeExec) AddBucketToDredgefile added in v0.0.7

func (e *DredgeExec) AddBucketToDredgefile(b config.Bucket) error

func (*DredgeExec) AddProviderToDredgefile added in v0.0.7

func (e *DredgeExec) AddProviderToDredgefile(resource, provider string, providerConfig map[string]string) error

func (*DredgeExec) AddVariablesToDredgefile added in v0.0.7

func (e *DredgeExec) AddVariablesToDredgefile(variables map[string]string) error

func (*DredgeExec) AddWorkflowToDredgefile added in v0.0.7

func (e *DredgeExec) AddWorkflowToDredgefile(w config.Workflow) error

func (*DredgeExec) Confirm added in v0.0.7

func (e *DredgeExec) Confirm(msg string, args ...interface{}) (bool, error)

func (*DredgeExec) ExecuteResourceCommand added in v0.0.7

func (e *DredgeExec) ExecuteResourceCommand(resourceName string, commandName string) (*api.CommandOutput, error)

func (*DredgeExec) GetBucket

func (exec *DredgeExec) GetBucket(bucketName string) (*workflow.Bucket, error)

func (*DredgeExec) GetBuckets

func (exec *DredgeExec) GetBuckets() ([]*workflow.Bucket, error)

func (*DredgeExec) GetProviders added in v0.0.7

func (e *DredgeExec) GetProviders() ([]resource.Provider, error)

func (*DredgeExec) GetResource added in v0.0.7

func (e *DredgeExec) GetResource(resourceName string) (*resource.Resource, error)

func (*DredgeExec) GetResourceDefinition added in v0.0.7

func (e *DredgeExec) GetResourceDefinition(resourceName string) (*api.ResourceDefinition, error)

func (*DredgeExec) GetResources added in v0.0.7

func (e *DredgeExec) GetResources() ([]string, error)

func (*DredgeExec) GetType added in v0.0.7

func (e *DredgeExec) GetType(typeName string) (*api.Type, error)

func (*DredgeExec) GetWorkflow

func (exec *DredgeExec) GetWorkflow(bucketName, workflowName string) (*workflow.Workflow, error)

func (*DredgeExec) GetWorkflows

func (exec *DredgeExec) GetWorkflows() ([]*workflow.Workflow, error)

func (*DredgeExec) GetWorkflowsInBucket added in v0.0.7

func (exec *DredgeExec) GetWorkflowsInBucket(b *workflow.Bucket) ([]*workflow.Workflow, error)

func (*DredgeExec) Import

func (exec *DredgeExec) Import(source config.SourcePath) (*DredgeExec, error)

func (*DredgeExec) Log added in v0.0.7

func (e *DredgeExec) Log(level api.LogLevel, msg string, args ...interface{}) error

func (*DredgeExec) OpenUrl added in v0.0.7

func (e *DredgeExec) OpenUrl(url string) error

func (*DredgeExec) RelativePathFromDredgefile added in v0.0.7

func (e *DredgeExec) RelativePathFromDredgefile(path string) (string, error)

func (*DredgeExec) RequestInput added in v0.0.7

func (e *DredgeExec) RequestInput(inputRequests []api.InputRequest) (map[string]string, error)

func (*DredgeExec) SetEnv added in v0.0.7

func (e *DredgeExec) SetEnv(name string, value interface{}) error

func (*DredgeExec) Template added in v0.0.7

func (e *DredgeExec) Template(input string) (string, error)

type Env

type Env map[string]interface{}

func NewEnv

func NewEnv() Env

func (Env) AddInput

func (e Env) AddInput(input config.Input, reader io.Reader) error

func (Env) AddInputs added in v0.0.7

func (e Env) AddInputs(inputs map[string]string)

func (Env) AddVariables

func (e Env) AddVariables(v config.Variables)

func (Env) Clone

func (e Env) Clone() Env

Jump to

Keyboard shortcuts

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