Documentation ¶
Index ¶
- func AddUniqueStringtoSlice(names []string, name string) []string
- func CheckErr(err error, handleErr func(string))
- func CheckFalsy(falsy string) bool
- func CheckTruthy(truth string) bool
- func Contains(s []string, k string) bool
- func ContainsIgnoredCase(s []string, k string) bool
- func FD_ISSET(p *syscall.FdSet, i int) bool
- func FD_SET(p *syscall.FdSet, i int)
- func FD_ZERO(p *syscall.FdSet)
- func Fatal(msg string)
- func Hash(s string) string
- func IsMatchRegex(regex, s string) bool
- func MatchIgnoredCase(keys []string, s string) bool
- func RemoveString(slice []string, s string) (result []string)
- func SparseFileCreate(path string, size int64) error
- func SparseFileDelete(path string) error
- func SparseFileInfo(path string) (os.FileInfo, error)
- func StateStatus(state bool) string
- func StrToInt32(val string) *int32
- func StringToInt32(val string) (*int32, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddUniqueStringtoSlice ¶ added in v0.8.0
AddUniqueStringtoSlice ensures there are no repeated devices added to a slice
func CheckFalsy ¶
CheckFalsy checks for non-truthiness of the passed argument.
func CheckTruthy ¶
CheckTruthy checks for truthiness of the passed argument.
func Contains ¶
Contains is a util function which returns true if one key is present in array else it returns false
func ContainsIgnoredCase ¶
ContainsIgnoredCase is a util function which returns true if one key is present in array else it returns false. This function is not case sensitive.
func FD_SET ¶
FD_SET add a given file descriptor from a set it perform bit shift operations and set fdset. ie if value of i is 2 then it will set fdset's value as {[16]int64{4}}
func Fatal ¶
func Fatal(msg string)
Fatal prints the message (if provided) and then exits. If V(2) or greater, klog.Fatal is invoked for extended information.
func IsMatchRegex ¶ added in v0.4.0
IsMatchRegex is a utility function which returns true if the string -s matches with the regex specified.
func MatchIgnoredCase ¶
MatchIgnoredCase is a util function which returns true if any of the keys are present as a string in given string - s This function is not case sensitive.
func RemoveString ¶ added in v0.4.0
RemoveString removes all occurrences of a string from slice
func SparseFileCreate ¶
SparseFileCreate will create a new sparse file if none exists at the give path and will set the size to specified value
func SparseFileDelete ¶
SparseFileDelete will delete the sparse file if it exists
func SparseFileInfo ¶
SparseFileInfo will return the stats of the sparse file
func StateStatus ¶
StateStatus returns enable if state is true and disable if state is false
func StrToInt32 ¶
StrToInt32 converts a string type to corresponding *int32 type
NOTE:
This swallows the error if any
func StringToInt32 ¶
StringToInt32 converts a string type to corresponding *int32 type
Types ¶
This section is empty.