utils

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertMapInterfaceMapString

func ConvertMapInterfaceMapString(v interface{}) interface{}

ConvertMapInterfaceMapString converts map[interface{}]interface{} => map[string]interface{}

It will also convert []interface{} => []string

func CreateClusterName added in v0.0.4

func CreateClusterName(name, vmName string) string

CreateClusterName takes the name of the cluster and vm name and returns the name of the cluster

func ExitIfNotNil

func ExitIfNotNil(err error)

ExitIfNotNil exits the process with status 1 and error with the error passed to the function is not nil

func ForceLink(file1, file2 string) error

ForceLink forcefully hard links 2 files together

func MapFromYAML

func MapFromYAML(yamlByt []byte) (map[string]interface{}, error)

func MapGet

func MapGet(mp map[string]interface{}, key ...string) (interface{}, bool)

MapGet takes in the map keys - each key goes one level deeper in the map

func MapSet

func MapSet(mp map[string]interface{}, value interface{}, key ...string)

MapSet takes in the map that needs to be manipulated, the value that needs to be assgined to be assigned and the key - each key goes one level deeper in the map

func MapSetFn added in v0.0.7

func MapSetFn(mp map[string]interface{}, fn func(interface{}) (interface{}, bool), key ...string)

func MapToYAML added in v0.0.4

func MapToYAML(mp map[string]interface{}) ([]byte, error)

func RecursiveCastMapStringInterfaceToMapStringInterface

func RecursiveCastMapStringInterfaceToMapStringInterface(in map[string]interface{}) map[string]interface{}

RecursiveCastMapStringInterfaceToMapStringInterface will convert a map[string]interface{} recursively => map[string]interface{}

func SigIntHandler added in v0.0.4

func SigIntHandler(handler func())

SigIntHandler takes a handler which will be called when SIGINT is received

Types

This section is empty.

Jump to

Keyboard shortcuts

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