You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gojobs/vendor/github.com/vmihailenco/msgpack/v5
李光春 7cf8704ec8
- update model
2 years ago
..
msgpcode - update model 2 years ago
.prettierrc - update model 2 years ago
.travis.yml - update model 2 years ago
CHANGELOG.md - update model 2 years ago
LICENSE - update model 2 years ago
Makefile - update model 2 years ago
README.md - update model 2 years ago
commitlint.config.js - update model 2 years ago
decode.go - update model 2 years ago
decode_map.go - update model 2 years ago
decode_number.go - update model 2 years ago
decode_query.go - update model 2 years ago
decode_slice.go - update model 2 years ago
decode_string.go - update model 2 years ago
decode_value.go - update model 2 years ago
encode.go - update model 2 years ago
encode_map.go - update model 2 years ago
encode_number.go - update model 2 years ago
encode_slice.go - update model 2 years ago
encode_value.go - update model 2 years ago
ext.go - update model 2 years ago
intern.go - update model 2 years ago
msgpack.go - update model 2 years ago
package.json - update model 2 years ago
safe.go - update model 2 years ago
time.go - update model 2 years ago
types.go - update model 2 years ago
unsafe.go - update model 2 years ago
version.go - update model 2 years ago

README.md

MessagePack encoding for Golang

Build Status PkgGoDev Documentation Chat

❤️ Uptrace.dev - All-in-one tool to optimize performance and monitor errors & logs

Other projects you may like:

  • Bun - fast and simple SQL client for PostgreSQL, MySQL, and SQLite.
  • BunRouter - fast and flexible HTTP router for Go.

Features

Installation

msgpack supports 2 last Go versions and requires support for Go modules. So make sure to initialize a Go module:

go mod init github.com/my/repo

And then install msgpack/v5 (note v5 in the import; omitting it is a popular mistake):

go get github.com/vmihailenco/msgpack/v5

Quickstart

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

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
}