utils

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bash

func Bash(cmd string) (string, error)

func ConvertNodeName

func ConvertNodeName(node string) string

ConvertNodeName e.g.(10.23.10.12 => 10-23-10-12)

func ConvertShellOutputs

func ConvertShellOutputs(outputs string) []string

ConvertShellOutputs

func FuncName added in v0.1.2

func FuncName() string

func GetAllIndex

func GetAllIndex(s string, substr string) []int

GetAllIndex

func GetNamespace

func GetNamespace() string

GetNamespace get Namespace from env, else it returns error

func GetNodeName

func GetNodeName() string

GetNodeName gets the node name from env, else returns an error

func Hash

func Hash(str string) string

Hash

func ParseKeyValuePairString

func ParseKeyValuePairString(propsRaw string) map[string]string

converts a raw key value pair string into a map of key value pairs example raw string of `foo="0" bar="1" baz="biz"` is returned as: map[string]string{"foo":"0", "bar":"1", "baz":"biz"}

func ReadSysFSFileAsInt64

func ReadSysFSFileAsInt64(sysFilePath string) (int64, error)

ReadSysFSFileAsInt64 reads a file and converts that content into int64

func ReadSysFSFileAsString

func ReadSysFSFileAsString(sysFilePath string) (string, error)

func StrFind added in v0.1.2

func StrFind(slice []string, val string) (int, bool)

func StructToMap added in v0.1.2

func StructToMap(in interface{}, tagName string) map[string]interface{}

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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