Documentation ¶
Overview ¶
Package mgo provides functions and types which allow tracing of the MGO MongoDB client (https://github.com/globalsign/mgo)
Index ¶
- type Bulk
- type Collection
- func (c *Collection) Bulk() *Bulk
- func (c *Collection) Count() (n int, err error)
- func (c *Collection) Create(info *mgo.CollectionInfo) error
- func (c *Collection) DropCollection() error
- func (c *Collection) DropIndex(key ...string) error
- func (c *Collection) DropIndexName(name string) error
- func (c *Collection) EnsureIndex(index mgo.Index) error
- func (c *Collection) EnsureIndexKey(key ...string) error
- func (c *Collection) Find(query interface{}) *Query
- func (c *Collection) FindId(id interface{}) *Query
- func (c *Collection) Indexes() (indexes []mgo.Index, err error)
- func (c *Collection) Insert(docs ...interface{}) error
- func (c *Collection) NewIter(session *mgo.Session, firstBatch []bson.Raw, cursorId int64, err error) *Iter
- func (c *Collection) Pipe(pipeline interface{}) *Pipe
- func (c *Collection) Remove(selector interface{}) error
- func (c *Collection) RemoveAll(selector interface{}) (info *mgo.ChangeInfo, err error)
- func (c *Collection) RemoveId(id interface{}) error
- func (c *Collection) Repair() *Iter
- func (c *Collection) Update(selector interface{}, update interface{}) error
- func (c *Collection) UpdateAll(selector interface{}, update interface{}) (info *mgo.ChangeInfo, err error)
- func (c *Collection) UpdateId(id interface{}, update interface{}) error
- func (c *Collection) Upsert(selector interface{}, update interface{}) (info *mgo.ChangeInfo, err error)
- func (c *Collection) UpsertId(id interface{}, update interface{}) (info *mgo.ChangeInfo, err error)
- type Database
- type DialOption
- type Iter
- type Pipe
- type Query
- func (q *Query) All(result interface{}) error
- func (q *Query) Apply(change mgo.Change, result interface{}) (info *mgo.ChangeInfo, err error)
- func (q *Query) Batch(n int) *Query
- func (q *Query) Collation(collation *mgo.Collation) *Query
- func (q *Query) Comment(comment string) *Query
- func (q *Query) Count() (n int, err error)
- func (q *Query) Distinct(key string, result interface{}) error
- func (q *Query) Explain(result interface{}) error
- func (q *Query) For(result interface{}, f func() error) error
- func (q *Query) Iter() *Iter
- func (q *Query) MapReduce(job *mgo.MapReduce, result interface{}) (info *mgo.MapReduceInfo, err error)
- func (q *Query) One(result interface{}) error
- func (q *Query) Prefetch(p float64) *Query
- func (q *Query) Select(selector interface{}) *Query
- func (q *Query) SetMaxScan(n int) *Query
- func (q *Query) SetMaxTime(d time.Duration) *Query
- func (q *Query) Skip(n int) *Query
- func (q *Query) Snapshot() *Query
- func (q *Query) Sort(fields ...string) *Query
- func (q *Query) Tail(timeout time.Duration) *Iter
- type Session
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collection ¶
type Collection struct { *mgo.Collection // contains filtered or unexported fields }
Collection provides a mgo.Collection along with data used for APM Tracing.
func (*Collection) Bulk ¶
func (c *Collection) Bulk() *Bulk
Bulk creates a trace ready wrapper around Collection.Bulk
func (*Collection) Count ¶
func (c *Collection) Count() (n int, err error)
Count invokes and traces Collection.Count
func (*Collection) Create ¶
func (c *Collection) Create(info *mgo.CollectionInfo) error
Create invokes and traces Collection.Create
func (*Collection) DropCollection ¶
func (c *Collection) DropCollection() error
DropCollection invokes and traces Collection.DropCollection
func (*Collection) DropIndex ¶
func (c *Collection) DropIndex(key ...string) error
DropIndex invokes and traces Collection.DropIndex
func (*Collection) DropIndexName ¶
func (c *Collection) DropIndexName(name string) error
DropIndexName invokes and traces Collection.DropIndexName
func (*Collection) EnsureIndex ¶
func (c *Collection) EnsureIndex(index mgo.Index) error
EnsureIndex invokes and traces Collection.EnsureIndex
func (*Collection) EnsureIndexKey ¶
func (c *Collection) EnsureIndexKey(key ...string) error
EnsureIndexKey invokes and traces Collection.EnsureIndexKey
func (*Collection) Find ¶
func (c *Collection) Find(query interface{}) *Query
Find invokes and traces Collection.Find
func (*Collection) FindId ¶
func (c *Collection) FindId(id interface{}) *Query
FindId invokes and traces Collection.FindId
func (*Collection) Indexes ¶
func (c *Collection) Indexes() (indexes []mgo.Index, err error)
Indexes invokes and traces Collection.Indexes
func (*Collection) Insert ¶
func (c *Collection) Insert(docs ...interface{}) error
Insert invokes and traces Collectin.Insert
func (*Collection) NewIter ¶
func (c *Collection) NewIter(session *mgo.Session, firstBatch []bson.Raw, cursorId int64, err error) *Iter
NewIter invokes and traces Collection.Iter
func (*Collection) Pipe ¶
func (c *Collection) Pipe(pipeline interface{}) *Pipe
Pipe invokes and traces Collection.Pipe
func (*Collection) Remove ¶
func (c *Collection) Remove(selector interface{}) error
Remove invokes and traces Collection.Remove
func (*Collection) RemoveAll ¶
func (c *Collection) RemoveAll(selector interface{}) (info *mgo.ChangeInfo, err error)
RemoveAll invokes and traces Collection.RemoveAll
func (*Collection) RemoveId ¶
func (c *Collection) RemoveId(id interface{}) error
RemoveId invokes and traces Collection.RemoveId
func (*Collection) Repair ¶
func (c *Collection) Repair() *Iter
Repair invokes and traces Collection.Repair
func (*Collection) Update ¶
func (c *Collection) Update(selector interface{}, update interface{}) error
Update invokes and traces Collection.Update
func (*Collection) UpdateAll ¶
func (c *Collection) UpdateAll(selector interface{}, update interface{}) (info *mgo.ChangeInfo, err error)
UpdateAll invokes and traces Collection.UpdateAll
func (*Collection) UpdateId ¶
func (c *Collection) UpdateId(id interface{}, update interface{}) error
UpdateId invokes and traces Collection.UpdateId
func (*Collection) Upsert ¶
func (c *Collection) Upsert(selector interface{}, update interface{}) (info *mgo.ChangeInfo, err error)
Upsert invokes and traces Collection.Upsert
func (*Collection) UpsertId ¶
func (c *Collection) UpsertId(id interface{}, update interface{}) (info *mgo.ChangeInfo, err error)
UpsertId invokes and traces Collection.UpsertId
type Database ¶
Database is an mgo.Database along with the data necessary for tracing.
func (*Database) C ¶
func (db *Database) C(name string) *Collection
C returns a new Collection from this Database.
type DialOption ¶
type DialOption func(*mongoConfig)
DialOption represents an option that can be passed to Dial
func WithServiceName ¶
func WithServiceName(name string) DialOption
WithServiceName sets the service name for a given MongoDB context.
type Iter ¶
Iter is an mgo.Iter instance that will be traced.
type Pipe ¶
Pipe is an mgo.Pipe instance along with the data necessary for tracing.
func (*Pipe) AllowDiskUse ¶
AllowDiskUse invokes and traces Pipe.AllowDiskUse
type Query ¶
Query is an mgo.Query instance along with the data necessary for tracing.
func (*Query) MapReduce ¶
func (q *Query) MapReduce(job *mgo.MapReduce, result interface{}) (info *mgo.MapReduceInfo, err error)
MapReduce invokes and traces Query.MapReduce
func (*Query) Prefetch ¶
Prefetch invokes Query.Prefetch and configures the returned *Query for tracing.
func (*Query) SetMaxScan ¶
SetMaxScan invokes and traces Query.SetMaxScan
func (*Query) SetMaxTime ¶
SetMaxTime invokes and traces Query.SetMaxTime