MessagePack encoding for Golang
msgpack is brought to you by ⭐ uptrace/uptrace. Uptrace is an open source APM and blazingly fast distributed tracing tool powered by OpenTelemetry and ClickHouse. Give it a star as well!
Resources
Features
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.
Renaming fields via
msgpack:"my_field_name"and alias viamsgpack:"alias:another_name".Omitting individual empty fields via
msgpack:",omitempty"tag or all empty fields in a struct.Encoding/decoding all structs as arrays or individual structs.
Encoder.SetCustomStructTag with Decoder.SetCustomStructTag can turn msgpack into drop-in replacement for any tag.
Simple but very fast and efficient queries.
Installation
msgpack supports 2 last Go versions and requires support for Go modules. So make sure to initialize a Go module:
And then install msgpack/v5 (note v5 in the import; omitting it is a popular mistake):
Quickstart
See also
Golang ORM for PostgreSQL, MySQL, MSSQL, and SQLite
Contributors
Thanks to all the people who already contributed!
Last updated
Was this helpful?
