Documentation ¶
Index ¶
- Variables
- func BoolP(b bool) *bool
- func CamelCase(fieldName string, initCase bool) string
- func CheckOrCreateWritableDirectory(dirname string) (string, error)
- func CreateTempDir(config string, createFile bool, extension ...string) (dirname, file string, err error)
- func CreateTypeAssertError(msg string) error
- func DashCase(fieldName string) string
- func GetObjByField(l []interface{}, identifier string, value string) interface{}
- func GetServerAdminState(state string) (string, error)
- func Int64P(i int) *int64
- func IsZeroValue(v reflect.Value) bool
- func ObjInArray(value string, y []interface{}, identifier string) bool
- func ParseBindAddress(path string) (string, string, error)
- func ParseSize(size string) *int64
- func ParseTimeout(tOut string) *int64
- func ParseTimeoutDefaultSeconds(tOut string) *int64
- func Ptr[V any](v V) *V
- func RandomString(n int) string
- func SanitizeFilename(name string) string
- func SanitizeIPv6Address(addr string) string
- func SnakeCase(fieldName string) string
- func StringInSlice(a string, list []string) bool
- func StringP(s string) *string
- type Bits
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrTypeAssert = errors.New("type assert error")
Functions ¶
func CreateTempDir ¶
func CreateTempDir(config string, createFile bool, extension ...string) (dirname, file string, err error)
CreateTempDir will create a new temporary dir. If config is provided it will create a file with its content
func CreateTypeAssertError ¶
func GetObjByField ¶
GetObjByField returns struct from list l if it has field named identifier with value value
func GetServerAdminState ¶
GetServerAdminState parses srv_admin_state, srv_admin_state is a mask
func IsZeroValue ¶
IsZeroValue is a helper method for reflect, checks if reflect.Value has zero value
func ObjInArray ¶
ObjInArray returns true if struct in list y has field named identifier with value value
func ParseTimeout ¶
ParseTimeout returns the number of milliseconds in a timeout string.
func RandomString ¶
func SanitizeFilename ¶
SanitizeFilename collapses paths and replaces most non-alphanumeric characters with underscores
func SanitizeIPv6Address ¶
func StringInSlice ¶
StringInSlice checks if a string is in a list of strings
Types ¶
Click to show internal directories.
Click to hide internal directories.