utils

package
v0.0.0-...-60b8127 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Average

func Average(n ...int64) int64

Average : average the values

func ConvertToKV

func ConvertToKV(values map[string]string) string

ConvertToKV converts a map[string]string to a csv with k=v pairs

func FindHostAndCluster

func FindHostAndCluster(entity *string,
	vmToHost map[string]*string,
	morToParent map[string]*string,
	morToName map[string]*string) (*string, *string, error)

FindHostAndCluster Find cluster for managed entity

func Int32MaptoString

func Int32MaptoString(value []int32, separator string, noarray bool) string

Int32MaptoString converts a int32 map to csv or get the first value

func Int64MaptoString

func Int64MaptoString(value []int64, separator string, noarray bool) string

Int64MaptoString converts a int64 map to csv or get the first value

func IntMaptoString

func IntMaptoString(value []int, separator string, noarray bool) string

IntMaptoString converts a int map to csv or get the first value

func Join

func Join(values map[int]string, separator string) string

Join map[int]string into a string

func MapObjInt32

func MapObjInt32(property string, sourceVal *types.AnyType, dest map[string]*int32, index string) error

MapObjInt32 fills in an int32 into a map to another object reference

func MapObjRef

func MapObjRef(property string, sourceVal *types.AnyType, dest map[string]*string, index string) error

MapObjRef fills in object reference into a map to another object reference

func MapObjRefs

func MapObjRefs(property string, sourceVal *types.AnyType, dest map[string]*[]types.ManagedObjectReference, index string) error

MapObjRefs fills in object references into a map to another object reference

func Max

func Max(n ...int64) int64

Max : get the maximum of the values

func Min

func Min(n ...int64) int64

Min : get the minimum of values

func MustAtoi

func MustAtoi(value string) int

MustAtoi converts a string to integer and return 0 i case of error

func MustWriteString

func MustWriteString(buffer *bytes.Buffer, s string)

MustWriteString writes to a buffer and panics on error

func Reverse

func Reverse(array []string)

Reverse reverses the values of an array

func StringMaptoString

func StringMaptoString(value []string, separator string, noarray bool) string

StringMaptoString converts a string map to csv or get the first value

func Sum

func Sum(n ...int64) int64

Sum : Sum the values

func ValToString

func ValToString(value interface{}, separator string, noarray bool) string

ValToString : try to convert interface to string. Separated by separator if slice

Types

This section is empty.

Jump to

Keyboard shortcuts

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