The Go source code uses msgpack-go for the MessagePack encoding.
const Pi = 3.141592
type E int // or int64 if the ordinal exceeds 32 bit
const (
This E = 1 // 'EThis' for scoped enums
That E = 2 // 'EThat' for scoped enums
)
func (e E) EncodeMsgpack(w *msgpack.Writer) error { ... }
func (e *E) DecodeMsgpack(r *msgpack.Reader) error { ... }
type S struct {
Foo int
Bar float32
}
func (s *S) EncodeMsgpack(w *msgpack.Writer) error { ... }
func (s *S) DecodeMsgpack(r *msgpack.Reader) error { ... }
type U struct {
Value interface{} // has to be type asserted
}
func (u U) EncodeMsgpack(w *msgpack.Writer) error { ... }
func (u *U) DecodeMsgpack(r *msgpack.Reader) error { ... }