mgo

package
v1.24.0-rc.4 Latest Latest
Warning

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

Go to latest
Published: May 11, 2020 License: Apache-2.0, BSD-3-Clause, Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package mgo provides functions and types which allow tracing of the MGO MongoDB client (https://github.com/globalsign/mgo)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bulk

type Bulk struct {
	*mgo.Bulk
	// contains filtered or unexported fields
}

Bulk is an mgo.Bulk instance that will be traced.

func (*Bulk) Run

func (b *Bulk) Run() (result *mgo.BulkResult, err error)

Run invokes and traces Bulk.Run

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

type Database struct {
	*mgo.Database
	// contains filtered or unexported fields
}

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 WithAnalytics added in v1.11.0

func WithAnalytics(on bool) DialOption

WithAnalytics enables Trace Analytics for all started spans.

func WithAnalyticsRate added in v1.11.0

func WithAnalyticsRate(rate float64) DialOption

WithAnalyticsRate sets the sampling rate for Trace Analytics events correlated to started spans.

func WithContext

func WithContext(ctx context.Context) DialOption

WithContext sets the context.

func WithServiceName

func WithServiceName(name string) DialOption

WithServiceName sets the service name for a given MongoDB context.

type Iter

type Iter struct {
	*mgo.Iter
	// contains filtered or unexported fields
}

Iter is an mgo.Iter instance that will be traced.

func (*Iter) All

func (iter *Iter) All(result interface{}) (err error)

All invokes and traces Iter.All

func (*Iter) Close

func (iter *Iter) Close() (err error)

Close invokes and traces Iter.Close

func (*Iter) For

func (iter *Iter) For(result interface{}, f func() error) (err error)

For invokes and traces Iter.For

func (*Iter) Next

func (iter *Iter) Next(result interface{}) bool

Next invokes and traces Iter.Next

type Pipe

type Pipe struct {
	*mgo.Pipe
	// contains filtered or unexported fields
}

Pipe is an mgo.Pipe instance along with the data necessary for tracing.

func (*Pipe) All

func (p *Pipe) All(result interface{}) error

All invokes and traces Pipe.All

func (*Pipe) Explain

func (p *Pipe) Explain(result interface{}) (err error)

Explain invokes and traces Pipe.Explain

func (*Pipe) Iter

func (p *Pipe) Iter() *Iter

Iter invokes and traces Pipe.Iter

func (*Pipe) One

func (p *Pipe) One(result interface{}) (err error)

One invokes and traces Pipe.One

type Query

type Query struct {
	*mgo.Query
	// contains filtered or unexported fields
}

Query is an mgo.Query instance along with the data necessary for tracing.

func (*Query) All

func (q *Query) All(result interface{}) error

All invokes and traces Query.All

func (*Query) Apply

func (q *Query) Apply(change mgo.Change, result interface{}) (info *mgo.ChangeInfo, err error)

Apply invokes and traces Query.Apply

func (*Query) Count

func (q *Query) Count() (n int, err error)

Count invokes and traces Query.Count

func (*Query) Distinct

func (q *Query) Distinct(key string, result interface{}) error

Distinct invokes and traces Query.Distinct

func (*Query) Explain

func (q *Query) Explain(result interface{}) error

Explain invokes and traces Query.Explain

func (*Query) For

func (q *Query) For(result interface{}, f func() error) error

For invokes and traces Query.For

func (*Query) Iter

func (q *Query) Iter() *Iter

Iter invokes and traces Query.Iter

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) One

func (q *Query) One(result interface{}) error

One invokes and traces Query.One

func (*Query) Tail

func (q *Query) Tail(timeout time.Duration) *Iter

Tail invokes and traces Query.Tail

type Session

type Session struct {
	*mgo.Session
	// contains filtered or unexported fields
}

Session is an mgo.Session instance that will be traced.

func Dial

func Dial(url string, opts ...DialOption) (*Session, error)

Dial opens a connection to a MongoDB server and configures it for tracing.

func (*Session) DB

func (s *Session) DB(name string) *Database

DB returns a new database for this Session.

func (*Session) Run

func (s *Session) Run(cmd interface{}, result interface{}) (err error)

Run invokes and traces Session.Run

Jump to

Keyboard shortcuts

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