terraform-provider-gitea/vendor/github.com/vmihailenco/msgpack/v4
Malar Invention 00ebcd295e add vendor
2022-04-03 09:37:16 +05:30
..
codes add vendor 2022-04-03 09:37:16 +05:30
.golangci.yml add vendor 2022-04-03 09:37:16 +05:30
.travis.yml add vendor 2022-04-03 09:37:16 +05:30
appengine.go add vendor 2022-04-03 09:37:16 +05:30
CHANGELOG.md add vendor 2022-04-03 09:37:16 +05:30
decode_map.go add vendor 2022-04-03 09:37:16 +05:30
decode_number.go add vendor 2022-04-03 09:37:16 +05:30
decode_query.go add vendor 2022-04-03 09:37:16 +05:30
decode_slice.go add vendor 2022-04-03 09:37:16 +05:30
decode_string.go add vendor 2022-04-03 09:37:16 +05:30
decode_value.go add vendor 2022-04-03 09:37:16 +05:30
decode.go add vendor 2022-04-03 09:37:16 +05:30
encode_map.go add vendor 2022-04-03 09:37:16 +05:30
encode_number.go add vendor 2022-04-03 09:37:16 +05:30
encode_slice.go add vendor 2022-04-03 09:37:16 +05:30
encode_value.go add vendor 2022-04-03 09:37:16 +05:30
encode.go add vendor 2022-04-03 09:37:16 +05:30
ext.go add vendor 2022-04-03 09:37:16 +05:30
intern.go add vendor 2022-04-03 09:37:16 +05:30
LICENSE add vendor 2022-04-03 09:37:16 +05:30
Makefile add vendor 2022-04-03 09:37:16 +05:30
msgpack.go add vendor 2022-04-03 09:37:16 +05:30
README.md add vendor 2022-04-03 09:37:16 +05:30
safe.go add vendor 2022-04-03 09:37:16 +05:30
time.go add vendor 2022-04-03 09:37:16 +05:30
types.go add vendor 2022-04-03 09:37:16 +05:30
unsafe.go add vendor 2022-04-03 09:37:16 +05:30

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

This project uses Go Modules and semantic import versioning since v4:

go mod init github.com/my/repo
go get github.com/vmihailenco/msgpack/v4

Quickstart

import "github.com/vmihailenco/msgpack/v4"

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