binarypack

package module
v0.0.0-...-00eb600 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2016 License: MIT Imports: 13 Imported by: 0

README

go-binarypack

BinaryPack is 95% MessagePack. The protocol has been extended to support distinct string and binary types. Also used by binaryjs/node-binarypack.

Documentation

Overview

Package binarypack implements the BinaryPack protocol, which is 95% msgpack.

BinaryPack is derived from MsgPack, used in the Binary.js implementation at https://github.com/binaryjs. It's modified to pack data more in line with the JSON serialization format.

Index

Constants

View Source
const (
	FixMap      = 0x80
	FixArray    = 0x90
	FixRaw      = 0xa0
	FixString   = 0xb0
	Nil         = 0xc0
	Undefined   = 0xc1
	False       = 0xc2
	True        = 0xc3
	Float32     = 0xca
	Float64     = 0xcb
	Uint8       = 0xcc
	Uint16      = 0xcd
	Uint32      = 0xce
	Uint64      = 0xcf
	Int8        = 0xd0
	Int16       = 0xd1
	Int32       = 0xd2
	Int64       = 0xd3
	UndefinedD4 = 0xd4
	UndefinedD5 = 0xd5
	UndefinedD6 = 0xd6
	UndefinedD7 = 0xd7
	String16    = 0xd8
	String32    = 0xd9
	Raw16       = 0xda
	Raw32       = 0xdb
	Array16     = 0xdc
	Array32     = 0xdd
	Map16       = 0xde
	Map32       = 0xdf
	FixNeg      = 0xe0
)

Variables

This section is empty.

Functions

func Marshal

func Marshal(v ...interface{}) ([]byte, error)

func Unmarshal

func Unmarshal(b []byte, v ...interface{}) error

Types

type Marshaler

type Marshaler interface {
	MarshalBinaryPack() ([]byte, error)
}

Marshaler is the interface implemented by objects that can newPtrEncoder(t reflect.Type) encoderFunc {/arshal themselves into valid BinaryPack.

type MarshalerError

type MarshalerError struct {
	Type reflect.Type
	Err  error
}

func (*MarshalerError) Error

func (e *MarshalerError) Error() string

type UnsupportedTypeError

type UnsupportedTypeError struct {
	Type reflect.Type
}

func (*UnsupportedTypeError) Error

func (e *UnsupportedTypeError) Error() string

type UnsupportedValueError

type UnsupportedValueError struct {
	Value  reflect.Value
	String string
}

func (*UnsupportedValueError) Error

func (e *UnsupportedValueError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL