# README
qiniupkg.com/x/dyn/jsonext.v1
这个包扩展了 json 的文法,增加变量的支持。变量的形式有两种:
$(...)
${...}
样例:
{
"a": $(a),
"b": {
"c": ${b.c},
"e": $(e)
},
"f": ${f}
}
这段 json 文本进行 Unmarshal 后变量的数据类型成为:
- qiniupkg.com/x/dyn/proto.v1.Var
而 Var 类型的变量 Marshal 后又变回 $(...) 字符串。像上面的 json 文本进行 Unmarshal 再 Marshal 得到的结果会是:
{"a":$(a),"b":{"c":$(b.c),"e":$(e)},"f":$(f)}
# Functions
Compact appends to dst the JSON-encoded src with insignificant space characters elided.
HTMLEscape appends to dst the JSON-encoded src with <, >, &, U+2028 and U+2029 characters inside string literals changed to \u003c, \u003e, \u0026, \u2028, \u2029 so that the JSON will be safe to embed inside HTML <script> tags.
Indent appends to dst an indented form of the JSON-encoded src.
Marshal returns the JSON encoding of v.
MarshalIndent is like Marshal but applies Indent to format the output.
No description provided by the author
No description provided by the author
NewDecoder returns a new decoder that reads from r.
NewEncoder returns a new encoder that writes to w.
Unmarshal parses the JSON-encoded data and stores the result in the value pointed to by v.
No description provided by the author
# Structs
A Decoder reads and decodes JSON objects from an input stream.
An Encoder writes JSON objects to an output stream.
An InvalidUnmarshalError describes an invalid argument passed to Unmarshal.
Before Go 1.2, an InvalidUTF8Error was returned by Marshal when attempting to encode a string value with invalid UTF-8 sequences.
No description provided by the author
A SyntaxError is a description of a JSON syntax error.
An UnmarshalFieldError describes a JSON object key that led to an unexported (and therefore unwritable) struct field.
An UnmarshalTypeError describes a JSON value that was not appropriate for a value of a specific Go type.
An UnsupportedTypeError is returned by Marshal when attempting to encode an unsupported value type.
No description provided by the author
# Interfaces
Marshaler is the interface implemented by objects that can marshal themselves into valid JSON.
Unmarshaler is the interface implemented by objects that can unmarshal a JSON description of themselves.
# Type aliases
A Number represents a JSON number literal.
RawMessage is a raw encoded JSON object.