style(go-pkg): rename pkg

This commit is contained in:
pyihe
2022-03-04 17:24:23 +08:00
parent 520fd7269b
commit cd80673d8b
61 changed files with 751 additions and 1006 deletions

17
serialize/msgpack.go Normal file
View File

@@ -0,0 +1,17 @@
package serialize
import "github.com/vmihailenco/msgpack/v5"
type msgPack struct{}
func Msgpack() Serializer {
return msgPack{}
}
func (mp msgPack) Encode(v interface{}) (data []byte, err error) {
return msgpack.Marshal(v)
}
func (mp msgPack) Decode(data []byte, v interface{}) error {
return msgpack.Unmarshal(data, v)
}