Help us shape the future of Go! Take the 2026 Go Developer Survey

bsonex

package module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 1, 2020 License: MIT Imports: 13 Imported by: 1

README

bsonex

fast and easy to use bson package.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(in interface{}) (out []byte, err error)

func NewEncoder

func NewEncoder(w io.Writer) *gbson.Encoder

func ReadOne

func ReadOne(r io.Reader) (one []byte, err error)

func Unmarshal

func Unmarshal(in []byte, out interface{}) (err error)

Types

type BSON

type BSON []byte

func (BSON) Lookup

func (b BSON) Lookup(key string) (val Value)

func (BSON) Map

func (b BSON) Map() (m M, err error)

func (BSON) MustToJson

func (b BSON) MustToJson() (s []byte)

func (BSON) String

func (b BSON) String() string

func (BSON) ToJson

func (b BSON) ToJson() (s []byte, err error)

func (BSON) ToValueMap

func (b BSON) ToValueMap() (vals map[string]interface{})

func (BSON) Unmarshal

func (b BSON) Unmarshal(out interface{}) (err error)

type BSONEX

type BSONEX struct {
	BSON
	// contains filtered or unexported fields
}

func (*BSONEX) Offset

func (b *BSONEX) Offset() int64

func (*BSONEX) RunnerID

func (b *BSONEX) RunnerID() int

func (*BSONEX) Size

func (b *BSONEX) Size() int

func (BSONEX) String

func (b BSONEX) String() string

type Binary

type Binary struct {
	gbson.Binary
}

func (Binary) MarshalJSON

func (b Binary) MarshalJSON() (bs []byte, err error)

type Decoder

type Decoder struct {
	// contains filtered or unexported fields
}

func NewDecoder

func NewDecoder(r io.Reader) *Decoder

func (*Decoder) Decode

func (d *Decoder) Decode(v interface{}) (err error)

func (*Decoder) Do

func (d *Decoder) Do(parallel int, f func(b BSONEX) error) (err error)

func (*Decoder) ForEach

func (d *Decoder) ForEach(f func(b BSONEX) error) (err error)

func (*Decoder) ReadOne

func (d *Decoder) ReadOne() (one BSON, err error)

type M

type M map[string]interface{}

type Value

type Value struct {
	// contains filtered or unexported fields
}

func (Value) ArrayOf

func (v Value) ArrayOf(i int) Value

func (Value) Binary

func (v Value) Binary() Binary

func (Value) Bool

func (v Value) Bool() bool

func (Value) DBPointer

func (v Value) DBPointer() gbson.DBPointer

func (Value) Document

func (v Value) Document() BSON

func (Value) Float64

func (v Value) Float64() float64

func (Value) Int32

func (v Value) Int32() int32

func (Value) Int64

func (v Value) Int64() int64

func (Value) IsMaxKey

func (v Value) IsMaxKey() bool

func (Value) IsMinKey

func (v Value) IsMinKey() bool

func (Value) IsNull

func (v Value) IsNull() bool

func (Value) IsUndefined

func (v Value) IsUndefined() bool

func (Value) Kind

func (v Value) Kind() byte

func (Value) MongoTimestamp

func (v Value) MongoTimestamp() gbson.MongoTimestamp

func (Value) Objid

func (v Value) Objid() gbson.ObjectId

func (Value) RawValue

func (v Value) RawValue() []byte

func (Value) Regexp

func (v Value) Regexp() gbson.RegEx

func (Value) Str

func (v Value) Str() string

func (Value) String

func (v Value) String() string

func (Value) Time

func (v Value) Time() time.Time

func (Value) Type

func (v Value) Type() byte

func (Value) Uint32

func (v Value) Uint32() uint32

func (Value) Uint64

func (v Value) Uint64() uint64

func (Value) Value

func (v Value) Value() interface{}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL