add transport codec

This commit is contained in:
Asim Aslam
2016-12-06 18:56:57 +00:00
parent bd3c798fd9
commit 49e5636bcd
4 changed files with 80 additions and 0 deletions

10
transport/codec/codec.go Normal file
View File

@@ -0,0 +1,10 @@
package codec
// Codec is used for encoding where the transport doesn't natively support
// headers in the message type. In this case the entire message is
// encoded as the payload
type Codec interface {
Marshal(interface{}) ([]byte, error)
Unmarshal([]byte, interface{}) error
String() string
}