Documentation ¶
Index ¶
- 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 MatchIgnoredCase(keys []string, s string) bool
- 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)
- type MountUtil
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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, glog.Fatal is invoked for extended information.
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 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 ¶
type MountUtil ¶
type MountUtil struct { FilePath string // FilePath is the path of mounts file like -/proc/self/mounts MountPoint string // MountPoint is mount points like - / /var ... }
MountUtil contains mount point and mount file attributes It helps to find which partition is mounted on given mount point
func NewMountUtil ¶
NewMountUtil returns MountUtil struct for given mounts file path and mount point
func (MountUtil) GetDiskPath ¶
GetDiskPath returns os disk devpath