util

package
v1.2.0-alpha1 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2020 License: Apache-2.0 Imports: 16 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddNewStringsToStringArray added in v1.2.0

func AddNewStringsToStringArray(list []string, elmsToAdd ...string) []string

func DirExists

func DirExists(path string) (bool, error)

func DumpYaml

func DumpYaml(v interface{}) string

func ExcludeFromStringArray added in v1.2.0

func ExcludeFromStringArray(list []string, elmsToRemove ...string) []string

func ExpandPath

func ExpandPath(path string) string

func FileExists

func FileExists(path string) (bool, error)

FileExists returns true if path exists

func GenerateConsistentRandomString

func GenerateConsistentRandomString(n int) string

func InterfaceArrayToStringArray

func InterfaceArrayToStringArray(array []interface{}) ([]string, error)

func InterfaceToMapStringInterface

func InterfaceToMapStringInterface(value interface{}) (map[string]interface{}, error)

func InterfaceToStringArray

func InterfaceToStringArray(value interface{}) ([]string, error)

func IsNotADirectoryError

func IsNotADirectoryError(err error) bool

func IsStringsContainValue

func IsStringsContainValue(arr []string, value string) bool

func MurmurHash

func MurmurHash(args ...string) string

func NumerateLines

func NumerateLines(text string, firstLineNumber int) string

func RejectEmptyStrings

func RejectEmptyStrings(arr []string) []string

func RemoveHostDirsWithLinuxContainer

func RemoveHostDirsWithLinuxContainer(ctx context.Context, mountDir string, dirs []string) error

func Sha256Hash

func Sha256Hash(args ...string) string

func Sha3_224Hash

func Sha3_224Hash(args ...string) string

func SplitFilepath

func SplitFilepath(path string) (result []string)

func ToLinuxContainerPath

func ToLinuxContainerPath(path string) string

func UniqAppendString

func UniqAppendString(arr []string, value string) []string

func UniqStrings

func UniqStrings(arr []string) []string

func WalkByPattern

func WalkByPattern(dir, pattern string, walkFunc func(path string, f os.FileInfo, err error) error) error

WalkByPattern supports ** in pattern and does not follow symlinks

Types

type SerializableError added in v1.1.21

type SerializableError struct {
	Error error
}

func (SerializableError) MarshalJSON added in v1.1.21

func (obj SerializableError) MarshalJSON() ([]byte, error)

func (*SerializableError) UnmarshalJSON added in v1.1.21

func (obj *SerializableError) UnmarshalJSON(data []byte) error

type Stack

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

func NewStack

func NewStack() *Stack

Create a new stack

func (*Stack) Len

func (this *Stack) Len() int

Return the number of items in the stack

func (*Stack) Peek

func (this *Stack) Peek() interface{}

View the top item on the stack

func (*Stack) Pop

func (this *Stack) Pop() interface{}

Pop the top item of the stack and return it

func (*Stack) Push

func (this *Stack) Push(value interface{})

Push a value onto the top of the stack

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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