You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Captain Dero 9687ad9cb4 Derosuite Status Update Release 2 6 years ago
..
codes Derosuite Status Update Release 2 6 years ago
.travis.yml Derosuite Status Update Release 2 6 years ago
CHANGELOG.md Derosuite Status Update Release 2 6 years ago
LICENSE Derosuite Status Update Release 2 6 years ago
Makefile Derosuite Status Update Release 2 6 years ago
README.md Derosuite Status Update Release 2 6 years ago
appengine.go Derosuite Status Update Release 2 6 years ago
bench_test.go Derosuite Status Update Release 2 6 years ago
decode.go Derosuite Status Update Release 2 6 years ago
decode_map.go Derosuite Status Update Release 2 6 years ago
decode_number.go Derosuite Status Update Release 2 6 years ago
decode_query.go Derosuite Status Update Release 2 6 years ago
decode_slice.go Derosuite Status Update Release 2 6 years ago
decode_string.go Derosuite Status Update Release 2 6 years ago
decode_value.go Derosuite Status Update Release 2 6 years ago
encode.go Derosuite Status Update Release 2 6 years ago
encode_map.go Derosuite Status Update Release 2 6 years ago
encode_number.go Derosuite Status Update Release 2 6 years ago
encode_slice.go Derosuite Status Update Release 2 6 years ago
encode_value.go Derosuite Status Update Release 2 6 years ago
example_CustomEncoder_test.go Derosuite Status Update Release 2 6 years ago
example_registerExt_test.go Derosuite Status Update Release 2 6 years ago
example_test.go Derosuite Status Update Release 2 6 years ago
ext.go Derosuite Status Update Release 2 6 years ago
ext_test.go Derosuite Status Update Release 2 6 years ago
msgpack.go Derosuite Status Update Release 2 6 years ago
msgpack_test.go Derosuite Status Update Release 2 6 years ago
tag.go Derosuite Status Update Release 2 6 years ago
time.go Derosuite Status Update Release 2 6 years ago
types.go Derosuite Status Update Release 2 6 years ago
types_test.go Derosuite Status Update Release 2 6 years ago

README.md

MessagePack encoding for Golang

Build Status GoDoc

Supports:

API docs: https://godoc.org/github.com/vmihailenco/msgpack. Examples: https://godoc.org/github.com/vmihailenco/msgpack#pkg-examples.

Installation

Install:

go get -u github.com/vmihailenco/msgpack

Quickstart

func ExampleMarshal() {
	type Item struct {
		Foo string
	}

	b, err := msgpack.Marshal(&Item{Foo: "bar"})
	if err != nil {
		panic(err)
	}

	var item Item
	err = msgpack.Unmarshal(b, &item)
	if err != nil {
		panic(err)
	}
	fmt.Println(item.Foo)
	// Output: bar
}

Benchmark

BenchmarkStructVmihailencoMsgpack-4   	  200000	     12814 ns/op	    2128 B/op	      26 allocs/op
BenchmarkStructUgorjiGoMsgpack-4      	  100000	     17678 ns/op	    3616 B/op	      70 allocs/op
BenchmarkStructUgorjiGoCodec-4        	  100000	     19053 ns/op	    7346 B/op	      23 allocs/op
BenchmarkStructJSON-4                 	   20000	     69438 ns/op	    7864 B/op	      26 allocs/op
BenchmarkStructGOB-4                  	   10000	    104331 ns/op	   14664 B/op	     278 allocs/op

Howto

Please go through examples to get an idea how to use this package.

See also