BinData is used to hold raw binary blob information for structs that need to support encoding to and from JSON / BSON. The json encoder will hexify this data for transport, while BSON will transform it to a BSON Binary primitive.
type BinData []byte
func (data BinData) MarshalBSONValue() (bsontype.Type, []byte, error)
Marshal bson value.
func (data BinData) MarshalText() ([]byte, error)
Marshal to text value for json and others that implement this interface.
func (data *BinData) UnmarshalBSONValue( valueType bsontype.Type, incomingData []byte, ) error
Unmarshal bson value.
func (data *BinData) UnmarshalText(incomingData []byte) error
UnMarshal from text value for json and others that implement this interface.