experimental codec branch

This commit is contained in:
Asim
2015-11-27 00:17:36 +00:00
parent dc5f121c64
commit f49922f6b3
10 changed files with 183 additions and 57 deletions

23
codec/bson/bson.go Normal file
View File

@@ -0,0 +1,23 @@
package bson
import (
"labix.org/v2/mgo/bson"
)
var (
Codec = bsonCodec{}
)
type bsonCodec struct {}
func (bsonCodec) Marshal(v interface{}) ([]byte, error) {
return bson.Marshal(v)
}
func (bsonCodec) Unmarshal(data []byte, v interface{}) error {
return bson.Unmarshal(data, v)
}
func (bsonCodec) String() string {
return "bson"
}