mgoi

package module
v0.0.0-...-e2ec5d3 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2021 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildInfo

type BuildInfo = mgo.BuildInfo

type Bulk

type Bulk interface {
	Insert(docs ...interface{})
	Remove(selectors ...interface{})
	RemoveAll(selectors ...interface{})
	Run() (*BulkResult, error)
	Unordered()
	Update(pairs ...interface{})
	UpdateAll(pairs ...interface{})
	Upsert(pairs ...interface{})
}

type BulkResult

type BulkResult = mgo.BulkResult

type Change

type Change = mgo.Change

type ChangeInfo

type ChangeInfo = mgo.ChangeInfo

type Collation

type Collation = mgo.Collation

type Collection

type Collection interface {
	Bulk() Bulk
	Count() (n int, err error)
	Create(info *CollectionInfo) error
	DropAllIndexes() error
	DropCollection() error
	DropIndex(key ...string) error
	DropIndexName(name string) error
	EnsureIndex(index Index) error
	EnsureIndexKey(key ...string) error
	Find(query interface{}) Query
	FindId(id interface{}) Query
	Indexes() (indexes []Index, err error)
	Insert(docs ...interface{}) error
	// NewIter(session *Session, firstBatch []bson.Raw, cursorId int64, err error) *Iter
	// Pipe(pipeline interface{}) Pipe
	Remove(selector interface{}) error
	RemoveAll(selector interface{}) (info *ChangeInfo, err error)
	RemoveId(id interface{}) error
	Repair() Iter
	Update(selector interface{}, update interface{}) error
	UpdateAll(selector interface{}, update interface{}) (info *ChangeInfo, err error)
	UpdateId(id interface{}, update interface{}) error
	Upsert(selector interface{}, update interface{}) (info *ChangeInfo, err error)
	UpsertId(id interface{}, update interface{}) (info *ChangeInfo, err error)
}

func WrapCollection

func WrapCollection(c *mgo.Collection) Collection

type CollectionInfo

type CollectionInfo = mgo.CollectionInfo

type Credential

type Credential = mgo.Credential

type DBRef

type DBRef = mgo.DBRef

type Database

type Database interface {
	AddUser(username, password string, readOnly bool) error
	C(name string) Collection
	CollectionNames() (names []string, err error)
	CreateView(view string, source string, pipeline interface{}, collation *Collation) error
	DropDatabase() error
	FindRef(ref *DBRef) Query
	// GridFS(prefix string) *GridFS
	Login(user, pass string) error
	Logout()
	RemoveUser(user string) error
	Run(cmd interface{}, result interface{}) error
	UpsertUser(user *User) error
}

func WrapDatabase

func WrapDatabase(d *mgo.Database) Database

type Index

type Index = mgo.Index

type Iter

type Iter interface {
	All(result interface{}) error
	Close() error
	Done() bool
	Err() error
	For(result interface{}, f func() error) (err error)
	Next(result interface{}) bool
	State() (int64, []bson.Raw)
	Timeout() bool
}

type MapReduce

type MapReduce = mgo.MapReduce

type MapReduceInfo

type MapReduceInfo = mgo.MapReduceInfo

type Mode

type Mode = mgo.Mode

type Query

type Query interface {
	All(result interface{}) error
	Apply(change Change, result interface{}) (info *ChangeInfo, err error)
	Batch(n int) Query
	Collation(collation *Collation) Query
	Comment(comment string) Query
	Count() (n int, err error)
	Distinct(key string, result interface{}) error
	Explain(result interface{}) error
	For(result interface{}, f func() error) error
	Hint(indexKey ...string) Query
	Iter() Iter
	Limit(n int) Query
	LogReplay() Query
	MapReduce(job *MapReduce, result interface{}) (info *MapReduceInfo, err error)
	One(result interface{}) (err error)
	Prefetch(p float64) Query
	Select(selector interface{}) Query
	SetMaxScan(n int) Query
	SetMaxTime(d time.Duration) Query
	Skip(n int) Query
	Snapshot() Query
	Sort(fields ...string) Query
	Tail(timeout time.Duration) Iter
}

func WrapQuery

func WrapQuery(q *mgo.Query) Query

type Safe

type Safe = mgo.Safe

type Session

type Session interface {
	BuildInfo() (info BuildInfo, err error)
	Clone() Session
	Close()
	Copy() Session
	DB(name string) Database
	DatabaseNames() (names []string, err error)
	EnsureSafe(safe *Safe)
	FindRef(ref *DBRef) Query
	Fsync(async bool) error
	FsyncLock() error
	FsyncUnlock() error
	LiveServers() (addrs []string)
	Login(cred *Credential) error
	LogoutAll()
	Mode() Mode
	New() Session
	Ping() error
	Refresh()
	ResetIndexCache()
	Run(cmd interface{}, result interface{}) error
	Safe() (safe *Safe)
	SelectServers(tags ...bson.D)
	SetBatch(n int)
	SetBypassValidation(bypass bool)
	SetCursorTimeout(d time.Duration)
	SetMode(consistency Mode, refresh bool)
	SetPoolLimit(limit int)
	SetPoolTimeout(timeout time.Duration)
	SetPrefetch(p float64)
	SetSafe(safe *Safe)
	SetSocketTimeout(d time.Duration)
	SetSyncTimeout(d time.Duration)
}

func WrapSession

func WrapSession(s *mgo.Session) Session

type User

type User = mgo.User

Directories

Path Synopsis
mocks
mgoimock Module

Jump to

Keyboard shortcuts

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