Documentation
¶
Index ¶
- Constants
- Variables
- func Expression(str string) *expression
- func Hex(val Value) string
- func Json(val Value) string
- func List() *tableValue
- func Map() *tableValue
- func MessagePacker(w io.Writer) *messagePacker
- func MessageParser() *messageParser
- func MessageReader(r io.Reader) *messageIOUnpacker
- func MessageUnpacker(buf []byte, copy bool) *messageBufUnpacker
- func Pack(val Value) ([]byte, error)
- func ParseBoolean(str string) boolValue
- func ReadStream(r io.Reader, out chan<- Value) error
- func Unknown(tagAndData []byte) unknownValue
- func UnpackBigInt(data []byte) (*big.Int, error)
- func UnpackDecimal(data []byte) (decimal.Decimal, error)
- func Write(w io.Writer, val Value) error
- func WriteStream(w io.Writer, valueC <-chan Value) error
- type Bool
- type Expr
- type Ext
- type Extension
- type Format
- type Kind
- type Number
- type NumberType
- type Packer
- type Parser
- type String
- type StringType
- type Table
- type TableType
- type Unpacker
- type Value
- type Writer
Constants ¶
View Source
const ( InvalidKey keyType = iota INDEX KEY )
View Source
const ( InvalidOp opCode = iota PUT REMOVE )
Variables ¶
View Source
var Base64Prefix = "base64,"
View Source
var DecimalExpDelim = byte('x')
View Source
var DecimalExpDelimStr = "x"
View Source
var FirstIndex = 1
View Source
var InitTableSize = 16
View Source
var PrecisionLevel = 0.00001
View Source
var UnknownPrefix = "data:application/x-msgpack-ext;"
Functions ¶
func Expression ¶
func Expression(str string) *expression
func MessagePacker ¶
func MessageParser ¶
func MessageParser() *messageParser
func MessageReader ¶
func MessageUnpacker ¶
func ParseBoolean ¶
func ParseBoolean(str string) boolValue
Types ¶
type Number ¶
type Number interface {
Value
Type() NumberType
IsNaN() bool
Long() int64
Double() float64
BigInt() *big.Int
Decimal() decimal.Decimal
Add(Number) Number
Subtract(Number) Number
}
func ParseNumber ¶
type NumberType ¶
type NumberType int
const ( InvalidNumber NumberType = iota LONG DOUBLE BIGINT DECIMAL )
func (NumberType) String ¶
func (t NumberType) String() string
type String ¶
type String interface {
Value
Type() StringType
Len() int
Utf8() string
Raw() []byte
}
func ParseString ¶
type StringType ¶
type StringType int
const ( InvalidString StringType = iota UTF8 RAW )
func (StringType) String ¶
func (t StringType) String() string
type Table ¶
type Table interface {
Value
Type() TableType
Get(string) Value
GetTable(string) Table
GetBool(string) Bool
GetNumber(string) Number
GetString(string) String
GetAt(int) Value
GetTableAt(int) Table
GetBoolAt(int) Bool
GetNumberAt(int) Number
GetStringAt(int) String
GetExp(Expr) Value
GetTableExp(Expr) Table
GetBoolExp(Expr) Bool
GetNumberExp(Expr) Number
GetStringExp(Expr) String
Insert(Value)
Put(key string, value Value)
PutAt(index int, value Value)
PutExp(exp Expr, value Value)
Remove(string)
RemoveAt(int)
RemoveExp(Expr)
Map() map[string]Value
List() []Value
Keys() []string
Indexes() []int
MaxIndex() int
Size() int
Clear()
Compact()
Sort()
Version() uint64
SetVersion(uint64)
}
type Value ¶
Click to show internal directories.
Click to hide internal directories.