Documentation ¶
Index ¶
- func Marshal(v interface{}) ([]byte, error)
- func MarshalIndent(v interface{}, prefix, indent string) ([]byte, error)
- func NewDecoder(r io.Reader) *jsoniter.Decoder
- func NewEncoder(w io.Writer) *jsoniter.Encoder
- func ToJsonString(obj interface{}) string
- func Unmarshal(data []byte, v interface{}) error
- type ContentBuilder
- type JsonArr
- type JsonArrMap
- type JsonContentBuilder
- func (b *JsonContentBuilder) BeginArray() ContentBuilder
- func (b *JsonContentBuilder) BeginArrayWithField(name string) ContentBuilder
- func (b *JsonContentBuilder) BeginObject() ContentBuilder
- func (b *JsonContentBuilder) BeginObjectWithField(name string) ContentBuilder
- func (b *JsonContentBuilder) EndArray() ContentBuilder
- func (b *JsonContentBuilder) EndObject() ContentBuilder
- func (b *JsonContentBuilder) Field(name string) ContentBuilder
- func (b *JsonContentBuilder) More() ContentBuilder
- func (b *JsonContentBuilder) Output() ([]byte, error)
- func (b *JsonContentBuilder) ValueBool(value bool) ContentBuilder
- func (b *JsonContentBuilder) ValueFloat(value float64) ContentBuilder
- func (b *JsonContentBuilder) ValueInterface(value interface{}) ContentBuilder
- func (b *JsonContentBuilder) ValueNull() ContentBuilder
- func (b *JsonContentBuilder) ValueNumeric(value int64) ContentBuilder
- func (b *JsonContentBuilder) ValueRaw(raw string) ContentBuilder
- func (b *JsonContentBuilder) ValueString(value string) ContentBuilder
- func (b *JsonContentBuilder) ValueUNumeric(value uint64) ContentBuilder
- type JsonMap
- func (this JsonMap) GetJsonArr(key string) JsonArr
- func (this JsonMap) GetJsonArrMap(key string) JsonArrMap
- func (this JsonMap) GetJsonMap(key string) JsonMap
- func (this JsonMap) GetJsonVal(key string) JsonVal
- func (this JsonMap) GetJsonValBool(key string) bool
- func (this JsonMap) GetJsonValBoolE(key string) (bool, error)
- func (this JsonMap) GetJsonValBytes(key string) ([]byte, error)
- func (this JsonMap) GetJsonValInt64(key string) int64
- func (this JsonMap) GetJsonValIntE(key string) (int, error)
- func (this JsonMap) GetJsonValString(key string) string
- func (this JsonMap) GetJsonValStringE(key string) (string, error)
- func (this JsonMap) GetJsonValStringOrDefault(key, def string) string
- type JsonVal
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalIndent ¶
MarshalIndent is like Marshal but applies Indent to format the output
func NewDecoder ¶
NewDecoder create decoder read from an input stream
func NewEncoder ¶
func ToJsonString ¶
func ToJsonString(obj interface{}) string
Types ¶
type ContentBuilder ¶
type ContentBuilder interface { Field(name string) ContentBuilder ValueString(value string) ContentBuilder ValueNumeric(value int64) ContentBuilder ValueUNumeric(value uint64) ContentBuilder ValueFloat(value float64) ContentBuilder ValueBool(value bool) ContentBuilder ValueNull() ContentBuilder ValueInterface(value interface{}) ContentBuilder ValueRaw(raw string) ContentBuilder BeginObject() ContentBuilder BeginObjectWithField(name string) ContentBuilder EndObject() ContentBuilder BeginArray() ContentBuilder BeginArrayWithField(name string) ContentBuilder EndArray() ContentBuilder More() ContentBuilder Output() ([]byte, error) }
func ContentBuilderFactory ¶
func ContentBuilderFactory() ContentBuilder
type JsonArrMap ¶
type JsonArrMap []JsonMap
type JsonContentBuilder ¶
type JsonContentBuilder struct {
*jsoniter.Stream
}
func (*JsonContentBuilder) BeginArray ¶
func (b *JsonContentBuilder) BeginArray() ContentBuilder
func (*JsonContentBuilder) BeginArrayWithField ¶
func (b *JsonContentBuilder) BeginArrayWithField(name string) ContentBuilder
func (*JsonContentBuilder) BeginObject ¶
func (b *JsonContentBuilder) BeginObject() ContentBuilder
func (*JsonContentBuilder) BeginObjectWithField ¶
func (b *JsonContentBuilder) BeginObjectWithField(name string) ContentBuilder
func (*JsonContentBuilder) EndArray ¶
func (b *JsonContentBuilder) EndArray() ContentBuilder
func (*JsonContentBuilder) EndObject ¶
func (b *JsonContentBuilder) EndObject() ContentBuilder
func (*JsonContentBuilder) Field ¶
func (b *JsonContentBuilder) Field(name string) ContentBuilder
func (*JsonContentBuilder) More ¶
func (b *JsonContentBuilder) More() ContentBuilder
func (*JsonContentBuilder) Output ¶
func (b *JsonContentBuilder) Output() ([]byte, error)
func (*JsonContentBuilder) ValueBool ¶
func (b *JsonContentBuilder) ValueBool(value bool) ContentBuilder
func (*JsonContentBuilder) ValueFloat ¶
func (b *JsonContentBuilder) ValueFloat(value float64) ContentBuilder
func (*JsonContentBuilder) ValueInterface ¶
func (b *JsonContentBuilder) ValueInterface(value interface{}) ContentBuilder
func (*JsonContentBuilder) ValueNull ¶
func (b *JsonContentBuilder) ValueNull() ContentBuilder
func (*JsonContentBuilder) ValueNumeric ¶
func (b *JsonContentBuilder) ValueNumeric(value int64) ContentBuilder
func (*JsonContentBuilder) ValueRaw ¶
func (b *JsonContentBuilder) ValueRaw(raw string) ContentBuilder
func (*JsonContentBuilder) ValueString ¶
func (b *JsonContentBuilder) ValueString(value string) ContentBuilder
func (*JsonContentBuilder) ValueUNumeric ¶
func (b *JsonContentBuilder) ValueUNumeric(value uint64) ContentBuilder
type JsonMap ¶
type JsonMap map[string]interface{}
func ByteToJsonMap ¶
func (JsonMap) GetJsonArr ¶
func (JsonMap) GetJsonArrMap ¶
func (this JsonMap) GetJsonArrMap(key string) JsonArrMap
func (JsonMap) GetJsonMap ¶
func (JsonMap) GetJsonVal ¶
func (JsonMap) GetJsonValBool ¶
func (JsonMap) GetJsonValInt64 ¶
func (JsonMap) GetJsonValString ¶
func (JsonMap) GetJsonValStringE ¶
func (JsonMap) GetJsonValStringOrDefault ¶
Click to show internal directories.
Click to hide internal directories.