Documentation
¶
Index ¶
- Constants
- func ArrayKeyExists(key interface{}, m map[interface{}]interface{}) bool
- func Bool(b bool) *bool
- func Camel(value string) string
- func ContainsString(s []string, str string) bool
- func ConvertStringMapToString(m *StringMap, separate string) string
- func ConvertToCentUnit(amount float64) int
- func ConvertToYuanUnit(amount int) float64
- func EncodeToBytes(p interface{}) []byte
- func Float32(f float32) *float32
- func Float64(f float64) *float64
- func GetHashMapKV(maps StringMap) (keys []string, values []interface{})
- func GetJoinedWithKSort(params *StringMap) string
- func GetModelTags(t reflect.Type, tagName string) (tags []string)
- func GetStringMapKV(maps StringMap) (keys []string, values []string)
- func HashMapToStructure(mapObj *HashMap, obj interface{}) (err error)
- func Implode(glue string, arrayStrs []string) string
- func InArray(needle interface{}, hystack interface{}) bool
- func InHash(val interface{}, hash *HashMap) (exists bool, key string)
- func InStringMap(val string, maps *StringMap) (exists bool, keys []string)
- func Int(i int) *int
- func Int32(i int32) *int32
- func Int64(i int64) *int64
- func IsLower(s string) bool
- func IsNumeric(val interface{}, trueNumber bool) bool
- func IsObjectNil(obj interface{}) bool
- func IsUpper(s string) bool
- func JsonDecode(data []byte, v interface{}) error
- func JsonEncode(v interface{}) (string, error)
- func JsonEscape(str string) (string, error)
- func LCFirst(str string) string
- func LoadObjectFromFile(jsonPath string, obj interface{}) (err error)
- func Lower(value string) string
- func Map2Xml(obj *HashMap, isSub bool) (strXML string)
- func OpenYMLFile(yamlFile string, yamlObject interface{}) (err error)
- func QuickRandom(length int) string
- func RandStringBytesMask(n int) string
- func RegexpReplace(pattern string, replacement string, subject string) string
- func SaveObjectToFile(obj interface{}, filePath string, perm fs.FileMode) (err error)
- func SaveYMLFile(yamlObject interface{}, savePath string, perm fs.FileMode) (err error)
- func SearchInArray(val interface{}, array interface{}) (exists bool, index int)
- func Shuffle(str string) string
- func Snake(value string, delimiter string) string
- func Str2Xml(in string) string
- func String(s string) *string
- func StringMap2Xml(obj *StringMap) (strXML string)
- func StructToJson(obj interface{}) (strJson string, err error)
- func StructToMap(obj interface{}) (newMap map[string]interface{}, err error)
- func Studly(value string) string
- func Time(t time.Time) *time.Time
- func UCWords(str string) string
- func UniqueID(prefix string) string
- func Upper(value string) string
- func Xml2HashMap(b []byte) (m map[string]interface{}, err error)
- type AnyMap
- type Array
- type Attribute
- func (attr *Attribute) CheckRequiredAttributes() error
- func (attr *Attribute) Get(attribute string, defaultValue interface{}) interface{}
- func (attr *Attribute) GetAttribute(name string, defaultValue interface{}) interface{}
- func (attr *Attribute) GetAttributes() *HashMap
- func (attr *Attribute) GetRequired() []string
- func (attr *Attribute) GetString(attribute string, defaultValue string) string
- func (attr *Attribute) Has(key string) bool
- func (attr *Attribute) IsRequired(attribute string) bool
- func (attr *Attribute) Merge(attributes *HashMap) *Attribute
- func (attr *Attribute) SetAttribute(name string, value interface{}) *Attribute
- func (attr *Attribute) SetAttributes(attributes *HashMap) *Attribute
- type Collection
- func (c *Collection) Add(key string, value interface{})
- func (c *Collection) All() *HashMap
- func (c *Collection) Count() int
- func (c *Collection) Except(keys []string) HashMap
- func (c *Collection) First() interface{}
- func (c *Collection) Forget(key string)
- func (c *Collection) Get(key string, defaultValue interface{}) interface{}
- func (c *Collection) GetBool(key string, defaultValue bool) bool
- func (c *Collection) GetBoolPointer(key string, defaultValue bool) *bool
- func (c *Collection) GetDateTime(key string, defaultValue time.Time) time.Time
- func (c *Collection) GetDateTimePointer(key string, defaultValue time.Time) *time.Time
- func (c *Collection) GetFloat32(key string, defaultValue float64) float32
- func (c *Collection) GetFloat32Pointer(key string, defaultValue float64) *float32
- func (c *Collection) GetFloat64(key string, defaultValue float64) float64
- func (c *Collection) GetFloat64Array(key string, defaultValue []float64) []float64
- func (c *Collection) GetFloat64Pointer(key string, defaultValue float64) *float64
- func (c *Collection) GetInt(key string, defaultValue int) int
- func (c *Collection) GetInt16(key string, defaultValue int16) int16
- func (c *Collection) GetInt16Pointer(key string, defaultValue int16) *int16
- func (c *Collection) GetInt32(key string, defaultValue int32) int32
- func (c *Collection) GetInt32Pointer(key string, defaultValue int32) *int32
- func (c *Collection) GetInt64(key string, defaultValue int64) int64
- func (c *Collection) GetInt64Pointer(key string, defaultValue int64) *int64
- func (c *Collection) GetInt8(key string, defaultValue int8) int8
- func (c *Collection) GetInt8Pointer(key string, defaultValue int8) *int8
- func (c *Collection) GetIntArray(key string, defaultValue []int) []int
- func (c *Collection) GetIntPointer(key string, defaultValue int) *int
- func (c *Collection) GetInterfaceArray(key string, defaultValue []interface{}) []interface{}
- func (c *Collection) GetNullString(key string, defaultValue string) NullString
- func (c *Collection) GetString(key string, defaultValue string) string
- func (c *Collection) GetStringArray(key string, defaultValue []string) []string
- func (c *Collection) GetStringPointer(key string, defaultValue string) *string
- func (c *Collection) Has(key string) bool
- func (c *Collection) Last() interface{}
- func (c *Collection) Merge(items *HashMap) HashMap
- func (c *Collection) Only(keys []string) (result *HashMap)
- func (c *Collection) Set(key string, value interface{})
- func (c *Collection) ToHashMap() *HashMap
- func (c *Collection) ToJson(option int) (string, error)
- func (c *Collection) ToString() string
- func (c *Collection) Unserialize(serialized string) *HashMap
- type HashMap
- func FilterEmptyHashMap(mapData *HashMap) (filteredMap *HashMap)
- func MergeHashMap(toMap *HashMap, subMaps ...*HashMap) *HashMap
- func ReplaceHashMapRecursive(toMap *HashMap, subMaps ...*HashMap) *HashMap
- func StructToHashMap(obj interface{}) (newMap *HashMap, err error)
- func StructToHashMapWithXML(obj interface{}) (newMap *HashMap, err error)
- func Xml2Map(b []byte) (m HashMap, err error)
- type NullString
- type StringMap
- func FilterEmptyStringMap(mapData *StringMap) (filteredMap *StringMap)
- func HashMapToStringMap(obj *HashMap) (newMap *StringMap, err error)
- func MergeStringMap(toStringMap *StringMap, subStringMaps ...*StringMap) *StringMap
- func ReplaceStringMapRecursive(toMap *StringMap, subMaps ...*StringMap) *StringMap
- func StructToStringMap(obj interface{}) (newMap *StringMap, err error)
- func StructToStringMapWithTag(obj interface{}, tag string) (newMap *StringMap, err error)
Constants ¶
View Source
const WX_CURRENCY_UNIT float64 = 100
Variables ¶
This section is empty.
Functions ¶
func ArrayKeyExists ¶
func ArrayKeyExists(key interface{}, m map[interface{}]interface{}) bool
func ContainsString ¶
func ConvertToCentUnit ¶
func ConvertToYuanUnit ¶
func EncodeToBytes ¶
func EncodeToBytes(p interface{}) []byte
func GetHashMapKV ¶
func GetJoinedWithKSort ¶
func GetStringMapKV ¶
func HashMapToStructure ¶
func IsLower ¶
*
- Check for lowercase character(s)
- @param string str <p>
- The input string.
- </p>
- @param string<p>
- @return bool.
func IsObjectNil ¶
func IsObjectNil(obj interface{}) bool
func IsUpper ¶
*
- Check for uppercase character(s)
- @param string str <p>
- The input string.
- </p>
- @param string<p>
- @return bool.
func JsonDecode ¶
func JsonEncode ¶
func JsonEscape ¶
func LCFirst ¶
*
- Make a string's first character lowercase
- @param string str <p>
- The input string.
- </p>
- @return string the resulting string.
func LoadObjectFromFile ¶
func OpenYMLFile ¶
func QuickRandom ¶
func RandStringBytesMask ¶
func SaveObjectToFile ¶
func SaveYMLFile ¶
func SearchInArray ¶
func Snake ¶
*
- Convert a string to snake case. *
- @param string $value
- @param string $delimiter
- @return string
func StringMap2Xml ¶
func StructToJson ¶
func StructToMap ¶
------------------------------- Conversion ---------------------------------------
func UCWords ¶
*
- Uppercase the first character of each word in a string
- @param string str <p>
- The input string.
- </p>
- @param string delimiters [optional] <p>
- @return string the modified string.
func Xml2HashMap ¶
Types ¶
type Attribute ¶
type Attribute struct {
Attributes HashMap
}
func NewAttribute ¶
func (*Attribute) CheckRequiredAttributes ¶
func (*Attribute) GetAttribute ¶
func (*Attribute) GetAttributes ¶
func (*Attribute) GetRequired ¶
func (*Attribute) IsRequired ¶
func (*Attribute) SetAttribute ¶
func (*Attribute) SetAttributes ¶
type Collection ¶
type Collection struct {
// contains filtered or unexported fields
}
func NewCollection ¶
func NewCollection(items *HashMap) *Collection
func (*Collection) Add ¶
func (c *Collection) Add(key string, value interface{})
func (*Collection) All ¶
func (c *Collection) All() *HashMap
func (*Collection) Count ¶
func (c *Collection) Count() int
func (*Collection) Except ¶
func (c *Collection) Except(keys []string) HashMap
func (*Collection) First ¶
func (c *Collection) First() interface{}
func (*Collection) Forget ¶
func (c *Collection) Forget(key string)
func (*Collection) Get ¶
func (c *Collection) Get(key string, defaultValue interface{}) interface{}
Get an item from an hashMap using "dot" notation.
func (*Collection) GetBoolPointer ¶
func (c *Collection) GetBoolPointer(key string, defaultValue bool) *bool
func (*Collection) GetDateTime ¶
func (*Collection) GetDateTimePointer ¶
func (*Collection) GetFloat32 ¶
func (c *Collection) GetFloat32(key string, defaultValue float64) float32
func (*Collection) GetFloat32Pointer ¶
func (c *Collection) GetFloat32Pointer(key string, defaultValue float64) *float32
func (*Collection) GetFloat64 ¶
func (c *Collection) GetFloat64(key string, defaultValue float64) float64
func (*Collection) GetFloat64Array ¶
func (c *Collection) GetFloat64Array(key string, defaultValue []float64) []float64
func (*Collection) GetFloat64Pointer ¶
func (c *Collection) GetFloat64Pointer(key string, defaultValue float64) *float64
func (*Collection) GetInt16Pointer ¶
func (c *Collection) GetInt16Pointer(key string, defaultValue int16) *int16
func (*Collection) GetInt32Pointer ¶
func (c *Collection) GetInt32Pointer(key string, defaultValue int32) *int32
func (*Collection) GetInt64Pointer ¶
func (c *Collection) GetInt64Pointer(key string, defaultValue int64) *int64
func (*Collection) GetInt8Pointer ¶
func (c *Collection) GetInt8Pointer(key string, defaultValue int8) *int8
func (*Collection) GetIntArray ¶
func (c *Collection) GetIntArray(key string, defaultValue []int) []int
func (*Collection) GetIntPointer ¶
func (c *Collection) GetIntPointer(key string, defaultValue int) *int
func (*Collection) GetInterfaceArray ¶
func (c *Collection) GetInterfaceArray(key string, defaultValue []interface{}) []interface{}
func (*Collection) GetNullString ¶
func (c *Collection) GetNullString(key string, defaultValue string) NullString
func (*Collection) GetString ¶
func (c *Collection) GetString(key string, defaultValue string) string
func (*Collection) GetStringArray ¶
func (c *Collection) GetStringArray(key string, defaultValue []string) []string
func (*Collection) GetStringPointer ¶
func (c *Collection) GetStringPointer(key string, defaultValue string) *string
func (*Collection) Has ¶
func (c *Collection) Has(key string) bool
func (*Collection) Last ¶
func (c *Collection) Last() interface{}
func (*Collection) Merge ¶
func (c *Collection) Merge(items *HashMap) HashMap
func (*Collection) Only ¶
func (c *Collection) Only(keys []string) (result *HashMap)
func (*Collection) Set ¶
func (c *Collection) Set(key string, value interface{})
func (*Collection) ToHashMap ¶
func (c *Collection) ToHashMap() *HashMap
func (*Collection) ToString ¶
func (c *Collection) ToString() string
func (*Collection) Unserialize ¶
func (c *Collection) Unserialize(serialized string) *HashMap
type HashMap ¶
type HashMap map[string]interface{}
func FilterEmptyHashMap ¶
------------------------------- Filter --------------------------------------------
func MergeHashMap ¶
------------------------------- Merge --------------------------------------------
func ReplaceHashMapRecursive ¶
------------------------------- Replace --------------------------------------------
func StructToHashMap ¶
func StructToHashMapWithXML ¶
type NullString ¶
type NullString struct {
sql.NullString
}
func NewNullString ¶
func NewNullString(String string, Valid bool) NullString
func (*NullString) MarshalJSON ¶
func (v *NullString) MarshalJSON() ([]byte, error)
func (*NullString) UnmarshalJSON ¶
func (v *NullString) UnmarshalJSON(data []byte) error
type StringMap ¶
var ( /** * The cache of snake-cased words. * * @var array */ SnakeCache StringMap /** * The cache of camel-cased words. * * @var array */ CamelCache StringMap /** * The cache of studly-cased words. * * @var array */ StudlyCache StringMap /** * The callback that should be used to generate UUIDs. * * @var callable */ UidFactory StringMap )
func FilterEmptyStringMap ¶
------------------------------- Filter --------------------------------------------
func HashMapToStringMap ¶
func MergeStringMap ¶
------------------------------- Merge --------------------------------------------
func ReplaceStringMapRecursive ¶
------------------------------- Replace --------------------------------------------
func StructToStringMap ¶
Click to show internal directories.
Click to hide internal directories.