Documentation ¶
Index ¶
- func Decode(data interface{}) (interface{}, error)
- func DecodeTo(data interface{}, v interface{}) error
- func Encode(value interface{}) ([]byte, error)
- func JsonFormat(val interface{}) interface{}
- func JsonQuotes() string
- func MakeJsonKey(key string) string
- func RegJsonFormatter(vt reflect.Type, formatter JsonDataFormatter)
- func Valid(data interface{}) bool
- type JsonDataFormatter
- type JsonStr
- type TJson
- func DecodeToJson(data interface{}, unsafe ...bool) (*TJson, error)
- func Load(path string, unsafe ...bool) (*TJson, error)
- func LoadContent(data interface{}, unsafe ...bool) (*TJson, error)
- func LoadJson(data interface{}, unsafe ...bool) (*TJson, error)
- func LoadToml(data interface{}, unsafe ...bool) (*TJson, error)
- func LoadXml(data interface{}, unsafe ...bool) (*TJson, error)
- func LoadYaml(data interface{}, unsafe ...bool) (*TJson, error)
- func New(data interface{}, unsafe ...bool) *TJson
- func NewUnsafe(data ...interface{}) *TJson
- func (j *TJson) Append(pattern string, value interface{}) error
- func (j *TJson) Contains(pattern string) bool
- func (j *TJson) Dump()
- func (j *TJson) Export() string
- func (j *TJson) Get(pattern string, def ...interface{}) interface{}
- func (j *TJson) GetArray(pattern string, def ...interface{}) []interface{}
- func (j *TJson) GetBool(pattern string, def ...interface{}) bool
- func (j *TJson) GetBytes(pattern string, def ...interface{}) []byte
- func (j *TJson) GetDuration(pattern string, def ...interface{}) time.Duration
- func (j *TJson) GetFloat32(pattern string, def ...interface{}) float32
- func (j *TJson) GetFloat64(pattern string, def ...interface{}) float64
- func (j *TJson) GetFloats(pattern string, def ...interface{}) []float64
- func (j *TJson) GetGTime(pattern string, format ...string) *xtime.Time
- func (j *TJson) GetInt(pattern string, def ...interface{}) int
- func (j *TJson) GetInt16(pattern string, def ...interface{}) int16
- func (j *TJson) GetInt32(pattern string, def ...interface{}) int32
- func (j *TJson) GetInt64(pattern string, def ...interface{}) int64
- func (j *TJson) GetInt8(pattern string, def ...interface{}) int8
- func (j *TJson) GetInterfaces(pattern string, def ...interface{}) []interface{}
- func (j *TJson) GetInts(pattern string, def ...interface{}) []int
- func (j *TJson) GetJson(pattern string, def ...interface{}) *TJson
- func (j *TJson) GetJsonMap(pattern string, def ...interface{}) map[string]*TJson
- func (j *TJson) GetJsons(pattern string, def ...interface{}) []*TJson
- func (j *TJson) GetMap(pattern string, def ...interface{}) map[string]interface{}
- func (j *TJson) GetString(pattern string, def ...interface{}) string
- func (j *TJson) GetStrings(pattern string, def ...interface{}) []string
- func (j *TJson) GetStruct(pattern string, pointer interface{}, mapping ...map[string]string) error
- func (j *TJson) GetStructDeep(pattern string, pointer interface{}, mapping ...map[string]string) error
- func (j *TJson) GetStructs(pattern string, pointer interface{}, mapping ...map[string]string) error
- func (j *TJson) GetStructsDeep(pattern string, pointer interface{}, mapping ...map[string]string) error
- func (j *TJson) GetTime(pattern string, format ...string) time.Time
- func (j *TJson) GetToStruct(pattern string, pointer interface{}, mapping ...map[string]string) error
- func (j *TJson) GetToVar(pattern string, pointer interface{}) error
- func (j *TJson) GetUint(pattern string, def ...interface{}) uint
- func (j *TJson) GetUint16(pattern string, def ...interface{}) uint16
- func (j *TJson) GetUint32(pattern string, def ...interface{}) uint32
- func (j *TJson) GetUint64(pattern string, def ...interface{}) uint64
- func (j *TJson) GetUint8(pattern string, def ...interface{}) uint8
- func (j *TJson) GetVar(pattern string, def ...interface{}) *_type.TVar
- func (j *TJson) IsNil() bool
- func (j *TJson) Len(pattern string) int
- func (j *TJson) MarshalJSON() ([]byte, error)
- func (j *TJson) Remove(pattern string) error
- func (j *TJson) Set(pattern string, value interface{}) error
- func (j *TJson) SetSplitChar(char byte)
- func (j *TJson) SetViolenceCheck(enabled bool)
- func (j *TJson) ToArray() []interface{}
- func (j *TJson) ToJson() ([]byte, error)
- func (j *TJson) ToJsonIndent() ([]byte, error)
- func (j *TJson) ToJsonIndentString() (string, error)
- func (j *TJson) ToJsonString() (string, error)
- func (j *TJson) ToMap() map[string]interface{}
- func (j *TJson) ToStruct(pointer interface{}) error
- func (j *TJson) ToStructDeep(pointer interface{}) error
- func (j *TJson) ToStructs(pointer interface{}) error
- func (j *TJson) ToStructsDeep(pointer interface{}) error
- func (j *TJson) ToToml() ([]byte, error)
- func (j *TJson) ToTomlString() (string, error)
- func (j *TJson) ToXml(rootTag ...string) ([]byte, error)
- func (j *TJson) ToXmlIndent(rootTag ...string) ([]byte, error)
- func (j *TJson) ToXmlIndentString(rootTag ...string) (string, error)
- func (j *TJson) ToXmlString(rootTag ...string) (string, error)
- func (j *TJson) ToYaml() ([]byte, error)
- func (j *TJson) ToYamlString() (string, error)
- func (j *TJson) Value() interface{}
- type TJsonDateFormatter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JsonFormat ¶
func JsonFormat(val interface{}) interface{}
func RegJsonFormatter ¶
func RegJsonFormatter(vt reflect.Type, formatter JsonDataFormatter)
Types ¶
type JsonDataFormatter ¶
type JsonDataFormatter interface {
Format(v interface{}) interface{}
}
json序列化接口
type TJson ¶
type TJson struct {
// contains filtered or unexported fields
}
func DecodeToJson ¶
解码json数据为TJson对象实例
func LoadContent ¶
将其他数据加载转换成TJson对象实例
func (*TJson) GetDuration ¶
func (*TJson) GetFloat32 ¶
func (*TJson) GetFloat64 ¶
func (*TJson) GetInterfaces ¶
func (*TJson) GetJsonMap ¶
func (*TJson) GetStrings ¶
func (*TJson) GetStructDeep ¶
func (*TJson) GetStructs ¶
func (*TJson) GetStructsDeep ¶
func (*TJson) GetToStruct ¶
func (*TJson) MarshalJSON ¶
func (*TJson) SetViolenceCheck ¶
设置是否允许通过带"."的键名访问子级,默认false
func (*TJson) ToJsonIndent ¶
func (*TJson) ToJsonIndentString ¶
func (*TJson) ToJsonString ¶
func (*TJson) ToStructDeep ¶
func (*TJson) ToStructsDeep ¶
func (*TJson) ToTomlString ¶
func (*TJson) ToXmlIndentString ¶
func (*TJson) ToYamlString ¶
type TJsonDateFormatter ¶
type TJsonDateFormatter struct { }
func (*TJsonDateFormatter) Format ¶
func (jf *TJsonDateFormatter) Format(val interface{}) interface{}
Click to show internal directories.
Click to hide internal directories.