GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - anmic/msgpack: MessagePack encoding for Golang

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

147 Commits
147 Commits

Folders and files

NameName
Last commit message
Last commit date
codes
codes
 
 
.travis.yml
.travis.yml
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
appengine.go
appengine.go
 
 
decode.go
decode.go
 
 
decode_number.go
decode_number.go
 
 
encode.go
encode.go
 
 
encode_number.go
encode_number.go
 
 
example_CustomEncoder_test.go
example_CustomEncoder_test.go
 
 
example_test.go
example_test.go
 
 
ext.go
ext.go
 
 
ext_test.go
ext_test.go
 
 
map.go
map.go
 
 
msgpack.go
msgpack.go
 
 
msgpack_test.go
msgpack_test.go
 
 
slice.go
slice.go
 
 
tags.go
tags.go
 
 
time.go
time.go
 
 
typeinfo.go
typeinfo.go
 
 
types_test.go
types_test.go
 
 

Repository files navigation

MessagePack encoding for Golang Build Status

Supports:

  • Primitives, arrays, maps, structs, time.Time and interface{}.
  • Appengine *datastore.Key and datastore.Cursor.
  • CustomEncoder/CustomDecoder interfaces for custom encoding.
  • Extensions to encode type information.
  • Fields renaming, e.g. msgpack:"my_field_name".
  • Structs inlining, e.g. msgpack:",inline".
  • Omitempty flag, e.g. msgpack:",omitempty".

API docs: http://godoc.org/gopkg.in/vmihailenco/msgpack.v2. Examples: http://godoc.org/gopkg.in/vmihailenco/msgpack.v2#pkg-examples.

Installation

Install:

go get gopkg.in/vmihailenco/msgpack.v2

Quickstart

func ExampleMarshal() {
	b, err := msgpack.Marshal(true)
	if err != nil {
		panic(err)
	}
	fmt.Printf("%#v\n", b)
	// Output:

	var out bool
	err = msgpack.Unmarshal([]byte{0xc3}, &out)
	if err != nil {
		panic(err)
	}
	fmt.Println(out)
	// Output: []byte{0xc3}
	// true
}

Benchmark

BenchmarkStruct-4               	  200000	     11515 ns/op	    3296 B/op	      27 allocs/op
BenchmarkStructUgorjiGoMsgpack-4	  100000	     12234 ns/op	    3840 B/op	      70 allocs/op
BenchmarkStructUgorjiGoCodec-4  	  100000	     15251 ns/op	    7474 B/op	      29 allocs/op
BenchmarkStructJSON-4           	   30000	     50851 ns/op	    8088 B/op	      29 allocs/op
BenchmarkStructGOB-4            	   20000	     64993 ns/op	   15609 B/op	     299 allocs/op

Howto

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

About

MessagePack encoding for Golang

godoc.org/gopkg.in/vmihailenco/msgpack.v2#pkg-examples

Resources

Readme
BSD-3-Clause license
Activity

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.