Documentation ¶
Overview ¶
Package jsongen forked from darjun/json-gen
Index ¶
- type Array
- func (a *Array) AppendArray(oa Array)
- func (a *Array) AppendBool(b bool)
- func (a *Array) AppendBoolArray(b []bool)
- func (a *Array) AppendFloat(f float64)
- func (a *Array) AppendFloatArray(f []float64)
- func (a *Array) AppendInt(i int64)
- func (a *Array) AppendIntArray(i []int64)
- func (a *Array) AppendMap(m *Map)
- func (a *Array) AppendMapArray(m []Map)
- func (a *Array) AppendRawBytes(b []byte)
- func (a *Array) AppendRawBytesArray(bs [][]byte)
- func (a *Array) AppendRawString(s string)
- func (a *Array) AppendRawStringArray(ss []string)
- func (a *Array) AppendString(value string)
- func (a *Array) AppendStringArray(s []string)
- func (a *Array) AppendUint(u uint64)
- func (a *Array) AppendUintArray(u []uint64)
- func (a Array) Serialize(buf []byte) []byte
- func (a Array) Size() int
- type Map
- func (m *Map) PutArray(key string, a *Array)
- func (m *Map) PutBool(key string, b bool)
- func (m *Map) PutBoolArray(key string, b []bool)
- func (m *Map) PutFloat(key string, f float64)
- func (m *Map) PutFloatArray(key string, f []float64)
- func (m *Map) PutInt(key string, i int64)
- func (m *Map) PutIntArray(key string, i []int64)
- func (m *Map) PutMap(key string, om *Map)
- func (m *Map) PutRawBytes(key string, b []byte)
- func (m *Map) PutRawBytesArray(key string, bs [][]byte)
- func (m *Map) PutRawString(key, s string)
- func (m *Map) PutRawStringArray(key string, ss []string)
- func (m *Map) PutString(key, value string)
- func (m *Map) PutStringArray(key string, s []string)
- func (m *Map) PutUint(key string, u uint64)
- func (m *Map) PutUintArray(key string, u []uint64)
- func (m Map) Serialize(buf []byte) []byte
- func (m Map) Size() int
- type QuotedValue
- type RawBytes
- type RawString
- type UnquotedValue
- type Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Array ¶
type Array []Value
Array 表示一个`json`数组
func (*Array) AppendArray ¶
AppendArray 将`json`数组`oa`追加到数组`a`后
func (*Array) AppendBoolArray ¶
AppendBoolArray 将`bool`数组`b`追加到数组`a`后
func (*Array) AppendFloat ¶
AppendFloat 将`float64`类型的值`f`追加到数组`a`后
func (*Array) AppendFloatArray ¶
AppendFloatArray 将`float64`数组`f`追加到数组`a`后
func (*Array) AppendIntArray ¶
AppendIntArray 将`int64`数组`i`追加到数组`a`后
func (*Array) AppendMapArray ¶
AppendMapArray 将`Map`数组`m`追加到数组`a`后
func (*Array) AppendRawBytes ¶
func (*Array) AppendRawBytesArray ¶
func (*Array) AppendRawString ¶
func (*Array) AppendRawStringArray ¶
func (*Array) AppendString ¶
AppendString 将`string`类型的值`s`追加到数组`a`后
func (*Array) AppendStringArray ¶
AppendStringArray 将`string`数组`s`追加到数组`a`后
func (*Array) AppendUint ¶
AppendUint 将`uint64`类型的值`u`追加到数组`a`后
func (*Array) AppendUintArray ¶
AppendUintArray 将`uint64`数组`u`追加到数组`a`后
type Map ¶
type Map struct {
// contains filtered or unexported fields
}
Map 表示一个`json`映射
func (*Map) PutBoolArray ¶
PutBoolArray 将`bool`数组类型的值`b`与键`key`关联
func (*Map) PutFloatArray ¶
PutFloatArray 将`float64`数组类型的值`f`与键`key`关联
func (*Map) PutIntArray ¶
PutIntArray 将`int64`数组类型的值`i`与键`key`关联
func (*Map) PutRawBytes ¶
func (*Map) PutRawBytesArray ¶
func (*Map) PutRawString ¶
func (*Map) PutRawStringArray ¶
func (*Map) PutStringArray ¶
PutStringArray 将`string`数组类型的值`s`与键`key`关联
func (*Map) PutUintArray ¶
PutUintArray 将`uint64`数组类型的值`u`与键`key`关联
type QuotedValue ¶
type QuotedValue string
QuotedValue 表示需要用"包裹起来的值,例如字符串
func (QuotedValue) Serialize ¶
func (q QuotedValue) Serialize(buf []byte) []byte
Serialize 将`q`序列化为字符串,追加到`buf`后,返回新的`buf`
type UnquotedValue ¶
type UnquotedValue string
UnquotedValue 表示不需要用"包裹起来的值,例如整数,浮点数等
func (UnquotedValue) Serialize ¶
func (u UnquotedValue) Serialize(buf []byte) []byte
Serialize 将`u`序列化为字符串,追加到`buf`后,返回新的`buf`