terraform/vendor/github.com/vmihailenco/msgpack
Martin Atkins 1bb79696c6 vendor: update to latest github.com/zclconf/go-cty
This includes a bugfix to the cty/msgpack package to ensure correct
decoding of unknown and null values.

This also includes updates to cty's dependencies.
2018-10-16 19:14:11 -07:00
..
codes
.travis.yml vendor: update to latest github.com/zclconf/go-cty 2018-10-16 19:14:11 -07:00
CHANGELOG.md vendor: update to latest github.com/zclconf/go-cty 2018-10-16 19:14:11 -07:00
LICENSE
Makefile
README.md
appengine.go vendor: update to latest github.com/zclconf/go-cty 2018-10-16 19:14:11 -07:00
decode.go vendor: update to latest github.com/zclconf/go-cty 2018-10-16 19:14:11 -07:00
decode_map.go vendor: update to latest github.com/zclconf/go-cty 2018-10-16 19:14:11 -07:00
decode_number.go
decode_query.go vendor: update to latest github.com/zclconf/go-cty 2018-10-16 19:14:11 -07:00
decode_slice.go vendor: update to latest github.com/zclconf/go-cty 2018-10-16 19:14:11 -07:00
decode_string.go
decode_value.go vendor: update to latest github.com/zclconf/go-cty 2018-10-16 19:14:11 -07:00
encode.go vendor: update to latest github.com/zclconf/go-cty 2018-10-16 19:14:11 -07:00
encode_map.go vendor: update to latest github.com/zclconf/go-cty 2018-10-16 19:14:11 -07:00
encode_number.go vendor: update to latest github.com/zclconf/go-cty 2018-10-16 19:14:11 -07:00
encode_slice.go vendor: update to latest github.com/zclconf/go-cty 2018-10-16 19:14:11 -07:00
encode_value.go vendor: update to latest github.com/zclconf/go-cty 2018-10-16 19:14:11 -07:00
ext.go vendor: update to latest github.com/zclconf/go-cty 2018-10-16 19:14:11 -07:00
msgpack.go
tag.go
time.go
types.go

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