https://github.com/coder543/msgpack
easier, faster, but extendable MessagePack Serializer for Golang. / msgpack.org[Go]
https://github.com/coder543/msgpack
Last synced: 5 months ago
JSON representation
easier, faster, but extendable MessagePack Serializer for Golang. / msgpack.org[Go]
- Host: GitHub
- URL: https://github.com/coder543/msgpack
- Owner: coder543
- License: mit
- Fork: true (shamaton/msgpack)
- Created: 2021-10-26T03:25:20.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-11-03T18:16:57.000Z (over 4 years ago)
- Last Synced: 2024-06-20T06:39:01.862Z (almost 2 years ago)
- Homepage:
- Size: 302 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MessagePack for Golang
[](https://pkg.go.dev/github.com/shamaton/msgpack)

[](https://goreportcard.com/report/github.com/shamaton/msgpack)
[](https://codecov.io/gh/shamaton/msgpack)
[](https://app.fossa.com/projects/git%2Bgithub.com%2Fshamaton%2Fmsgpack?ref=badge_shield)
## 📣 Notice
If your application serializes only primitive types, array, map and struct, code generation is also recommended.
You can get the fastest performance with [msgpackgen](https://github.com/shamaton/msgpackgen).
## Features
* Supported types : primitive / array / slice / struct / map / interface{} and time.Time
* Renaming fields via `msgpack:"field_name"`
* Omitting fields via `msgpack:"-"`
* Supports extend encoder / decoder
* Can also Encoding / Decoding struct as array
This package requires more than version **1.13**
## Installation
Current version is **msgpack/v2**.
```sh
go get -u github.com/shamaton/msgpack/v2
```
## Quick Start
```go
package main
import (
"github.com/shamaton/msgpack/v2"
)
func main() {
type Struct struct {
String string
}
v := Struct{String: "msgpack"}
d, err := msgpack.Marshal(v)
if err != nil {
panic(err)
}
r := Struct{}
err = msgpack.Unmarshal(d, &r)
if err != nil {
panic(err)
}
}
```
## Benchmark
This result made from [shamaton/msgpack_bench](https://github.com/shamaton/msgpack_bench)

## License
This library is under the MIT License.