Documentation ¶
Overview ¶
Package bsonenc support encoding and decoding by bson.
Index ¶
- Variables
- func Marshal(v interface{}) ([]byte, error)
- func MergeBSONM(a bson.M, b ...bson.M) bson.M
- func NewHintedDoc(h hint.Hint) bson.M
- func Unmarshal(b []byte, v interface{}) error
- type BSONDecodable
- type Encoder
- func (enc *Encoder) Add(d encoder.DecodeDetail) error
- func (enc *Encoder) AddHinter(hr hint.Hinter) error
- func (enc *Encoder) Decode(b []byte) (interface{}, error)
- func (enc *Encoder) DecodeSlice(b []byte) ([]interface{}, error)
- func (enc *Encoder) DecodeWithFixedHintType(s string, size int) (interface{}, error)
- func (enc *Encoder) DecodeWithHint(b []byte, ht hint.Hint) (interface{}, error)
- func (enc *Encoder) DecodeWithHintType(b []byte, t hint.Type) (interface{}, error)
- func (*Encoder) Hint() hint.Hint
- func (*Encoder) Marshal(v interface{}) ([]byte, error)
- func (enc *Encoder) SetPool(pool util.ObjectPool) *Encoder
- func (*Encoder) StreamDecoder(r io.Reader) util.StreamDecoder
- func (*Encoder) StreamEncoder(w io.Writer) util.StreamEncoder
- func (*Encoder) Unmarshal(b []byte, v interface{}) error
- type HintedHead
Constants ¶
This section is empty.
Variables ¶
View Source
var BSONEncoderHint = hint.MustNewHint("bson-encoder-v2.0.0")
Functions ¶
Types ¶
type BSONDecodable ¶
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
func NewEncoder ¶
func NewEncoder() *Encoder
func (*Encoder) DecodeSlice ¶
func (*Encoder) DecodeWithFixedHintType ¶
func (*Encoder) DecodeWithHint ¶
func (*Encoder) DecodeWithHintType ¶
func (*Encoder) StreamDecoder ¶
func (*Encoder) StreamDecoder(r io.Reader) util.StreamDecoder
func (*Encoder) StreamEncoder ¶
func (*Encoder) StreamEncoder(w io.Writer) util.StreamEncoder
type HintedHead ¶
type HintedHead struct {
H string `bson:"_hint"`
}
Click to show internal directories.
Click to hide internal directories.