Documentation ¶
Overview ¶
Package mongo is a generated GoMock package.
Index ¶
- Variables
- func FormatAddr(hosts []string) string
- type BulkInserter
- type ClosableIter
- type Collection
- type Iter
- type MockIter
- func (m *MockIter) All(result interface{}) error
- func (m *MockIter) Close() error
- func (m *MockIter) Done() bool
- func (m *MockIter) EXPECT() *MockIterMockRecorder
- func (m *MockIter) Err() error
- func (m *MockIter) For(result interface{}, f func() error) error
- func (m *MockIter) Next(result interface{}) bool
- func (m *MockIter) State() (int64, []bson.Raw)
- func (m *MockIter) Timeout() bool
- type MockIterMockRecorder
- func (mr *MockIterMockRecorder) All(result interface{}) *gomock.Call
- func (mr *MockIterMockRecorder) Close() *gomock.Call
- func (mr *MockIterMockRecorder) Done() *gomock.Call
- func (mr *MockIterMockRecorder) Err() *gomock.Call
- func (mr *MockIterMockRecorder) For(result, f interface{}) *gomock.Call
- func (mr *MockIterMockRecorder) Next(result interface{}) *gomock.Call
- func (mr *MockIterMockRecorder) State() *gomock.Call
- func (mr *MockIterMockRecorder) Timeout() *gomock.Call
- type Model
- func (mm *Model) Find(query interface{}) (Query, error)
- func (mm *Model) FindId(id interface{}) (Query, error)
- func (mm *Model) GetCollection(session *mgo.Session) Collection
- func (mm *Model) Insert(docs ...interface{}) error
- func (mm *Model) Pipe(pipeline interface{}) (Pipe, error)
- func (mm *Model) PutSession(session *mgo.Session)
- func (mm *Model) Remove(selector interface{}) error
- func (mm *Model) RemoveAll(selector interface{}) (*mgo.ChangeInfo, error)
- func (mm *Model) RemoveId(id interface{}) error
- func (mm *Model) TakeSession() (*mgo.Session, error)
- func (mm *Model) Update(selector, update interface{}) error
- func (mm *Model) UpdateId(id, update interface{}) error
- func (mm *Model) Upsert(selector, update interface{}) (*mgo.ChangeInfo, error)
- type Option
- type Pipe
- type Query
- type ResultHandler
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = mgo.ErrNotFound
Functions ¶
func FormatAddr ¶
Types ¶
type BulkInserter ¶
type BulkInserter struct {
// contains filtered or unexported fields
}
func NewBulkInserter ¶
func NewBulkInserter(session *mgo.Session, dbName string, collectionNamer func() string) *BulkInserter
func (*BulkInserter) Flush ¶
func (bi *BulkInserter) Flush()
func (*BulkInserter) Insert ¶
func (bi *BulkInserter) Insert(doc interface{})
func (*BulkInserter) SetResultHandler ¶
func (bi *BulkInserter) SetResultHandler(handler ResultHandler)
type ClosableIter ¶
type ClosableIter struct { Iter Cleanup func() }
func (*ClosableIter) Close ¶
func (it *ClosableIter) Close() error
type Collection ¶
type Collection interface { Find(query interface{}) Query FindId(id interface{}) Query Insert(docs ...interface{}) error Pipe(pipeline interface{}) Pipe Remove(selector interface{}) error RemoveAll(selector interface{}) (*mgo.ChangeInfo, error) RemoveId(id interface{}) error Update(selector, update interface{}) error UpdateId(id, update interface{}) error Upsert(selector, update interface{}) (*mgo.ChangeInfo, error) }
type MockIter ¶
type MockIter struct {
// contains filtered or unexported fields
}
MockIter is a mock of Iter interface
func NewMockIter ¶
func NewMockIter(ctrl *gomock.Controller) *MockIter
NewMockIter creates a new mock instance
func (*MockIter) EXPECT ¶
func (m *MockIter) EXPECT() *MockIterMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
type MockIterMockRecorder ¶
type MockIterMockRecorder struct {
// contains filtered or unexported fields
}
MockIterMockRecorder is the mock recorder for MockIter
func (*MockIterMockRecorder) All ¶
func (mr *MockIterMockRecorder) All(result interface{}) *gomock.Call
All indicates an expected call of All
func (*MockIterMockRecorder) Close ¶
func (mr *MockIterMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close
func (*MockIterMockRecorder) Done ¶
func (mr *MockIterMockRecorder) Done() *gomock.Call
Done indicates an expected call of Done
func (*MockIterMockRecorder) Err ¶
func (mr *MockIterMockRecorder) Err() *gomock.Call
Err indicates an expected call of Err
func (*MockIterMockRecorder) For ¶
func (mr *MockIterMockRecorder) For(result, f interface{}) *gomock.Call
For indicates an expected call of For
func (*MockIterMockRecorder) Next ¶
func (mr *MockIterMockRecorder) Next(result interface{}) *gomock.Call
Next indicates an expected call of Next
func (*MockIterMockRecorder) State ¶
func (mr *MockIterMockRecorder) State() *gomock.Call
State indicates an expected call of State
func (*MockIterMockRecorder) Timeout ¶
func (mr *MockIterMockRecorder) Timeout() *gomock.Call
Timeout indicates an expected call of Timeout
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
func MustNewModel ¶
func (*Model) GetCollection ¶
func (mm *Model) GetCollection(session *mgo.Session) Collection
func (*Model) PutSession ¶
type Query ¶
type Query interface { All(result interface{}) error Apply(change mgo.Change, result interface{}) (*mgo.ChangeInfo, error) Batch(n int) Query Collation(collation *mgo.Collation) Query Comment(comment string) Query Count() (int, 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 *mgo.MapReduce, result interface{}) (*mgo.MapReduceInfo, error) One(result interface{}) 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 }
type ResultHandler ¶
type ResultHandler func(*mgo.BulkResult, error)
Click to show internal directories.
Click to hide internal directories.