Documentation ¶
Index ¶
- Variables
- func Base64Decode(str string) []byte
- func Base64Encode(str string) string
- func Bool(obj interface{}) bool
- func Datetime() string
- func Datetime_ms() string
- func Debug(msgs ...interface{})
- func DeepCopy(value interface{}) interface{}
- func Default(obj interface{}, def interface{}) interface{}
- func DetermineEncoding(r *bufio.Reader) (encoding.Encoding, error)
- func Empty(obj interface{}) bool
- func Error(msgs ...interface{})
- func Float32(obj interface{}, defaults ...float32) float32
- func Float64(obj interface{}, defaults ...float64) float64
- func GBKToUTF8(s []byte) ([]byte, error)
- func If(condition bool, trueVal, falseVal interface{}) interface{}
- func InDebug() bool
- func In_Array(array interface{}, val interface{}) bool
- func In_Array_Index(array interface{}, val interface{}) int
- func Int(obj interface{}, defaults ...int) int
- func Int64(obj interface{}, defaults ...int64) int64
- func IsBlank(value reflect.Value) bool
- func MD5(str string) string
- func MapGetString(m *map[string]interface{}, key string, defaults ...string) string
- func ShowType(msgs ...interface{})
- func String(obj interface{}, defaults ...string) string
- func Timestamp() int64
- func Timestamp_ms() int64
- func Timestamp_ns() int64
- func ToUTF8(r io.Reader) ([]byte, error)
- func Trim(strs ...string) string
- func Typeof(v ...interface{}) string
- func UTF8ToGBK(s []byte) ([]byte, error)
- type Conf
- type JSONClass
- func (this *JSONClass) Arr(objs ...interface{}) *SJSON
- func (this *JSONClass) Debug(objs ...interface{})
- func (this *JSONClass) Obj(obj ...interface{}) *SJSON
- func (this *JSONClass) Parse(json string) gjson.Result
- func (this *JSONClass) ParseFile(filename string) gjson.Result
- func (this *JSONClass) ParseJSON(str string) (interface{}, error)
- func (this *JSONClass) ParseObj(str string, obj interface{}) error
- func (this *JSONClass) Show(obj interface{}) string
- func (this *JSONClass) Stringify(obj interface{}) string
- func (this *JSONClass) ToObj(obj interface{}) interface{}
- type SJSON
- func (this *SJSON) CamelString() *SJSON
- func (this *SJSON) Delete(k string) *SJSON
- func (this *SJSON) Filter(ps ...string) *SJSON
- func (this *SJSON) GJSON() gjson.Result
- func (this *SJSON) Get(key string) gjson.Result
- func (this *SJSON) IsArray() bool
- func (this *SJSON) IsEmpty() bool
- func (this *SJSON) Obj() interface{}
- func (this *SJSON) Parse(obj interface{}) *SJSON
- func (this *SJSON) Set(k string, p interface{}) *SJSON
- func (this *SJSON) SetArr(p ...interface{}) *SJSON
- func (this *SJSON) SetMap(maps map[string]interface{}) *SJSON
- func (this *SJSON) Show() string
- func (this *SJSON) SnakeString() *SJSON
- func (this *SJSON) String() string
- type StrClass
- func (this *StrClass) CamelString(s string) string
- func (this *StrClass) EndWith(str, find string) bool
- func (this *StrClass) EndWithi(str, find string) bool
- func (this *StrClass) FromArr(arr []string) string
- func (this *StrClass) FromArr2(arr []string, c string) string
- func (this *StrClass) Has(str, find string) bool
- func (this *StrClass) Hasi(str, find string) bool
- func (this *StrClass) In_Array(array []string, val string) bool
- func (this *StrClass) In_Array_Index(array []string, val string) int
- func (this *StrClass) In_Array_Indexi(array []string, val string) int
- func (this *StrClass) In_Arrayi(array []string, val string) bool
- func (this *StrClass) RemoveRepeatedFromArr(arr []string) []string
- func (this *StrClass) SnakeString(s string) string
- func (this *StrClass) StartWith(str, find string) bool
- func (this *StrClass) StartWithi(str, find string) bool
- func (this *StrClass) ToArr(strs ...string) []string
Constants ¶
This section is empty.
Variables ¶
View Source
var ( JSON *JSONClass = &JSONClass{} Str *StrClass = &StrClass{} )
Functions ¶
func Base64Decode ¶
func Base64Encode ¶
func Datetime_ms ¶
func Datetime_ms() string
func In_Array_Index ¶
func In_Array_Index(array interface{}, val interface{}) int
反射方式获取变量是否在数组中,如果存在返回索引,不存在返回-1
func MapGetString ¶
从map[string]interface{}中获取字符串
func Timestamp_ms ¶
func Timestamp_ms() int64
func Timestamp_ns ¶
func Timestamp_ns() int64
Types ¶
type JSONClass ¶
type JSONClass struct { }
type SJSON ¶
type SJSON struct {
Json string
}
func (*SJSON) CamelString ¶
func (*SJSON) SnakeString ¶
type StrClass ¶
type StrClass struct{}
func (*StrClass) CamelString ¶
camel string, xx_yy to XxYy
func (*StrClass) In_Array_Index ¶
数组中是否包含指定字符串,如果存在返回索引,不存在返回-1
func (*StrClass) In_Array_Indexi ¶
忽略大小写版本
func (*StrClass) RemoveRepeatedFromArr ¶
字符串数组去重
func (*StrClass) SnakeString ¶
snake string, XxYy to xx_yy , XxYY to xx_yy
func (*StrClass) StartWithi ¶
Click to show internal directories.
Click to hide internal directories.