Versions in this module Expand all Collapse all v1 v1.1.0 Jul 15, 2022 v1.0.0 Jun 19, 2022 v0 v0.6.0 Dec 15, 2021 Changes in this version + var AllowFastAppends = true + var Base64Prefix = "base64," + var DecimalExpDelim = byte('x') + var DecimalExpDelimStr = "x" + var ErrUnseal = errors.New("unseal error") + var False = boolValue(false) + var FirstIndexKey = 0 + var PrecisionLevel = 0.00001 + var True = boolValue(true) + var UnknownPrefix = "data:application/x-msgpack-ext;" + var ValueClass = reflect.TypeOf((*Value)(nil)).Elem() + func Equal(left Value, right Value) bool + func Hash(val Value, hash crypto.Hash) ([]byte, error) + func Hex(val Value) string + func Jsonify(val Value) string + 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 PackStruct(obj interface{}) ([]byte, error) + func ParseBoolean(str string) boolValue + func ParseStruct(unpacker Unpacker, parser Parser, value reflect.Value, schema *Schema) error + func ReadStream(r io.Reader, out chan<- Value) error + func Seal(val Value, recipientPublicKey, senderPrivateKey *[32]byte) ([]byte, error) + func Unknown(tagAndData []byte) unknownValue + func UnpackBigInt(data []byte) (*big.Int, error) + func UnpackDecimal(data []byte) (decimal.Decimal, error) + func UnpackStruct(buf []byte, obj interface{}, copy bool) error + func Write(w io.Writer, val Value) error + func WriteStream(w io.Writer, valueC <-chan Value) error + type Bool interface + Boolean func() bool + func Boolean(b bool) Bool + type Collection interface + Entries func() []MapEntry + Len func() int + type Ext byte + const BigIntExt + const DecimalExt + const MaxExt + const UnknownExt + type Extension interface + Native func() []byte + type Field struct + Array bool + FieldName string + FieldNum int + FieldSchema *Schema + FieldType reflect.Type + Repeated bool + Struct bool + Tag int + type Format int + const BinHeader + const BoolToken + const DoubleToken + const EOF + const ExtHeader + const FixExtToken + const ListHeader + const LongToken + const MapHeader + const NilToken + const StrHeader + const UnexpectedEOF + type Kind int + const BOOL + const INVALID + const LIST + const MAP + const NUMBER + const STRING + const UNKNOWN + func (k Kind) String() string + type List interface + Append func(Value) List + DeleteAll func(int) List + GetAt func(int) Value + GetBoolAt func(int) Bool + GetListAt func(int) List + GetMapAt func(int) Map + GetNumberAt func(int) Number + GetStringAt func(int) String + InsertAll func(int, []Value) List + InsertAt func(int, Value) List + Items func() []ListItem + PutAt func(int, Value) List + RemoveAt func(int) List + Select func(int) []Value + Values func() []Value + func EmptyList() List + func EmptySparseList() List + func Single(value Value) List + func SolidList(list []Value) List + func SortedSparseList(items []ListItem) List + func SparseList(items []ListItem, sortedItems bool) List + func SparseListOf(list []Value) List + func Tuple(values ...Value) List + type ListItem interface + Equal func(ListItem) bool + Key func() int + Value func() Value + func Item(key int, value Value) ListItem + type Map interface + DeleteAll func(string) Map + Get func(string) (Value, bool) + GetBool func(string) Bool + GetList func(string) List + GetMap func(string) Map + GetNumber func(string) Number + GetString func(string) String + HashMap func() map[string]Value + Insert func(key string, value Value) Map + InsertAll func(string, []Value) Map + Keys func() []string + Put func(key string, value Value) Map + Remove func(string) Map + Select func(string) []Value + Values func() []Value + func EmptyMap() Map + func SortedMap(entries []MapEntry, sortedEntries bool) Map + type MapEntry interface + Equal func(MapEntry) bool + Key func() string + Value func() Value + func Entry(key string, value Value) MapEntry + type Number interface + Add func(Number) Number + BigInt func() *big.Int + Decimal func() decimal.Decimal + Double func() float64 + IsNaN func() bool + Long func() int64 + Subtract func(Number) Number + Type func() NumberType + func BigInt(val *big.Int) Number + func Decimal(dec decimal.Decimal) Number + func Double(val float64) Number + func Long(val int64) Number + func Nan() Number + func ParseNumber(str string) Number + type NumberType int + const BIGINT + const DECIMAL + const DOUBLE + const InvalidNumber + const LONG + func (t NumberType) String() string + type Packer interface + Error func() error + PackBin func([]byte) + PackBool func(bool) + PackDouble func(float64) + PackExt func(xtag Ext, data []byte) + PackList func(int) + PackLong func(int64) + PackMap func(int) + PackNil func() + PackRaw func([]byte) + PackStr func(string) + type Parser interface + Error func() error + ParseBin func([]byte) int + ParseBool func([]byte) bool + ParseDouble func([]byte) float64 + ParseExt func([]byte) (int, []byte) + ParseList func([]byte) int + ParseLong func([]byte) int64 + ParseMap func([]byte) int + ParseStr func([]byte) int + type Schema struct + Fields map[int]*Field + SortedFields []*Field + type String interface + Len func() int + Raw func() []byte + Type func() StringType + Utf8 func() string + func ParseString(str string) String + func Raw(val []byte, copyFlag bool) String + func Stringf(format string, args ...interface{}) String + func Utf8(val string) String + type StringType int + const InvalidString + const RAW + const UTF8 + func (t StringType) String() string + type Unpacker interface + Next func() (Format, []byte) + Read func(int) ([]byte, error) + type Value interface + Class func() reflect.Type + Equal func(Value) bool + Kind func() Kind + Object func() interface{} + Pack func(Packer) + PrintJSON func(out *strings.Builder) + func Parse(unpacker Unpacker, parser Parser) (Value, error) + func Read(r io.Reader) (Value, error) + func Unpack(buf []byte, copy bool) (Value, error) + func Unseal(encrypted []byte, senderPublicKey, recipientPrivateKey *[32]byte) (Value, error) + type Writer interface + WriteArrayHeader func(len int) []byte + WriteBinHeader func(len int) []byte + WriteBool func(val bool) []byte + WriteDouble func(val float64) []byte + WriteExtHeader func(len int, xtag byte) []byte + WriteLong func(val int64) []byte + WriteMapHeader func(len int) []byte + WriteNil func() []byte + WriteStrHeader func(len int) []byte