utils

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const MAPPING_DELIMITER string = "|"

Variables

This section is empty.

Functions

func CombineErrors added in v1.0.7

func CombineErrors(label string, messages []string) error

func CombineSettings added in v1.0.4

func CombineSettings(resourceSettings map[string]interface{}, sharedSettings map[string]interface{}) (map[string]interface{}, error)

func Contains

func Contains(vs []string, t string) bool

func Filter

func Filter(vs []string, f func(string, int) bool) []string

func FilterByPrefix added in v1.0.5

func FilterByPrefix(arr []string, prefix string) []string

func FilterBySuffix added in v1.0.5

func FilterBySuffix(arr []string, suffix string) []string

func FirstHasPrefix added in v1.0.4

func FirstHasPrefix(arr []string, prefix string, cropped bool) (string, int)

func FirstHasSuffix added in v1.0.4

func FirstHasSuffix(arr []string, suffix string, cropped bool) (string, int)

func Flatten added in v1.0.4

func Flatten(docName string, tree map[string]interface{}) (map[string]interface{}, error)

func Index

func Index(vs []string, t string) int

func IsDir

func IsDir(name string) bool

func IsEmpty added in v1.0.7

func IsEmpty(x interface{}) bool

func IsExists

func IsExists(name string) bool

func IsZero added in v1.0.7

func IsZero(x interface{}) bool

v ~ reflect.ValueOf(x) x ~ v.Interface() reflect.TypeOf(x) ~ v.Type()

func Keys

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

func Map

func Map(vs []string, f func(string, int) string) []string

func PadString added in v1.0.5

func PadString(text string, align AlignmentType, lineLength int, seed string) string

func ParseCmd

func ParseCmd(cmd string) ([]string, error)

func ParseDirMappings

func ParseDirMappings(paths []string) map[string]string

func Reverse

func Reverse(arr []string) []string

func ShutdownSignals

func ShutdownSignals() []os.Signal

func SliceHead added in v1.0.7

func SliceHead(arr []string, before int) []string

func SliceTail added in v1.0.7

func SliceTail(arr []string, from int) []string

func SortDesc

func SortDesc(arr []string) []string

func Split

func Split(str string, sep string) []string

func Stringify added in v1.0.7

func Stringify(srcs []Stringable) []string

func SubSlice added in v1.0.7

func SubSlice(arr []string, from int, to int) []string

func TransformSettingsToEnvs added in v1.0.4

func TransformSettingsToEnvs(prefix string, settings map[string]interface{}, format string) ([]string, error)

Types

type AlignmentType added in v1.0.5

type AlignmentType int
const (
	LEFT AlignmentType
	CENTER
	RIGHT
)

type Stringable added in v1.0.7

type Stringable interface {
	String() string
}

Jump to

Keyboard shortcuts

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