Documentation ¶
Index ¶
- func Bash(cmd string) (string, error)
- func BashWithArgs(cmd string, args ...string) (string, error)
- func ConvertNodeName(node string) string
- func ConvertShellOutputs(outputs string) []string
- func ExecCmd(command, args string) (out []byte, err error)
- func FoundNewStringElems(old, new []string) ([]string, bool)
- func FuncName() string
- func GetAllIndex(s string, substr string) []int
- func GetNamespace() string
- func GetNodeName() string
- func Hash(str string) string
- func ParseKeyValuePairString(propsRaw string) map[string]string
- func ReadSysFSFileAsInt64(sysFilePath string) (int64, error)
- func ReadSysFSFileAsString(sysFilePath string) (string, error)
- func StrFind(slice []string, val string) (int, bool)
- func StructToMap(in interface{}, tagName string) map[string]interface{}
- type ByDiskSize
- type ByVolumeCapacity
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertNodeName ¶
ConvertNodeName e.g.(10.23.10.12 => 10-23-10-12)
func FoundNewStringElems ¶
FoundNewStringElems compare two arrays, find if there is new elem in new array
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 ParseKeyValuePairString ¶
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 ¶
ReadSysFSFileAsInt64 reads a file and converts that content into int64
func ReadSysFSFileAsString ¶
func StructToMap ¶
Types ¶
type ByDiskSize ¶
ByDiskSize makes an array of disks sortable by their size in descending order.
func (ByDiskSize) Len ¶
func (a ByDiskSize) Len() int
func (ByDiskSize) Less ¶
func (a ByDiskSize) Less(i, j int) bool
func (ByDiskSize) Swap ¶
func (a ByDiskSize) Swap(i, j int)
type ByVolumeCapacity ¶
type ByVolumeCapacity []*corev1.PersistentVolumeClaim
ByVolumeCapacity makes an array of pvcs sortable by their storage capacity in descending order.
func (ByVolumeCapacity) Len ¶
func (a ByVolumeCapacity) Len() int
func (ByVolumeCapacity) Less ¶
func (a ByVolumeCapacity) Less(i, j int) bool
func (ByVolumeCapacity) Swap ¶
func (a ByVolumeCapacity) Swap(i, j int)