util

package
v0.1.143 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppTypeService  = "service"
	AppTypeFunction = "function"
	AppTypeStatic   = "static"
)

Variables

View Source
var (
	DefaultEditors    = []string{"vim", "nano", "vi"}
	ErrEditorNotFound = fmt.Errorf("error looking up editor! define 'EDITOR' environment variable")
)

Functions

func CopyMapStringString added in v0.1.12

func CopyMapStringString(m map[string]string) map[string]string

func FlattenEnvMap added in v0.1.31

func FlattenEnvMap(m map[string]string) []string

func HashFile added in v0.1.109

func HashFile(filePath string) ([]byte, error)

func IndentString added in v0.1.67

func IndentString(s, indent string) string

func InterfaceSlice

func InterfaceSlice(slice interface{}) []interface{}

func IsTerminal added in v0.1.100

func IsTerminal() bool

func LookupAnyPath added in v0.1.109

func LookupAnyPath(paths ...string) string

func MapLookupPath added in v0.1.67

func MapLookupPath(m map[string]interface{}, keys ...string) map[string]interface{}

func RegexValidator

func RegexValidator(regex *regexp.Regexp, msg string) func(interface{}) error

func RunEditor added in v0.1.109

func RunEditor(path string) error

func StatusFromError added in v0.1.47

func StatusFromError(err error) (s *status.Status, ok bool)

func StringArrayToSet added in v0.1.35

func StringArrayToSet(in []string) map[string]bool

func Title added in v0.1.82

func Title(s string) string

func YAMLNodeDecode added in v0.1.99

func YAMLNodeDecode(n ast.Node, out interface{}) error

func YAMLUnmarshal added in v0.1.99

func YAMLUnmarshal(in []byte, out interface{}) error

Types

type MatchType added in v0.1.125

type MatchType int
const (
	MatchTypeUnknown MatchType = iota
	MatchTypeAny
	MatchTypeAppService
	MatchTypeAppFunction
	MatchTypeAppStatic
	MatchTypeAppAny
	MatchTypeDependency
)

func (MatchType) IsApp added in v0.1.125

func (m MatchType) IsApp() bool

func (MatchType) IsDependency added in v0.1.125

func (m MatchType) IsDependency() bool

type TargetMatch added in v0.1.125

type TargetMatch struct {
	// contains filtered or unexported fields
}

func (*TargetMatch) Input added in v0.1.125

func (t *TargetMatch) Input() string

type TargetMatcher added in v0.1.125

type TargetMatcher struct {
	// contains filtered or unexported fields
}

func NewTargetMatcher added in v0.1.125

func NewTargetMatcher() *TargetMatcher

func (*TargetMatcher) Add added in v0.1.125

func (m *TargetMatcher) Add(name string) error

func (*TargetMatcher) AddApp added in v0.1.125

func (m *TargetMatcher) AddApp(name string) error

func (*TargetMatcher) AddDependency added in v0.1.125

func (m *TargetMatcher) AddDependency(name string) error

func (*TargetMatcher) IsEmpty added in v0.1.125

func (m *TargetMatcher) IsEmpty() bool

func (*TargetMatcher) MatchedMoreThanOnce added in v0.1.125

func (m *TargetMatcher) MatchedMoreThanOnce() []*TargetMatch

func (*TargetMatcher) Matches added in v0.1.125

func (m *TargetMatcher) Matches(id string) bool

func (*TargetMatcher) Remove added in v0.1.125

func (m *TargetMatcher) Remove(id string) bool

func (*TargetMatcher) ResetMatches added in v0.1.125

func (m *TargetMatcher) ResetMatches()

func (*TargetMatcher) Unmatched added in v0.1.125

func (m *TargetMatcher) Unmatched() []*TargetMatch

type VarEvaluator added in v0.1.46

type VarEvaluator struct {
	*plugin_util.BaseVarEvaluator
}

func NewVarEvaluator added in v0.1.46

func NewVarEvaluator(vars map[string]interface{}) *VarEvaluator

func (*VarEvaluator) Expand added in v0.1.46

func (e *VarEvaluator) Expand(input string) (string, error)

func (*VarEvaluator) ExpandStringMap added in v0.1.46

func (e *VarEvaluator) ExpandStringMap(input map[string]string) (map[string]string, error)

Jump to

Keyboard shortcuts

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