github.com/abemedia/go-don@v0.2.2-0.20240329015135-be88e32bb73b/encoding/msgpack/msgpack.go (about)

     1  // Package msgpack provides encoding and decoding of MessagePack data.
     2  package msgpack
     3  
     4  import (
     5  	"github.com/abemedia/go-don/encoding"
     6  	"github.com/vmihailenco/msgpack/v5"
     7  )
     8  
     9  func init() {
    10  	mediaType := "application/msgpack"
    11  	aliases := []string{"application/x-msgpack", "application/vnd.msgpack"}
    12  
    13  	encoding.RegisterDecoder(msgpack.Unmarshal, mediaType, aliases...)
    14  	encoding.RegisterEncoder(msgpack.Marshal, mediaType, aliases...)
    15  }