Documentation
¶
Index ¶
- func BoolPointer(value bool) *bool
- func Float64Of(unknown interface{}) (float64, error)
- func HashOf(value string) uint32
- func Int64Of(unknown interface{}) (int64, error)
- func IntOf(unknown interface{}) (int, error)
- func IsEmptyString(s *string) bool
- func StringArrayOf(unknown interface{}) ([]string, error)
- func StringLastOf(unknown interface{}, count int) string
- func StringOf(unknown interface{}) string
- func StringRandom(size int) string
- func StringSliceContains(slices []string, value string) bool
- func ToDurationPtr(d time.Duration) *time.Duration
- func Uint64Of(unknown interface{}) (uint64, error)
- type IMapDecoder
- type JSONMapDecoder
- type StringMap
- func (m *StringMap) Get(key string) (interface{}, bool)
- func (m *StringMap) GetAs(key string, out interface{}) error
- func (m *StringMap) GetAsByPath(path string, out interface{}) error
- func (m *StringMap) GetAsWith(decoder IMapDecoder, key string, out interface{}) error
- func (m *StringMap) Set(key string, value interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsEmptyString ¶
IsEmptyString true if given string is nil or empty
func StringArrayOf ¶
StringArrayOf try to convert an unknown to string array
func StringLastOf ¶
StringLastOf try to get last $count of characters from an unknown
func StringOf ¶
func StringOf(unknown interface{}) string
StringOf try to get a string of unknown type
func StringSliceContains ¶ added in v2.0.1
func ToDurationPtr ¶
ToDurationPtr convert a time.Duration to a pointer
Types ¶
type IMapDecoder ¶
type IMapDecoder interface {
Decode(in interface{}, out interface{}) error
}
IMapDecoder map decoder interface
type JSONMapDecoder ¶
type JSONMapDecoder struct { }
JSONMapDecoder decode map to an object
func (*JSONMapDecoder) Decode ¶
func (d *JSONMapDecoder) Decode(in interface{}, out interface{}) error
Decode in into out
type StringMap ¶
type StringMap map[string]interface{}
StringMap with additional functions
func (*StringMap) GetAsByPath ¶
GetAsByPath Get a value with dot-separated path
Click to show internal directories.
Click to hide internal directories.