mirror of
https://github.com/eosswedenorg/thalos
synced 2026-06-17 04:30:03 +02:00
Adding api/message/msgpack
This commit is contained in:
parent
f3900bc262
commit
2e8c228076
5 changed files with 432 additions and 0 deletions
18
api/message/msgpack/codec.go
Normal file
18
api/message/msgpack/codec.go
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
package msgpack
|
||||
|
||||
import (
|
||||
"github.com/shamaton/msgpack/v2"
|
||||
|
||||
"github.com/eosswedenorg/thalos/api/message"
|
||||
)
|
||||
|
||||
//go:generate go run github.com/shamaton/msgpackgen -v -input-file ../types.go -output-file msgpack.go
|
||||
|
||||
func init() {
|
||||
RegisterGeneratedResolver()
|
||||
|
||||
message.RegisterCodec("msgpack", message.Codec{
|
||||
Encoder: msgpack.Marshal,
|
||||
Decoder: msgpack.Unmarshal,
|
||||
})
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue