Documentation ¶
Index ¶
- Constants
- func CleanPath(p string) (w string)
- func FillStruct(s interface{}, m map[string]interface{}) error
- func FixDirPath(p *string)
- func FixURL(url *string) error
- func FormatInt(i *int64, base int) string
- func FormatIntArray(arr []int64, base int, sep string) string
- func FullGOPath(repourl string) (w string)
- func GOPath(repourl string) (w string)
- func GetField(obj interface{}, name string) (interface{}, error)
- func HasOneSuffix(str string, suffixes []string) bool
- func IsArrContainStr(arr []string, s string) bool
- func IsWhitespace(s string) bool
- func JSONMarshal(v interface{}, unescape bool) ([]byte, error)
- func LoadStruct(obj interface{}, m map[string]interface{}, tagname string, ...) error
- func ObjectFromJSON(object interface{}, data string) error
- func ObjectToJSON(object interface{}) (string, error)
- func Quote(s *string) string
- func QuoteArray(s []string, sep string) string
- func RandString(n int, pool string) string
- func ReadArguments(reader io.Reader) (args []string, eof bool, err error)
- func ReduceAbsPath(path string) (result string, err error)
- func SetField(obj interface{}, name string, value interface{}) error
- func SplitArguments(src string) (args []string, eof bool, err error)
- func SplitWhite(s string) ([]string, error)
- func ToMapInterfaceInterface(in map[string]interface{}) (out map[interface{}]interface{})
- func ToMapStringInterface(in map[interface{}]interface{}) (out map[string]interface{})
- func ToStringArr(in []interface{}) (out []string)
- func UnescapeString(src string) string
Constants ¶
const ( // ByteMask is mask to filter one byte with '&' and operator ByteMask = 0xFF // WordMask is mask to filter one word with '&' and operator WordMask = 0xFFFF // DWordMask is mask to filter one double-word with '&' and operator DWordMask = 0xFFFFFFFF // LongMask is mask to filter one long with '&' and operator LongMask = 0xFFFFFFFFFFFFFFFF // ThreeByteMask is mask to filter three bytes with '&' and operator ThreeByteMask = 0xFFFFFF // FiveByteMask is mask to filter five bytes with '&' and operator FiveByteMask = 0xFFFFFFFFFF // SixByteMask is mask to filter six bytes with '&' and operator SixByteMask = 0xFFFFFFFFFFFF // SevenByteMask is mask to filter seven bytes with '&' and operator SevenByteMask = 0xFFFFFFFFFFFFFF )
const ( // NumericBytes is set of numeric characters for RandString function NumericBytes = "1234567890" // LowerAlphaBytes is set of lower alphabetic characters for RandString function LowerAlphaBytes = "abcdefghijklmnopqrstuvwxyz" // UpperAlphaBytes is set of upper alphabetic characters for RandString function UpperAlphaBytes = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" // AlphaBytes is set of alphabetic characters for RandString function AlphaBytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" // AlphaNumericBytes is set of numeric and alphabetic characters for RandString function AlphaNumericBytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890" // LowerAlphaNumericBytes is set of numeric and only lower alphabetic characters for RandString function LowerAlphaNumericBytes = "abcdefghijklmnopqrstuvwxyz1234567890" // UpperAlphaNumericBytes is set of numeric and only upper alphabetic characters for RandString function UpperAlphaNumericBytes = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890" // StrongBytes is set of numeric, alphabetic and special characters for RandString function StrongBytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^&*()`~<>?:[]{}-=_+|\\/,." )
Variables ¶
This section is empty.
Functions ¶
func FillStruct ¶
FillStruct load structure data from map
func FixDirPath ¶
func FixDirPath(p *string)
FixDirPath autocorrect dir path to contains / at its end
func FormatIntArray ¶
FormatIntArray transform int array to formatted string
func FullGOPath ¶
FullGOPath return full golang path like host.com/user/repo/dir1/dir2/endpackage for example: github.com/goatcms/goatcore/filesystem/disk If it is not external path return empty string.
func GOPath ¶
GOPath return golang path like host.com/user/repo for example: github.com/goatcms/goatcore If it is not external path return empty string.
func HasOneSuffix ¶
HasOneSuffix checks any element of array has suffix
func IsArrContainStr ¶
IsArrContainStr checks an array contains an element
func IsWhitespace ¶
IsWhitespace return true if input is white char
func JSONMarshal ¶
JSONMarshal convert object to json (and prepare json to be more user friendly)
func LoadStruct ¶
func LoadStruct(obj interface{}, m map[string]interface{}, tagname string, ignoreUndefined bool) error
LoadStruct load structure data from map. Use name from tag or field name
func ObjectFromJSON ¶
ObjectFromJSON decode json data to object
func ObjectToJSON ¶
ObjectToJSON convert object to json
func QuoteArray ¶
QuoteArray transform string array to quoter strings
func ReadArguments ¶
ReadArguments convert string to separated arguments array
func ReduceAbsPath ¶
ReduceAbsPath return shorter path version. Return error if the path refers to a parent directory.
func SplitArguments ¶
SplitArguments convert string to separated arguments array
func ToMapInterfaceInterface ¶
func ToMapInterfaceInterface(in map[string]interface{}) (out map[interface{}]interface{})
ToMapInterfaceInterface convert map[string]interface{} to map[interface{}]interface{}
func ToMapStringInterface ¶
func ToMapStringInterface(in map[interface{}]interface{}) (out map[string]interface{})
ToMapStringInterface convert map[interface{}]interface{} to map[string]interface{}
func ToStringArr ¶
func ToStringArr(in []interface{}) (out []string)
ToStringArr convert []interface{} to []string{}
func UnescapeString ¶
UnescapeString convert '\\' to single '\', '\n' to new line, '\t', '\"' to double quote to tab to new line
Types ¶
This section is empty.