Documentation
¶
Overview ¶
Package mockdb provides a full Kivik driver implementation, for mocking in tests.
Index ¶
- func Document(i interface{}) (*driver.Document, error)
- func DocumentT(t *testing.T, i interface{}) *driver.Document
- type Changes
- func (r *Changes) AddChange(change *driver.Change) *Changes
- func (r *Changes) AddChangeError(err error) *Changes
- func (r *Changes) AddDelay(delay time.Duration) *Changes
- func (i *Changes) Close() error
- func (r *Changes) CloseError(err error) *Changes
- func (r *Changes) ETag(etag string) *Changes
- func (r *Changes) Final() driver.Changes
- func (r *Changes) LastSeq(seq string) *Changes
- func (r *Changes) Pending(pending int64) *Changes
- type Client
- func (c *Client) ExpectAllDBs() *ExpectedAllDBs
- func (c *Client) ExpectClose() *ExpectedClose
- func (c *Client) ExpectClusterSetup() *ExpectedClusterSetup
- func (c *Client) ExpectClusterStatus() *ExpectedClusterStatus
- func (c *Client) ExpectConfig() *ExpectedConfig
- func (c *Client) ExpectConfigSection() *ExpectedConfigSection
- func (c *Client) ExpectConfigValue() *ExpectedConfigValue
- func (c *Client) ExpectCreateDB() *ExpectedCreateDB
- func (c *Client) ExpectDB() *ExpectedDB
- func (c *Client) ExpectDBExists() *ExpectedDBExists
- func (c *Client) ExpectDBUpdates() *ExpectedDBUpdates
- func (c *Client) ExpectDBsStats() *ExpectedDBsStats
- func (c *Client) ExpectDeleteConfigKey() *ExpectedDeleteConfigKey
- func (c *Client) ExpectDestroyDB() *ExpectedDestroyDB
- func (c *Client) ExpectGetReplications() *ExpectedGetReplications
- func (c *Client) ExpectMembership() *ExpectedMembership
- func (c *Client) ExpectPing() *ExpectedPing
- func (c *Client) ExpectReplicate() *ExpectedReplicate
- func (c *Client) ExpectSession() *ExpectedSession
- func (c *Client) ExpectSetConfigValue() *ExpectedSetConfigValue
- func (c *Client) ExpectVersion() *ExpectedVersion
- func (c *Client) ExpectationsWereMet() error
- func (c *Client) MatchExpectationsInOrder(b bool)
- func (c *Client) NewDB() *DB
- func (c *Client) NewReplication() *Replication
- type DB
- func (db *DB) ExpectAllDocs() *ExpectedAllDocs
- func (db *DB) ExpectBulkDocs() *ExpectedBulkDocs
- func (db *DB) ExpectBulkGet() *ExpectedBulkGet
- func (db *DB) ExpectChanges() *ExpectedChanges
- func (db *DB) ExpectClose() *ExpectedDBClose
- func (db *DB) ExpectCompact() *ExpectedCompact
- func (db *DB) ExpectCompactView() *ExpectedCompactView
- func (db *DB) ExpectCopy() *ExpectedCopy
- func (db *DB) ExpectCreateDoc() *ExpectedCreateDoc
- func (db *DB) ExpectCreateIndex() *ExpectedCreateIndex
- func (db *DB) ExpectDelete() *ExpectedDelete
- func (db *DB) ExpectDeleteAttachment() *ExpectedDeleteAttachment
- func (db *DB) ExpectDeleteIndex() *ExpectedDeleteIndex
- func (db *DB) ExpectDesignDocs() *ExpectedDesignDocs
- func (db *DB) ExpectExplain() *ExpectedExplain
- func (db *DB) ExpectFind() *ExpectedFind
- func (db *DB) ExpectFlush() *ExpectedFlush
- func (db *DB) ExpectGet() *ExpectedGet
- func (db *DB) ExpectGetAttachment() *ExpectedGetAttachment
- func (db *DB) ExpectGetAttachmentMeta() *ExpectedGetAttachmentMeta
- func (db *DB) ExpectGetIndexes() *ExpectedGetIndexes
- func (db *DB) ExpectGetRev() *ExpectedGetRev
- func (db *DB) ExpectLocalDocs() *ExpectedLocalDocs
- func (db *DB) ExpectOpenRevs() *ExpectedOpenRevs
- func (db *DB) ExpectPartitionStats() *ExpectedPartitionStats
- func (db *DB) ExpectPurge() *ExpectedPurge
- func (db *DB) ExpectPut() *ExpectedPut
- func (db *DB) ExpectPutAttachment() *ExpectedPutAttachment
- func (db *DB) ExpectQuery() *ExpectedQuery
- func (db *DB) ExpectRevsDiff() *ExpectedRevsDiff
- func (db *DB) ExpectSecurity() *ExpectedSecurity
- func (db *DB) ExpectSetSecurity() *ExpectedSetSecurity
- func (db *DB) ExpectStats() *ExpectedStats
- func (db *DB) ExpectViewCleanup() *ExpectedViewCleanup
- type ExpectedAllDBs
- func (e *ExpectedAllDBs) String() string
- func (e *ExpectedAllDBs) WillDelay(delay time.Duration) *ExpectedAllDBs
- func (e *ExpectedAllDBs) WillExecute(cb func(ctx context.Context, options driver.Options) ([]string, error)) *ExpectedAllDBs
- func (e *ExpectedAllDBs) WillReturn(ret0 []string) *ExpectedAllDBs
- func (e *ExpectedAllDBs) WillReturnError(err error) *ExpectedAllDBs
- func (e *ExpectedAllDBs) WithOptions(options ...kivik.Option) *ExpectedAllDBs
- type ExpectedAllDocs
- func (e *ExpectedAllDocs) String() string
- func (e *ExpectedAllDocs) WillDelay(delay time.Duration) *ExpectedAllDocs
- func (e *ExpectedAllDocs) WillExecute(cb func(ctx context.Context, options driver.Options) (driver.Rows, error)) *ExpectedAllDocs
- func (e *ExpectedAllDocs) WillReturn(ret0 *Rows) *ExpectedAllDocs
- func (e *ExpectedAllDocs) WillReturnError(err error) *ExpectedAllDocs
- func (e *ExpectedAllDocs) WithOptions(options ...kivik.Option) *ExpectedAllDocs
- type ExpectedBulkDocs
- func (e *ExpectedBulkDocs) String() string
- func (e *ExpectedBulkDocs) WillDelay(delay time.Duration) *ExpectedBulkDocs
- func (e *ExpectedBulkDocs) WillExecute(...) *ExpectedBulkDocs
- func (e *ExpectedBulkDocs) WillReturn(ret0 []driver.BulkResult) *ExpectedBulkDocs
- func (e *ExpectedBulkDocs) WillReturnError(err error) *ExpectedBulkDocs
- func (e *ExpectedBulkDocs) WithOptions(options ...kivik.Option) *ExpectedBulkDocs
- type ExpectedBulkGet
- func (e *ExpectedBulkGet) String() string
- func (e *ExpectedBulkGet) WillDelay(delay time.Duration) *ExpectedBulkGet
- func (e *ExpectedBulkGet) WillExecute(...) *ExpectedBulkGet
- func (e *ExpectedBulkGet) WillReturn(ret0 *Rows) *ExpectedBulkGet
- func (e *ExpectedBulkGet) WillReturnError(err error) *ExpectedBulkGet
- func (e *ExpectedBulkGet) WithOptions(options ...kivik.Option) *ExpectedBulkGet
- type ExpectedChanges
- func (e *ExpectedChanges) String() string
- func (e *ExpectedChanges) WillDelay(delay time.Duration) *ExpectedChanges
- func (e *ExpectedChanges) WillExecute(cb func(ctx context.Context, options driver.Options) (driver.Changes, error)) *ExpectedChanges
- func (e *ExpectedChanges) WillReturn(ret0 *Changes) *ExpectedChanges
- func (e *ExpectedChanges) WillReturnError(err error) *ExpectedChanges
- func (e *ExpectedChanges) WithOptions(options ...kivik.Option) *ExpectedChanges
- type ExpectedClose
- type ExpectedClusterSetup
- func (e *ExpectedClusterSetup) String() string
- func (e *ExpectedClusterSetup) WillDelay(delay time.Duration) *ExpectedClusterSetup
- func (e *ExpectedClusterSetup) WillExecute(cb func(ctx context.Context, arg0 interface{}) error) *ExpectedClusterSetup
- func (e *ExpectedClusterSetup) WillReturnError(err error) *ExpectedClusterSetup
- func (e *ExpectedClusterSetup) WithAction(action interface{}) *ExpectedClusterSetup
- type ExpectedClusterStatus
- func (e *ExpectedClusterStatus) String() string
- func (e *ExpectedClusterStatus) WillDelay(delay time.Duration) *ExpectedClusterStatus
- func (e *ExpectedClusterStatus) WillExecute(cb func(ctx context.Context, options driver.Options) (string, error)) *ExpectedClusterStatus
- func (e *ExpectedClusterStatus) WillReturn(ret0 string) *ExpectedClusterStatus
- func (e *ExpectedClusterStatus) WillReturnError(err error) *ExpectedClusterStatus
- func (e *ExpectedClusterStatus) WithOptions(options ...kivik.Option) *ExpectedClusterStatus
- type ExpectedCompact
- type ExpectedCompactView
- func (e *ExpectedCompactView) String() string
- func (e *ExpectedCompactView) WillDelay(delay time.Duration) *ExpectedCompactView
- func (e *ExpectedCompactView) WillExecute(cb func(ctx context.Context, arg0 string) error) *ExpectedCompactView
- func (e *ExpectedCompactView) WillReturnError(err error) *ExpectedCompactView
- func (e *ExpectedCompactView) WithDDoc(ddocID string) *ExpectedCompactView
- type ExpectedConfig
- func (e *ExpectedConfig) String() string
- func (e *ExpectedConfig) WillDelay(delay time.Duration) *ExpectedConfig
- func (e *ExpectedConfig) WillExecute(cb func(ctx context.Context, arg0 string) (driver.Config, error)) *ExpectedConfig
- func (e *ExpectedConfig) WillReturn(ret0 driver.Config) *ExpectedConfig
- func (e *ExpectedConfig) WillReturnError(err error) *ExpectedConfig
- func (e *ExpectedConfig) WithNode(node string) *ExpectedConfig
- type ExpectedConfigSection
- func (e *ExpectedConfigSection) String() string
- func (e *ExpectedConfigSection) WillDelay(delay time.Duration) *ExpectedConfigSection
- func (e *ExpectedConfigSection) WillExecute(...) *ExpectedConfigSection
- func (e *ExpectedConfigSection) WillReturn(ret0 driver.ConfigSection) *ExpectedConfigSection
- func (e *ExpectedConfigSection) WillReturnError(err error) *ExpectedConfigSection
- func (e *ExpectedConfigSection) WithNode(node string) *ExpectedConfigSection
- func (e *ExpectedConfigSection) WithSection(section string) *ExpectedConfigSection
- type ExpectedConfigValue
- func (e *ExpectedConfigValue) String() string
- func (e *ExpectedConfigValue) WillDelay(delay time.Duration) *ExpectedConfigValue
- func (e *ExpectedConfigValue) WillExecute(...) *ExpectedConfigValue
- func (e *ExpectedConfigValue) WillReturn(ret0 string) *ExpectedConfigValue
- func (e *ExpectedConfigValue) WillReturnError(err error) *ExpectedConfigValue
- func (e *ExpectedConfigValue) WithKey(key string) *ExpectedConfigValue
- func (e *ExpectedConfigValue) WithNode(node string) *ExpectedConfigValue
- func (e *ExpectedConfigValue) WithSection(section string) *ExpectedConfigValue
- type ExpectedCopy
- func (e *ExpectedCopy) String() string
- func (e *ExpectedCopy) WillDelay(delay time.Duration) *ExpectedCopy
- func (e *ExpectedCopy) WillExecute(...) *ExpectedCopy
- func (e *ExpectedCopy) WillReturn(ret0 string) *ExpectedCopy
- func (e *ExpectedCopy) WillReturnError(err error) *ExpectedCopy
- func (e *ExpectedCopy) WithOptions(options ...kivik.Option) *ExpectedCopy
- func (e *ExpectedCopy) WithSourceID(docID string) *ExpectedCopy
- func (e *ExpectedCopy) WithTargetID(docID string) *ExpectedCopy
- type ExpectedCreateDB
- func (e *ExpectedCreateDB) String() string
- func (e *ExpectedCreateDB) WillDelay(delay time.Duration) *ExpectedCreateDB
- func (e *ExpectedCreateDB) WillExecute(cb func(ctx context.Context, arg0 string, options driver.Options) error) *ExpectedCreateDB
- func (e *ExpectedCreateDB) WillReturnError(err error) *ExpectedCreateDB
- func (e *ExpectedCreateDB) WithName(name string) *ExpectedCreateDB
- func (e *ExpectedCreateDB) WithOptions(options ...kivik.Option) *ExpectedCreateDB
- type ExpectedCreateDoc
- func (e *ExpectedCreateDoc) String() string
- func (e *ExpectedCreateDoc) WillDelay(delay time.Duration) *ExpectedCreateDoc
- func (e *ExpectedCreateDoc) WillExecute(...) *ExpectedCreateDoc
- func (e *ExpectedCreateDoc) WillReturn(ret0 string, ret1 string) *ExpectedCreateDoc
- func (e *ExpectedCreateDoc) WillReturnError(err error) *ExpectedCreateDoc
- func (e *ExpectedCreateDoc) WithDoc(doc interface{}) *ExpectedCreateDoc
- func (e *ExpectedCreateDoc) WithOptions(options ...kivik.Option) *ExpectedCreateDoc
- type ExpectedCreateIndex
- func (e *ExpectedCreateIndex) String() string
- func (e *ExpectedCreateIndex) WillDelay(delay time.Duration) *ExpectedCreateIndex
- func (e *ExpectedCreateIndex) WillExecute(...) *ExpectedCreateIndex
- func (e *ExpectedCreateIndex) WillReturnError(err error) *ExpectedCreateIndex
- func (e *ExpectedCreateIndex) WithDDocID(ddocID string) *ExpectedCreateIndex
- func (e *ExpectedCreateIndex) WithIndex(index interface{}) *ExpectedCreateIndex
- func (e *ExpectedCreateIndex) WithName(name string) *ExpectedCreateIndex
- func (e *ExpectedCreateIndex) WithOptions(options ...kivik.Option) *ExpectedCreateIndex
- type ExpectedDB
- func (e *ExpectedDB) String() string
- func (e *ExpectedDB) WillExecute(cb func(arg0 string, options driver.Options) (driver.DB, error)) *ExpectedDB
- func (e *ExpectedDB) WillReturn(ret0 *DB) *ExpectedDB
- func (e *ExpectedDB) WillReturnError(err error) *ExpectedDB
- func (e *ExpectedDB) WithName(name string) *ExpectedDB
- func (e *ExpectedDB) WithOptions(options ...kivik.Option) *ExpectedDB
- type ExpectedDBClose
- type ExpectedDBExists
- func (e *ExpectedDBExists) String() string
- func (e *ExpectedDBExists) WillDelay(delay time.Duration) *ExpectedDBExists
- func (e *ExpectedDBExists) WillExecute(...) *ExpectedDBExists
- func (e *ExpectedDBExists) WillReturn(ret0 bool) *ExpectedDBExists
- func (e *ExpectedDBExists) WillReturnError(err error) *ExpectedDBExists
- func (e *ExpectedDBExists) WithName(name string) *ExpectedDBExists
- func (e *ExpectedDBExists) WithOptions(options ...kivik.Option) *ExpectedDBExists
- type ExpectedDBUpdates
- func (e *ExpectedDBUpdates) String() string
- func (e *ExpectedDBUpdates) WillDelay(delay time.Duration) *ExpectedDBUpdates
- func (e *ExpectedDBUpdates) WillExecute(cb func(ctx context.Context, options driver.Options) (driver.DBUpdates, error)) *ExpectedDBUpdates
- func (e *ExpectedDBUpdates) WillReturn(ret0 *Updates) *ExpectedDBUpdates
- func (e *ExpectedDBUpdates) WillReturnError(err error) *ExpectedDBUpdates
- func (e *ExpectedDBUpdates) WithOptions(options ...kivik.Option) *ExpectedDBUpdates
- type ExpectedDBsStats
- func (e *ExpectedDBsStats) String() string
- func (e *ExpectedDBsStats) WillDelay(delay time.Duration) *ExpectedDBsStats
- func (e *ExpectedDBsStats) WillExecute(cb func(ctx context.Context, arg0 []string) ([]*driver.DBStats, error)) *ExpectedDBsStats
- func (e *ExpectedDBsStats) WillReturn(ret0 []*driver.DBStats) *ExpectedDBsStats
- func (e *ExpectedDBsStats) WillReturnError(err error) *ExpectedDBsStats
- func (e *ExpectedDBsStats) WithNames(names []string) *ExpectedDBsStats
- type ExpectedDelete
- func (e *ExpectedDelete) String() string
- func (e *ExpectedDelete) WillDelay(delay time.Duration) *ExpectedDelete
- func (e *ExpectedDelete) WillExecute(...) *ExpectedDelete
- func (e *ExpectedDelete) WillReturn(ret0 string) *ExpectedDelete
- func (e *ExpectedDelete) WillReturnError(err error) *ExpectedDelete
- func (e *ExpectedDelete) WithDocID(docID string) *ExpectedDelete
- func (e *ExpectedDelete) WithOptions(options ...kivik.Option) *ExpectedDelete
- type ExpectedDeleteAttachment
- func (e *ExpectedDeleteAttachment) String() string
- func (e *ExpectedDeleteAttachment) WillDelay(delay time.Duration) *ExpectedDeleteAttachment
- func (e *ExpectedDeleteAttachment) WillExecute(...) *ExpectedDeleteAttachment
- func (e *ExpectedDeleteAttachment) WillReturn(ret0 string) *ExpectedDeleteAttachment
- func (e *ExpectedDeleteAttachment) WillReturnError(err error) *ExpectedDeleteAttachment
- func (e *ExpectedDeleteAttachment) WithDocID(docID string) *ExpectedDeleteAttachment
- func (e *ExpectedDeleteAttachment) WithFilename(filename string) *ExpectedDeleteAttachment
- func (e *ExpectedDeleteAttachment) WithOptions(options ...kivik.Option) *ExpectedDeleteAttachment
- type ExpectedDeleteConfigKey
- func (e *ExpectedDeleteConfigKey) String() string
- func (e *ExpectedDeleteConfigKey) WillDelay(delay time.Duration) *ExpectedDeleteConfigKey
- func (e *ExpectedDeleteConfigKey) WillExecute(...) *ExpectedDeleteConfigKey
- func (e *ExpectedDeleteConfigKey) WillReturn(ret0 string) *ExpectedDeleteConfigKey
- func (e *ExpectedDeleteConfigKey) WillReturnError(err error) *ExpectedDeleteConfigKey
- func (e *ExpectedDeleteConfigKey) WithKey(key string) *ExpectedDeleteConfigKey
- func (e *ExpectedDeleteConfigKey) WithNode(node string) *ExpectedDeleteConfigKey
- func (e *ExpectedDeleteConfigKey) WithSection(section string) *ExpectedDeleteConfigKey
- type ExpectedDeleteIndex
- func (e *ExpectedDeleteIndex) String() string
- func (e *ExpectedDeleteIndex) WillDelay(delay time.Duration) *ExpectedDeleteIndex
- func (e *ExpectedDeleteIndex) WillExecute(...) *ExpectedDeleteIndex
- func (e *ExpectedDeleteIndex) WillReturnError(err error) *ExpectedDeleteIndex
- func (e *ExpectedDeleteIndex) WithDDoc(ddoc string) *ExpectedDeleteIndex
- func (e *ExpectedDeleteIndex) WithName(name string) *ExpectedDeleteIndex
- func (e *ExpectedDeleteIndex) WithOptions(options ...kivik.Option) *ExpectedDeleteIndex
- type ExpectedDesignDocs
- func (e *ExpectedDesignDocs) String() string
- func (e *ExpectedDesignDocs) WillDelay(delay time.Duration) *ExpectedDesignDocs
- func (e *ExpectedDesignDocs) WillExecute(cb func(ctx context.Context, options driver.Options) (driver.Rows, error)) *ExpectedDesignDocs
- func (e *ExpectedDesignDocs) WillReturn(ret0 *Rows) *ExpectedDesignDocs
- func (e *ExpectedDesignDocs) WillReturnError(err error) *ExpectedDesignDocs
- func (e *ExpectedDesignDocs) WithOptions(options ...kivik.Option) *ExpectedDesignDocs
- type ExpectedDestroyDB
- func (e *ExpectedDestroyDB) String() string
- func (e *ExpectedDestroyDB) WillDelay(delay time.Duration) *ExpectedDestroyDB
- func (e *ExpectedDestroyDB) WillExecute(cb func(ctx context.Context, arg0 string, options driver.Options) error) *ExpectedDestroyDB
- func (e *ExpectedDestroyDB) WillReturnError(err error) *ExpectedDestroyDB
- func (e *ExpectedDestroyDB) WithName(name string) *ExpectedDestroyDB
- func (e *ExpectedDestroyDB) WithOptions(options ...kivik.Option) *ExpectedDestroyDB
- type ExpectedExplain
- func (e *ExpectedExplain) String() string
- func (e *ExpectedExplain) WillDelay(delay time.Duration) *ExpectedExplain
- func (e *ExpectedExplain) WillExecute(...) *ExpectedExplain
- func (e *ExpectedExplain) WillReturn(ret0 *driver.QueryPlan) *ExpectedExplain
- func (e *ExpectedExplain) WillReturnError(err error) *ExpectedExplain
- func (e *ExpectedExplain) WithOptions(options ...kivik.Option) *ExpectedExplain
- func (e *ExpectedExplain) WithQuery(query interface{}) *ExpectedExplain
- type ExpectedFind
- func (e *ExpectedFind) String() string
- func (e *ExpectedFind) WillDelay(delay time.Duration) *ExpectedFind
- func (e *ExpectedFind) WillExecute(...) *ExpectedFind
- func (e *ExpectedFind) WillReturn(ret0 *Rows) *ExpectedFind
- func (e *ExpectedFind) WillReturnError(err error) *ExpectedFind
- func (e *ExpectedFind) WithOptions(options ...kivik.Option) *ExpectedFind
- func (e *ExpectedFind) WithQuery(query interface{}) *ExpectedFind
- type ExpectedFlush
- type ExpectedGet
- func (e *ExpectedGet) String() string
- func (e *ExpectedGet) WillDelay(delay time.Duration) *ExpectedGet
- func (e *ExpectedGet) WillExecute(...) *ExpectedGet
- func (e *ExpectedGet) WillReturn(ret0 *driver.Document) *ExpectedGet
- func (e *ExpectedGet) WillReturnError(err error) *ExpectedGet
- func (e *ExpectedGet) WithDocID(docID string) *ExpectedGet
- func (e *ExpectedGet) WithOptions(options ...kivik.Option) *ExpectedGet
- type ExpectedGetAttachment
- func (e *ExpectedGetAttachment) String() string
- func (e *ExpectedGetAttachment) WillDelay(delay time.Duration) *ExpectedGetAttachment
- func (e *ExpectedGetAttachment) WillExecute(...) *ExpectedGetAttachment
- func (e *ExpectedGetAttachment) WillReturn(ret0 *driver.Attachment) *ExpectedGetAttachment
- func (e *ExpectedGetAttachment) WillReturnError(err error) *ExpectedGetAttachment
- func (e *ExpectedGetAttachment) WithDocID(docID string) *ExpectedGetAttachment
- func (e *ExpectedGetAttachment) WithFilename(docID string) *ExpectedGetAttachment
- func (e *ExpectedGetAttachment) WithOptions(options ...kivik.Option) *ExpectedGetAttachment
- type ExpectedGetAttachmentMeta
- func (e *ExpectedGetAttachmentMeta) String() string
- func (e *ExpectedGetAttachmentMeta) WillDelay(delay time.Duration) *ExpectedGetAttachmentMeta
- func (e *ExpectedGetAttachmentMeta) WillExecute(...) *ExpectedGetAttachmentMeta
- func (e *ExpectedGetAttachmentMeta) WillReturn(ret0 *driver.Attachment) *ExpectedGetAttachmentMeta
- func (e *ExpectedGetAttachmentMeta) WillReturnError(err error) *ExpectedGetAttachmentMeta
- func (e *ExpectedGetAttachmentMeta) WithDocID(docID string) *ExpectedGetAttachmentMeta
- func (e *ExpectedGetAttachmentMeta) WithFilename(filename string) *ExpectedGetAttachmentMeta
- func (e *ExpectedGetAttachmentMeta) WithOptions(options ...kivik.Option) *ExpectedGetAttachmentMeta
- type ExpectedGetIndexes
- func (e *ExpectedGetIndexes) String() string
- func (e *ExpectedGetIndexes) WillDelay(delay time.Duration) *ExpectedGetIndexes
- func (e *ExpectedGetIndexes) WillExecute(cb func(ctx context.Context, options driver.Options) ([]driver.Index, error)) *ExpectedGetIndexes
- func (e *ExpectedGetIndexes) WillReturn(ret0 []driver.Index) *ExpectedGetIndexes
- func (e *ExpectedGetIndexes) WillReturnError(err error) *ExpectedGetIndexes
- func (e *ExpectedGetIndexes) WithOptions(options ...kivik.Option) *ExpectedGetIndexes
- type ExpectedGetReplications
- func (e *ExpectedGetReplications) String() string
- func (e *ExpectedGetReplications) WillDelay(delay time.Duration) *ExpectedGetReplications
- func (e *ExpectedGetReplications) WillExecute(...) *ExpectedGetReplications
- func (e *ExpectedGetReplications) WillReturn(ret0 []*Replication) *ExpectedGetReplications
- func (e *ExpectedGetReplications) WillReturnError(err error) *ExpectedGetReplications
- func (e *ExpectedGetReplications) WithOptions(options ...kivik.Option) *ExpectedGetReplications
- type ExpectedGetRev
- func (e *ExpectedGetRev) String() string
- func (e *ExpectedGetRev) WillDelay(delay time.Duration) *ExpectedGetRev
- func (e *ExpectedGetRev) WillExecute(...) *ExpectedGetRev
- func (e *ExpectedGetRev) WillReturn(ret0 string) *ExpectedGetRev
- func (e *ExpectedGetRev) WillReturnError(err error) *ExpectedGetRev
- func (e *ExpectedGetRev) WithDocID(docID string) *ExpectedGetRev
- func (e *ExpectedGetRev) WithOptions(options ...kivik.Option) *ExpectedGetRev
- type ExpectedLocalDocs
- func (e *ExpectedLocalDocs) String() string
- func (e *ExpectedLocalDocs) WillDelay(delay time.Duration) *ExpectedLocalDocs
- func (e *ExpectedLocalDocs) WillExecute(cb func(ctx context.Context, options driver.Options) (driver.Rows, error)) *ExpectedLocalDocs
- func (e *ExpectedLocalDocs) WillReturn(ret0 *Rows) *ExpectedLocalDocs
- func (e *ExpectedLocalDocs) WillReturnError(err error) *ExpectedLocalDocs
- func (e *ExpectedLocalDocs) WithOptions(options ...kivik.Option) *ExpectedLocalDocs
- type ExpectedMembership
- func (e *ExpectedMembership) String() string
- func (e *ExpectedMembership) WillDelay(delay time.Duration) *ExpectedMembership
- func (e *ExpectedMembership) WillExecute(cb func(ctx context.Context) (*driver.ClusterMembership, error)) *ExpectedMembership
- func (e *ExpectedMembership) WillReturn(ret0 *driver.ClusterMembership) *ExpectedMembership
- func (e *ExpectedMembership) WillReturnError(err error) *ExpectedMembership
- type ExpectedOpenRevs
- func (e *ExpectedOpenRevs) String() string
- func (e *ExpectedOpenRevs) WillDelay(delay time.Duration) *ExpectedOpenRevs
- func (e *ExpectedOpenRevs) WillExecute(...) *ExpectedOpenRevs
- func (e *ExpectedOpenRevs) WillReturn(ret0 *Rows) *ExpectedOpenRevs
- func (e *ExpectedOpenRevs) WillReturnError(err error) *ExpectedOpenRevs
- func (e *ExpectedOpenRevs) WithDocID(docID string) *ExpectedOpenRevs
- func (e *ExpectedOpenRevs) WithOptions(options ...kivik.Option) *ExpectedOpenRevs
- func (e *ExpectedOpenRevs) WithRevs(revs []string) *ExpectedOpenRevs
- type ExpectedPartitionStats
- func (e *ExpectedPartitionStats) String() string
- func (e *ExpectedPartitionStats) WillDelay(delay time.Duration) *ExpectedPartitionStats
- func (e *ExpectedPartitionStats) WillExecute(cb func(ctx context.Context, arg0 string) (*driver.PartitionStats, error)) *ExpectedPartitionStats
- func (e *ExpectedPartitionStats) WillReturn(ret0 *driver.PartitionStats) *ExpectedPartitionStats
- func (e *ExpectedPartitionStats) WillReturnError(err error) *ExpectedPartitionStats
- func (e *ExpectedPartitionStats) WithName(name string) *ExpectedPartitionStats
- type ExpectedPing
- func (e *ExpectedPing) String() string
- func (e *ExpectedPing) WillDelay(delay time.Duration) *ExpectedPing
- func (e *ExpectedPing) WillExecute(cb func(ctx context.Context) (bool, error)) *ExpectedPing
- func (e *ExpectedPing) WillReturn(ret0 bool) *ExpectedPing
- func (e *ExpectedPing) WillReturnError(err error) *ExpectedPing
- type ExpectedPurge
- func (e *ExpectedPurge) String() string
- func (e *ExpectedPurge) WillDelay(delay time.Duration) *ExpectedPurge
- func (e *ExpectedPurge) WillExecute(...) *ExpectedPurge
- func (e *ExpectedPurge) WillReturn(ret0 *driver.PurgeResult) *ExpectedPurge
- func (e *ExpectedPurge) WillReturnError(err error) *ExpectedPurge
- func (e *ExpectedPurge) WithDocRevMap(docRevMap map[string][]string) *ExpectedPurge
- type ExpectedPut
- func (e *ExpectedPut) String() string
- func (e *ExpectedPut) WillDelay(delay time.Duration) *ExpectedPut
- func (e *ExpectedPut) WillExecute(...) *ExpectedPut
- func (e *ExpectedPut) WillReturn(ret0 string) *ExpectedPut
- func (e *ExpectedPut) WillReturnError(err error) *ExpectedPut
- func (e *ExpectedPut) WithDoc(doc interface{}) *ExpectedPut
- func (e *ExpectedPut) WithDocID(docID string) *ExpectedPut
- func (e *ExpectedPut) WithOptions(options ...kivik.Option) *ExpectedPut
- type ExpectedPutAttachment
- func (e *ExpectedPutAttachment) String() string
- func (e *ExpectedPutAttachment) WillDelay(delay time.Duration) *ExpectedPutAttachment
- func (e *ExpectedPutAttachment) WillExecute(...) *ExpectedPutAttachment
- func (e *ExpectedPutAttachment) WillReturn(ret0 string) *ExpectedPutAttachment
- func (e *ExpectedPutAttachment) WillReturnError(err error) *ExpectedPutAttachment
- func (e *ExpectedPutAttachment) WithAttachment(att *driver.Attachment) *ExpectedPutAttachment
- func (e *ExpectedPutAttachment) WithDocID(docID string) *ExpectedPutAttachment
- func (e *ExpectedPutAttachment) WithOptions(options ...kivik.Option) *ExpectedPutAttachment
- type ExpectedQuery
- func (e *ExpectedQuery) String() string
- func (e *ExpectedQuery) WillDelay(delay time.Duration) *ExpectedQuery
- func (e *ExpectedQuery) WillExecute(...) *ExpectedQuery
- func (e *ExpectedQuery) WillReturn(ret0 *Rows) *ExpectedQuery
- func (e *ExpectedQuery) WillReturnError(err error) *ExpectedQuery
- func (e *ExpectedQuery) WithDDocID(ddocID string) *ExpectedQuery
- func (e *ExpectedQuery) WithOptions(options ...kivik.Option) *ExpectedQuery
- func (e *ExpectedQuery) WithView(view string) *ExpectedQuery
- type ExpectedReplicate
- func (e *ExpectedReplicate) String() string
- func (e *ExpectedReplicate) WillDelay(delay time.Duration) *ExpectedReplicate
- func (e *ExpectedReplicate) WillExecute(...) *ExpectedReplicate
- func (e *ExpectedReplicate) WillReturn(ret0 *Replication) *ExpectedReplicate
- func (e *ExpectedReplicate) WillReturnError(err error) *ExpectedReplicate
- func (e *ExpectedReplicate) WithOptions(options ...kivik.Option) *ExpectedReplicate
- func (e *ExpectedReplicate) WithSource(source string) *ExpectedReplicate
- func (e *ExpectedReplicate) WithTarget(target string) *ExpectedReplicate
- type ExpectedRevsDiff
- func (e *ExpectedRevsDiff) String() string
- func (e *ExpectedRevsDiff) WillDelay(delay time.Duration) *ExpectedRevsDiff
- func (e *ExpectedRevsDiff) WillExecute(cb func(ctx context.Context, arg0 interface{}) (driver.Rows, error)) *ExpectedRevsDiff
- func (e *ExpectedRevsDiff) WillReturn(ret0 *Rows) *ExpectedRevsDiff
- func (e *ExpectedRevsDiff) WillReturnError(err error) *ExpectedRevsDiff
- func (e *ExpectedRevsDiff) WithRevLookup(revLookup interface{}) *ExpectedRevsDiff
- type ExpectedSecurity
- func (e *ExpectedSecurity) String() string
- func (e *ExpectedSecurity) WillDelay(delay time.Duration) *ExpectedSecurity
- func (e *ExpectedSecurity) WillExecute(cb func(ctx context.Context) (*driver.Security, error)) *ExpectedSecurity
- func (e *ExpectedSecurity) WillReturn(ret0 *driver.Security) *ExpectedSecurity
- func (e *ExpectedSecurity) WillReturnError(err error) *ExpectedSecurity
- type ExpectedSession
- func (e *ExpectedSession) String() string
- func (e *ExpectedSession) WillDelay(delay time.Duration) *ExpectedSession
- func (e *ExpectedSession) WillExecute(cb func(ctx context.Context) (*driver.Session, error)) *ExpectedSession
- func (e *ExpectedSession) WillReturn(ret0 *driver.Session) *ExpectedSession
- func (e *ExpectedSession) WillReturnError(err error) *ExpectedSession
- type ExpectedSetConfigValue
- func (e *ExpectedSetConfigValue) String() string
- func (e *ExpectedSetConfigValue) WillDelay(delay time.Duration) *ExpectedSetConfigValue
- func (e *ExpectedSetConfigValue) WillExecute(...) *ExpectedSetConfigValue
- func (e *ExpectedSetConfigValue) WillReturn(ret0 string) *ExpectedSetConfigValue
- func (e *ExpectedSetConfigValue) WillReturnError(err error) *ExpectedSetConfigValue
- func (e *ExpectedSetConfigValue) WithKey(key string) *ExpectedSetConfigValue
- func (e *ExpectedSetConfigValue) WithNode(node string) *ExpectedSetConfigValue
- func (e *ExpectedSetConfigValue) WithSection(section string) *ExpectedSetConfigValue
- func (e *ExpectedSetConfigValue) WithValue(value string) *ExpectedSetConfigValue
- type ExpectedSetSecurity
- func (e *ExpectedSetSecurity) String() string
- func (e *ExpectedSetSecurity) WillDelay(delay time.Duration) *ExpectedSetSecurity
- func (e *ExpectedSetSecurity) WillExecute(cb func(ctx context.Context, arg0 *driver.Security) error) *ExpectedSetSecurity
- func (e *ExpectedSetSecurity) WillReturnError(err error) *ExpectedSetSecurity
- func (e *ExpectedSetSecurity) WithSecurity(sec *driver.Security) *ExpectedSetSecurity
- type ExpectedStats
- func (e *ExpectedStats) String() string
- func (e *ExpectedStats) WillDelay(delay time.Duration) *ExpectedStats
- func (e *ExpectedStats) WillExecute(cb func(ctx context.Context) (*driver.DBStats, error)) *ExpectedStats
- func (e *ExpectedStats) WillReturn(ret0 *driver.DBStats) *ExpectedStats
- func (e *ExpectedStats) WillReturnError(err error) *ExpectedStats
- type ExpectedVersion
- func (e *ExpectedVersion) String() string
- func (e *ExpectedVersion) WillDelay(delay time.Duration) *ExpectedVersion
- func (e *ExpectedVersion) WillExecute(cb func(ctx context.Context) (*driver.Version, error)) *ExpectedVersion
- func (e *ExpectedVersion) WillReturn(ret0 *driver.Version) *ExpectedVersion
- func (e *ExpectedVersion) WillReturnError(err error) *ExpectedVersion
- type ExpectedViewCleanup
- func (e *ExpectedViewCleanup) String() string
- func (e *ExpectedViewCleanup) WillDelay(delay time.Duration) *ExpectedViewCleanup
- func (e *ExpectedViewCleanup) WillExecute(cb func(ctx context.Context) error) *ExpectedViewCleanup
- func (e *ExpectedViewCleanup) WillReturnError(err error) *ExpectedViewCleanup
- type Replication
- func (r *Replication) EndTime(t time.Time) *Replication
- func (r *Replication) Err(e error) *Replication
- func (r *Replication) ID(id string) *Replication
- func (r *Replication) MarshalJSON() ([]byte, error)
- func (r *Replication) Source(s string) *Replication
- func (r *Replication) StartTime(t time.Time) *Replication
- func (r *Replication) State(s kivik.ReplicationState) *Replication
- func (r *Replication) Target(t string) *Replication
- type Rows
- func (r *Rows) AddDelay(delay time.Duration) *Rows
- func (r *Rows) AddRow(row *driver.Row) *Rows
- func (r *Rows) AddRowError(err error) *Rows
- func (i *Rows) Close() error
- func (r *Rows) CloseError(err error) *Rows
- func (r *Rows) Final() driver.Rows
- func (r *Rows) Offset(offset int64) *Rows
- func (r *Rows) TotalRows(totalRows int64) *Rows
- func (r *Rows) UpdateSeq(seq string) *Rows
- func (r *Rows) Warning(warning string) *Rows
- type Updates
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Document ¶
Document converts i, which should be of a supported type (see below), into a document which can be passed to ExpectedGet.WillReturn().
i is checked against the following list of types, in order. If no match is found, an error is returned. Attachments is not populated by this method.
- string, []byte, or json.RawMessage (interpreted as a JSON string)
- io.Reader (assumes JSON can be read from the stream)
- any other JSON-marshalable object
Types ¶
type Changes ¶
type Changes struct {
// contains filtered or unexported fields
}
Changes is a mocked collection of Changes results.
func NewChanges ¶
func NewChanges() *Changes
NewChanges returns a new, empty changes set, which can be returned by the DB.Changes() expectation.
func (*Changes) AddChange ¶
AddChange adds a change result to be returned by the iterator. If AddResultError has been set, this method will panic.
func (*Changes) AddChangeError ¶
AddChangeError adds an error to be returned during iteration.
func (*Changes) CloseError ¶
CloseError sets an error to be returned when the iterator is closed.
func (*Changes) Final ¶
Final converts the Changes object to a driver.Changes. This method is intended for use within WillExecute() to return results.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client allows configuring the mock kivik client.
func (*Client) ExpectAllDBs ¶
func (c *Client) ExpectAllDBs() *ExpectedAllDBs
ExpectAllDBs queues an expectation that AllDBs will be called.
func (*Client) ExpectClose ¶
func (c *Client) ExpectClose() *ExpectedClose
ExpectClose queues an expectation that Close will be called.
func (*Client) ExpectClusterSetup ¶
func (c *Client) ExpectClusterSetup() *ExpectedClusterSetup
ExpectClusterSetup queues an expectation that ClusterSetup will be called.
func (*Client) ExpectClusterStatus ¶
func (c *Client) ExpectClusterStatus() *ExpectedClusterStatus
ExpectClusterStatus queues an expectation that ClusterStatus will be called.
func (*Client) ExpectConfig ¶
func (c *Client) ExpectConfig() *ExpectedConfig
ExpectConfig queues an expectation that Config will be called.
func (*Client) ExpectConfigSection ¶
func (c *Client) ExpectConfigSection() *ExpectedConfigSection
ExpectConfigSection queues an expectation that ConfigSection will be called.
func (*Client) ExpectConfigValue ¶
func (c *Client) ExpectConfigValue() *ExpectedConfigValue
ExpectConfigValue queues an expectation that ConfigValue will be called.
func (*Client) ExpectCreateDB ¶
func (c *Client) ExpectCreateDB() *ExpectedCreateDB
ExpectCreateDB queues an expectation for a CreateDB() call.
func (*Client) ExpectDB ¶
func (c *Client) ExpectDB() *ExpectedDB
ExpectDB queues an expectation that DB will be called.
func (*Client) ExpectDBExists ¶
func (c *Client) ExpectDBExists() *ExpectedDBExists
ExpectDBExists queues an expectation that DBExists will be called.
func (*Client) ExpectDBUpdates ¶
func (c *Client) ExpectDBUpdates() *ExpectedDBUpdates
ExpectDBUpdates queues an expectation that DBUpdates will be called.
func (*Client) ExpectDBsStats ¶
func (c *Client) ExpectDBsStats() *ExpectedDBsStats
ExpectDBsStats queues an expectation that DBsStats will be called.
func (*Client) ExpectDeleteConfigKey ¶
func (c *Client) ExpectDeleteConfigKey() *ExpectedDeleteConfigKey
ExpectDeleteConfigKey queues an expectation that DeleteConfigKey will be called.
func (*Client) ExpectDestroyDB ¶
func (c *Client) ExpectDestroyDB() *ExpectedDestroyDB
ExpectDestroyDB queues an expectation that DestroyDB will be called.
func (*Client) ExpectGetReplications ¶
func (c *Client) ExpectGetReplications() *ExpectedGetReplications
ExpectGetReplications queues an expectation that GetReplications will be called.
func (*Client) ExpectMembership ¶
func (c *Client) ExpectMembership() *ExpectedMembership
ExpectMembership queues an expectation that Membership will be called.
func (*Client) ExpectPing ¶
func (c *Client) ExpectPing() *ExpectedPing
ExpectPing queues an expectation that Ping will be called.
func (*Client) ExpectReplicate ¶
func (c *Client) ExpectReplicate() *ExpectedReplicate
ExpectReplicate queues an expectation that Replicate will be called.
func (*Client) ExpectSession ¶
func (c *Client) ExpectSession() *ExpectedSession
ExpectSession queues an expectation that Session will be called.
func (*Client) ExpectSetConfigValue ¶
func (c *Client) ExpectSetConfigValue() *ExpectedSetConfigValue
ExpectSetConfigValue queues an expectation that SetConfigValue will be called.
func (*Client) ExpectVersion ¶
func (c *Client) ExpectVersion() *ExpectedVersion
ExpectVersion queues an expectation that Version will be called.
func (*Client) ExpectationsWereMet ¶
ExpectationsWereMet returns an error if any outstanding expectatios were not met.
func (*Client) MatchExpectationsInOrder ¶
MatchExpectationsInOrder sets whether expectations should occur in the precise order in which they were defined.
func (*Client) NewDB ¶
NewDB creates a new mock DB object, which can be used along with ExpectDB() or ExpectCreateDB() calls to mock database actions.
func (*Client) NewReplication ¶
func (c *Client) NewReplication() *Replication
NewReplication returns a new, empty Replication.
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB serves to create expectations for database actions to mock and test real database behavior.
func (*DB) ExpectAllDocs ¶
func (db *DB) ExpectAllDocs() *ExpectedAllDocs
ExpectAllDocs queues an expectation that DB.AllDocs will be called.
func (*DB) ExpectBulkDocs ¶
func (db *DB) ExpectBulkDocs() *ExpectedBulkDocs
ExpectBulkDocs queues an expectation that DB.BulkDocs will be called.
func (*DB) ExpectBulkGet ¶
func (db *DB) ExpectBulkGet() *ExpectedBulkGet
ExpectBulkGet queues an expectation that DB.BulkGet will be called.
func (*DB) ExpectChanges ¶
func (db *DB) ExpectChanges() *ExpectedChanges
ExpectChanges queues an expectation that DB.Changes will be called.
func (*DB) ExpectClose ¶
func (db *DB) ExpectClose() *ExpectedDBClose
ExpectClose queues an expectation for DB.Close() to be called.
func (*DB) ExpectCompact ¶
func (db *DB) ExpectCompact() *ExpectedCompact
ExpectCompact queues an expectation that DB.Compact will be called.
func (*DB) ExpectCompactView ¶
func (db *DB) ExpectCompactView() *ExpectedCompactView
ExpectCompactView queues an expectation that DB.CompactView will be called.
func (*DB) ExpectCopy ¶
func (db *DB) ExpectCopy() *ExpectedCopy
ExpectCopy queues an expectation that DB.Copy will be called.
func (*DB) ExpectCreateDoc ¶
func (db *DB) ExpectCreateDoc() *ExpectedCreateDoc
ExpectCreateDoc queues an expectation that DB.CreateDoc will be called.
func (*DB) ExpectCreateIndex ¶
func (db *DB) ExpectCreateIndex() *ExpectedCreateIndex
ExpectCreateIndex queues an expectation that DB.CreateIndex will be called.
func (*DB) ExpectDelete ¶
func (db *DB) ExpectDelete() *ExpectedDelete
ExpectDelete queues an expectation that DB.Delete will be called.
func (*DB) ExpectDeleteAttachment ¶
func (db *DB) ExpectDeleteAttachment() *ExpectedDeleteAttachment
ExpectDeleteAttachment queues an expectation that DB.DeleteAttachment will be called.
func (*DB) ExpectDeleteIndex ¶
func (db *DB) ExpectDeleteIndex() *ExpectedDeleteIndex
ExpectDeleteIndex queues an expectation that DB.DeleteIndex will be called.
func (*DB) ExpectDesignDocs ¶
func (db *DB) ExpectDesignDocs() *ExpectedDesignDocs
ExpectDesignDocs queues an expectation that DB.DesignDocs will be called.
func (*DB) ExpectExplain ¶
func (db *DB) ExpectExplain() *ExpectedExplain
ExpectExplain queues an expectation that DB.Explain will be called.
func (*DB) ExpectFind ¶
func (db *DB) ExpectFind() *ExpectedFind
ExpectFind queues an expectation that DB.Find will be called.
func (*DB) ExpectFlush ¶
func (db *DB) ExpectFlush() *ExpectedFlush
ExpectFlush queues an expectation that DB.Flush will be called.
func (*DB) ExpectGet ¶
func (db *DB) ExpectGet() *ExpectedGet
ExpectGet queues an expectation that DB.Get will be called.
func (*DB) ExpectGetAttachment ¶
func (db *DB) ExpectGetAttachment() *ExpectedGetAttachment
ExpectGetAttachment queues an expectation that DB.GetAttachment will be called.
func (*DB) ExpectGetAttachmentMeta ¶
func (db *DB) ExpectGetAttachmentMeta() *ExpectedGetAttachmentMeta
ExpectGetAttachmentMeta queues an expectation that DB.GetAttachmentMeta will be called.
func (*DB) ExpectGetIndexes ¶
func (db *DB) ExpectGetIndexes() *ExpectedGetIndexes
ExpectGetIndexes queues an expectation that DB.GetIndexes will be called.
func (*DB) ExpectGetRev ¶
func (db *DB) ExpectGetRev() *ExpectedGetRev
ExpectGetRev queues an expectation that DB.GetRev will be called.
func (*DB) ExpectLocalDocs ¶
func (db *DB) ExpectLocalDocs() *ExpectedLocalDocs
ExpectLocalDocs queues an expectation that DB.LocalDocs will be called.
func (*DB) ExpectOpenRevs ¶
func (db *DB) ExpectOpenRevs() *ExpectedOpenRevs
ExpectOpenRevs queues an expectation that DB.OpenRevs will be called.
func (*DB) ExpectPartitionStats ¶
func (db *DB) ExpectPartitionStats() *ExpectedPartitionStats
ExpectPartitionStats queues an expectation that DB.PartitionStats will be called.
func (*DB) ExpectPurge ¶
func (db *DB) ExpectPurge() *ExpectedPurge
ExpectPurge queues an expectation that DB.Purge will be called.
func (*DB) ExpectPut ¶
func (db *DB) ExpectPut() *ExpectedPut
ExpectPut queues an expectation that DB.Put will be called.
func (*DB) ExpectPutAttachment ¶
func (db *DB) ExpectPutAttachment() *ExpectedPutAttachment
ExpectPutAttachment queues an expectation that DB.PutAttachment will be called.
func (*DB) ExpectQuery ¶
func (db *DB) ExpectQuery() *ExpectedQuery
ExpectQuery queues an expectation that DB.Query will be called.
func (*DB) ExpectRevsDiff ¶
func (db *DB) ExpectRevsDiff() *ExpectedRevsDiff
ExpectRevsDiff queues an expectation that DB.RevsDiff will be called.
func (*DB) ExpectSecurity ¶
func (db *DB) ExpectSecurity() *ExpectedSecurity
ExpectSecurity queues an expectation that DB.Security will be called.
func (*DB) ExpectSetSecurity ¶
func (db *DB) ExpectSetSecurity() *ExpectedSetSecurity
ExpectSetSecurity queues an expectation that DB.SetSecurity will be called.
func (*DB) ExpectStats ¶
func (db *DB) ExpectStats() *ExpectedStats
ExpectStats queues an expectation that DB.Stats will be called.
func (*DB) ExpectViewCleanup ¶
func (db *DB) ExpectViewCleanup() *ExpectedViewCleanup
ExpectViewCleanup queues an expectation that DB.ViewCleanup will be called.
type ExpectedAllDBs ¶
type ExpectedAllDBs struct {
// contains filtered or unexported fields
}
ExpectedAllDBs represents an expectation for a call to AllDBs().
func (*ExpectedAllDBs) String ¶
func (e *ExpectedAllDBs) String() string
String satisfies the fmt.Stringer interface.
func (*ExpectedAllDBs) WillDelay ¶
func (e *ExpectedAllDBs) WillDelay(delay time.Duration) *ExpectedAllDBs
WillDelay causes the call to AllDBs() to delay.
func (*ExpectedAllDBs) WillExecute ¶
func (e *ExpectedAllDBs) WillExecute(cb func(ctx context.Context, options driver.Options) ([]string, error)) *ExpectedAllDBs
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedAllDBs) WillReturn ¶
func (e *ExpectedAllDBs) WillReturn(ret0 []string) *ExpectedAllDBs
WillReturn sets the values that will be returned by the call to AllDBs().
func (*ExpectedAllDBs) WillReturnError ¶
func (e *ExpectedAllDBs) WillReturnError(err error) *ExpectedAllDBs
WillReturnError sets the error value that will be returned by the call to AllDBs().
func (*ExpectedAllDBs) WithOptions ¶
func (e *ExpectedAllDBs) WithOptions(options ...kivik.Option) *ExpectedAllDBs
WithOptions sets the expected options for the call to AllDBs().
type ExpectedAllDocs ¶
type ExpectedAllDocs struct {
// contains filtered or unexported fields
}
ExpectedAllDocs represents an expectation for a call to DB.AllDocs().
func (*ExpectedAllDocs) String ¶
func (e *ExpectedAllDocs) String() string
func (*ExpectedAllDocs) WillDelay ¶
func (e *ExpectedAllDocs) WillDelay(delay time.Duration) *ExpectedAllDocs
WillDelay causes the call to DB.AllDocs() to delay.
func (*ExpectedAllDocs) WillExecute ¶
func (e *ExpectedAllDocs) WillExecute(cb func(ctx context.Context, options driver.Options) (driver.Rows, error)) *ExpectedAllDocs
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedAllDocs) WillReturn ¶
func (e *ExpectedAllDocs) WillReturn(ret0 *Rows) *ExpectedAllDocs
WillReturn sets the values that will be returned by the call to DB.AllDocs().
func (*ExpectedAllDocs) WillReturnError ¶
func (e *ExpectedAllDocs) WillReturnError(err error) *ExpectedAllDocs
WillReturnError sets the error value that will be returned by the call to DB.AllDocs().
func (*ExpectedAllDocs) WithOptions ¶
func (e *ExpectedAllDocs) WithOptions(options ...kivik.Option) *ExpectedAllDocs
WithOptions sets the expected options for the call to DB.AllDocs().
type ExpectedBulkDocs ¶
type ExpectedBulkDocs struct {
// contains filtered or unexported fields
}
ExpectedBulkDocs represents an expectation for a call to DB.BulkDocs().
func (*ExpectedBulkDocs) String ¶
func (e *ExpectedBulkDocs) String() string
func (*ExpectedBulkDocs) WillDelay ¶
func (e *ExpectedBulkDocs) WillDelay(delay time.Duration) *ExpectedBulkDocs
WillDelay causes the call to DB.BulkDocs() to delay.
func (*ExpectedBulkDocs) WillExecute ¶
func (e *ExpectedBulkDocs) WillExecute(cb func(ctx context.Context, arg0 []interface{}, options driver.Options) ([]driver.BulkResult, error)) *ExpectedBulkDocs
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedBulkDocs) WillReturn ¶
func (e *ExpectedBulkDocs) WillReturn(ret0 []driver.BulkResult) *ExpectedBulkDocs
WillReturn sets the values that will be returned by the call to DB.BulkDocs().
func (*ExpectedBulkDocs) WillReturnError ¶
func (e *ExpectedBulkDocs) WillReturnError(err error) *ExpectedBulkDocs
WillReturnError sets the error value that will be returned by the call to DB.BulkDocs().
func (*ExpectedBulkDocs) WithOptions ¶
func (e *ExpectedBulkDocs) WithOptions(options ...kivik.Option) *ExpectedBulkDocs
WithOptions sets the expected options for the call to DB.BulkDocs().
type ExpectedBulkGet ¶
type ExpectedBulkGet struct {
// contains filtered or unexported fields
}
ExpectedBulkGet represents an expectation for a call to DB.BulkGet().
func (*ExpectedBulkGet) String ¶
func (e *ExpectedBulkGet) String() string
func (*ExpectedBulkGet) WillDelay ¶
func (e *ExpectedBulkGet) WillDelay(delay time.Duration) *ExpectedBulkGet
WillDelay causes the call to DB.BulkGet() to delay.
func (*ExpectedBulkGet) WillExecute ¶
func (e *ExpectedBulkGet) WillExecute(cb func(ctx context.Context, arg0 []driver.BulkGetReference, options driver.Options) (driver.Rows, error)) *ExpectedBulkGet
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedBulkGet) WillReturn ¶
func (e *ExpectedBulkGet) WillReturn(ret0 *Rows) *ExpectedBulkGet
WillReturn sets the values that will be returned by the call to DB.BulkGet().
func (*ExpectedBulkGet) WillReturnError ¶
func (e *ExpectedBulkGet) WillReturnError(err error) *ExpectedBulkGet
WillReturnError sets the error value that will be returned by the call to DB.BulkGet().
func (*ExpectedBulkGet) WithOptions ¶
func (e *ExpectedBulkGet) WithOptions(options ...kivik.Option) *ExpectedBulkGet
WithOptions sets the expected options for the call to DB.BulkGet().
type ExpectedChanges ¶
type ExpectedChanges struct {
// contains filtered or unexported fields
}
ExpectedChanges represents an expectation for a call to DB.Changes().
func (*ExpectedChanges) String ¶
func (e *ExpectedChanges) String() string
func (*ExpectedChanges) WillDelay ¶
func (e *ExpectedChanges) WillDelay(delay time.Duration) *ExpectedChanges
WillDelay causes the call to DB.Changes() to delay.
func (*ExpectedChanges) WillExecute ¶
func (e *ExpectedChanges) WillExecute(cb func(ctx context.Context, options driver.Options) (driver.Changes, error)) *ExpectedChanges
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedChanges) WillReturn ¶
func (e *ExpectedChanges) WillReturn(ret0 *Changes) *ExpectedChanges
WillReturn sets the values that will be returned by the call to DB.Changes().
func (*ExpectedChanges) WillReturnError ¶
func (e *ExpectedChanges) WillReturnError(err error) *ExpectedChanges
WillReturnError sets the error value that will be returned by the call to DB.Changes().
func (*ExpectedChanges) WithOptions ¶
func (e *ExpectedChanges) WithOptions(options ...kivik.Option) *ExpectedChanges
WithOptions sets the expected options for the call to DB.Changes().
type ExpectedClose ¶
type ExpectedClose struct {
// contains filtered or unexported fields
}
ExpectedClose represents an expectation for a call to Close().
func (*ExpectedClose) String ¶
func (e *ExpectedClose) String() string
func (*ExpectedClose) WillExecute ¶
func (e *ExpectedClose) WillExecute(cb func() error) *ExpectedClose
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedClose) WillReturnError ¶
func (e *ExpectedClose) WillReturnError(err error) *ExpectedClose
WillReturnError sets the error value that will be returned by the call to Close().
type ExpectedClusterSetup ¶
type ExpectedClusterSetup struct {
// contains filtered or unexported fields
}
ExpectedClusterSetup represents an expectation for a call to ClusterSetup().
func (*ExpectedClusterSetup) String ¶
func (e *ExpectedClusterSetup) String() string
func (*ExpectedClusterSetup) WillDelay ¶
func (e *ExpectedClusterSetup) WillDelay(delay time.Duration) *ExpectedClusterSetup
WillDelay causes the call to ClusterSetup() to delay.
func (*ExpectedClusterSetup) WillExecute ¶
func (e *ExpectedClusterSetup) WillExecute(cb func(ctx context.Context, arg0 interface{}) error) *ExpectedClusterSetup
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedClusterSetup) WillReturnError ¶
func (e *ExpectedClusterSetup) WillReturnError(err error) *ExpectedClusterSetup
WillReturnError sets the error value that will be returned by the call to ClusterSetup().
func (*ExpectedClusterSetup) WithAction ¶
func (e *ExpectedClusterSetup) WithAction(action interface{}) *ExpectedClusterSetup
WithAction specifies the action to be matched. Note that this expectation is compared with the actual action's marshaled JSON output, so it is not essential that the data types match exactly, in a Go sense.
type ExpectedClusterStatus ¶
type ExpectedClusterStatus struct {
// contains filtered or unexported fields
}
ExpectedClusterStatus represents an expectation for a call to ClusterStatus().
func (*ExpectedClusterStatus) String ¶
func (e *ExpectedClusterStatus) String() string
String satisfies the fmt.Stringer interface
func (*ExpectedClusterStatus) WillDelay ¶
func (e *ExpectedClusterStatus) WillDelay(delay time.Duration) *ExpectedClusterStatus
WillDelay causes the call to ClusterStatus() to delay.
func (*ExpectedClusterStatus) WillExecute ¶
func (e *ExpectedClusterStatus) WillExecute(cb func(ctx context.Context, options driver.Options) (string, error)) *ExpectedClusterStatus
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedClusterStatus) WillReturn ¶
func (e *ExpectedClusterStatus) WillReturn(ret0 string) *ExpectedClusterStatus
WillReturn sets the values that will be returned by the call to ClusterStatus().
func (*ExpectedClusterStatus) WillReturnError ¶
func (e *ExpectedClusterStatus) WillReturnError(err error) *ExpectedClusterStatus
WillReturnError sets the error value that will be returned by the call to ClusterStatus().
func (*ExpectedClusterStatus) WithOptions ¶
func (e *ExpectedClusterStatus) WithOptions(options ...kivik.Option) *ExpectedClusterStatus
WithOptions sets the expected options for the call to ClusterStatus().
type ExpectedCompact ¶
type ExpectedCompact struct {
// contains filtered or unexported fields
}
ExpectedCompact represents an expectation for a call to DB.Compact().
func (*ExpectedCompact) String ¶
func (e *ExpectedCompact) String() string
func (*ExpectedCompact) WillDelay ¶
func (e *ExpectedCompact) WillDelay(delay time.Duration) *ExpectedCompact
WillDelay causes the call to DB.Compact() to delay.
func (*ExpectedCompact) WillExecute ¶
func (e *ExpectedCompact) WillExecute(cb func(ctx context.Context) error) *ExpectedCompact
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedCompact) WillReturnError ¶
func (e *ExpectedCompact) WillReturnError(err error) *ExpectedCompact
WillReturnError sets the error value that will be returned by the call to DB.Compact().
type ExpectedCompactView ¶
type ExpectedCompactView struct {
// contains filtered or unexported fields
}
ExpectedCompactView represents an expectation for a call to DB.CompactView().
func (*ExpectedCompactView) String ¶
func (e *ExpectedCompactView) String() string
func (*ExpectedCompactView) WillDelay ¶
func (e *ExpectedCompactView) WillDelay(delay time.Duration) *ExpectedCompactView
WillDelay causes the call to DB.CompactView() to delay.
func (*ExpectedCompactView) WillExecute ¶
func (e *ExpectedCompactView) WillExecute(cb func(ctx context.Context, arg0 string) error) *ExpectedCompactView
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedCompactView) WillReturnError ¶
func (e *ExpectedCompactView) WillReturnError(err error) *ExpectedCompactView
WillReturnError sets the error value that will be returned by the call to DB.CompactView().
func (*ExpectedCompactView) WithDDoc ¶
func (e *ExpectedCompactView) WithDDoc(ddocID string) *ExpectedCompactView
WithDDoc sets the expected design doc name for the call to DB.CompactView().
type ExpectedConfig ¶
type ExpectedConfig struct {
// contains filtered or unexported fields
}
ExpectedConfig represents an expectation for a call to Config().
func (*ExpectedConfig) String ¶
func (e *ExpectedConfig) String() string
func (*ExpectedConfig) WillDelay ¶
func (e *ExpectedConfig) WillDelay(delay time.Duration) *ExpectedConfig
WillDelay causes the call to Config() to delay.
func (*ExpectedConfig) WillExecute ¶
func (e *ExpectedConfig) WillExecute(cb func(ctx context.Context, arg0 string) (driver.Config, error)) *ExpectedConfig
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedConfig) WillReturn ¶
func (e *ExpectedConfig) WillReturn(ret0 driver.Config) *ExpectedConfig
WillReturn sets the values that will be returned by the call to Config().
func (*ExpectedConfig) WillReturnError ¶
func (e *ExpectedConfig) WillReturnError(err error) *ExpectedConfig
WillReturnError sets the error value that will be returned by the call to Config().
func (*ExpectedConfig) WithNode ¶
func (e *ExpectedConfig) WithNode(node string) *ExpectedConfig
WithNode sets the expected node.
type ExpectedConfigSection ¶
type ExpectedConfigSection struct {
// contains filtered or unexported fields
}
ExpectedConfigSection represents an expectation for a call to ConfigSection().
func (*ExpectedConfigSection) String ¶
func (e *ExpectedConfigSection) String() string
func (*ExpectedConfigSection) WillDelay ¶
func (e *ExpectedConfigSection) WillDelay(delay time.Duration) *ExpectedConfigSection
WillDelay causes the call to ConfigSection() to delay.
func (*ExpectedConfigSection) WillExecute ¶
func (e *ExpectedConfigSection) WillExecute(cb func(ctx context.Context, arg0 string, arg1 string) (driver.ConfigSection, error)) *ExpectedConfigSection
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedConfigSection) WillReturn ¶
func (e *ExpectedConfigSection) WillReturn(ret0 driver.ConfigSection) *ExpectedConfigSection
WillReturn sets the values that will be returned by the call to ConfigSection().
func (*ExpectedConfigSection) WillReturnError ¶
func (e *ExpectedConfigSection) WillReturnError(err error) *ExpectedConfigSection
WillReturnError sets the error value that will be returned by the call to ConfigSection().
func (*ExpectedConfigSection) WithNode ¶
func (e *ExpectedConfigSection) WithNode(node string) *ExpectedConfigSection
WithNode sets the expected node.
func (*ExpectedConfigSection) WithSection ¶
func (e *ExpectedConfigSection) WithSection(section string) *ExpectedConfigSection
WithSection sets the expected section.
type ExpectedConfigValue ¶
type ExpectedConfigValue struct {
// contains filtered or unexported fields
}
ExpectedConfigValue represents an expectation for a call to ConfigValue().
func (*ExpectedConfigValue) String ¶
func (e *ExpectedConfigValue) String() string
func (*ExpectedConfigValue) WillDelay ¶
func (e *ExpectedConfigValue) WillDelay(delay time.Duration) *ExpectedConfigValue
WillDelay causes the call to ConfigValue() to delay.
func (*ExpectedConfigValue) WillExecute ¶
func (e *ExpectedConfigValue) WillExecute(cb func(ctx context.Context, arg0 string, arg1 string, arg2 string) (string, error)) *ExpectedConfigValue
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedConfigValue) WillReturn ¶
func (e *ExpectedConfigValue) WillReturn(ret0 string) *ExpectedConfigValue
WillReturn sets the values that will be returned by the call to ConfigValue().
func (*ExpectedConfigValue) WillReturnError ¶
func (e *ExpectedConfigValue) WillReturnError(err error) *ExpectedConfigValue
WillReturnError sets the error value that will be returned by the call to ConfigValue().
func (*ExpectedConfigValue) WithKey ¶
func (e *ExpectedConfigValue) WithKey(key string) *ExpectedConfigValue
WithKey sets the expected key.
func (*ExpectedConfigValue) WithNode ¶
func (e *ExpectedConfigValue) WithNode(node string) *ExpectedConfigValue
WithNode sets the expected node.
func (*ExpectedConfigValue) WithSection ¶
func (e *ExpectedConfigValue) WithSection(section string) *ExpectedConfigValue
WithSection sets the expected section.
type ExpectedCopy ¶
type ExpectedCopy struct {
// contains filtered or unexported fields
}
ExpectedCopy represents an expectation for a call to DB.Copy().
func (*ExpectedCopy) String ¶
func (e *ExpectedCopy) String() string
func (*ExpectedCopy) WillDelay ¶
func (e *ExpectedCopy) WillDelay(delay time.Duration) *ExpectedCopy
WillDelay causes the call to DB.Copy() to delay.
func (*ExpectedCopy) WillExecute ¶
func (e *ExpectedCopy) WillExecute(cb func(ctx context.Context, arg0 string, arg1 string, options driver.Options) (string, error)) *ExpectedCopy
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedCopy) WillReturn ¶
func (e *ExpectedCopy) WillReturn(ret0 string) *ExpectedCopy
WillReturn sets the values that will be returned by the call to DB.Copy().
func (*ExpectedCopy) WillReturnError ¶
func (e *ExpectedCopy) WillReturnError(err error) *ExpectedCopy
WillReturnError sets the error value that will be returned by the call to DB.Copy().
func (*ExpectedCopy) WithOptions ¶
func (e *ExpectedCopy) WithOptions(options ...kivik.Option) *ExpectedCopy
WithOptions sets the expected options for the call to DB.Copy().
func (*ExpectedCopy) WithSourceID ¶
func (e *ExpectedCopy) WithSourceID(docID string) *ExpectedCopy
WithSourceID sets the expectation for the docID passed to the DB.Copy() call.
func (*ExpectedCopy) WithTargetID ¶
func (e *ExpectedCopy) WithTargetID(docID string) *ExpectedCopy
WithTargetID sets the expectation for the docID passed to the DB.Copy() call.
type ExpectedCreateDB ¶
type ExpectedCreateDB struct {
// contains filtered or unexported fields
}
ExpectedCreateDB represents an expectation to call the CreateDB() method.
Implementation note: Because kivik always calls DB() after a successful CreateDB() is executed, ExpectCreateDB() creates two expectations under the covers, one for the backend CreateDB() call, and one for the DB() call. If WillReturnError() is called, the DB() call expectation is removed.
func (*ExpectedCreateDB) String ¶
func (e *ExpectedCreateDB) String() string
func (*ExpectedCreateDB) WillDelay ¶
func (e *ExpectedCreateDB) WillDelay(delay time.Duration) *ExpectedCreateDB
WillDelay will cause execution of DB() to delay by duration d.
func (*ExpectedCreateDB) WillExecute ¶
func (e *ExpectedCreateDB) WillExecute(cb func(ctx context.Context, arg0 string, options driver.Options) error) *ExpectedCreateDB
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedCreateDB) WillReturnError ¶
func (e *ExpectedCreateDB) WillReturnError(err error) *ExpectedCreateDB
WillReturnError sets the return value for the DB() call.
func (*ExpectedCreateDB) WithName ¶
func (e *ExpectedCreateDB) WithName(name string) *ExpectedCreateDB
WithName sets the expectation that DB() will be called with this name.
func (*ExpectedCreateDB) WithOptions ¶
func (e *ExpectedCreateDB) WithOptions(options ...kivik.Option) *ExpectedCreateDB
WithOptions set the expectation that DB() will be called with these options.
type ExpectedCreateDoc ¶
type ExpectedCreateDoc struct {
// contains filtered or unexported fields
}
ExpectedCreateDoc represents an expectation for a call to DB.CreateDoc().
func (*ExpectedCreateDoc) String ¶
func (e *ExpectedCreateDoc) String() string
func (*ExpectedCreateDoc) WillDelay ¶
func (e *ExpectedCreateDoc) WillDelay(delay time.Duration) *ExpectedCreateDoc
WillDelay causes the call to DB.CreateDoc() to delay.
func (*ExpectedCreateDoc) WillExecute ¶
func (e *ExpectedCreateDoc) WillExecute(cb func(ctx context.Context, arg0 interface{}, options driver.Options) (string, string, error)) *ExpectedCreateDoc
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedCreateDoc) WillReturn ¶
func (e *ExpectedCreateDoc) WillReturn(ret0 string, ret1 string) *ExpectedCreateDoc
WillReturn sets the values that will be returned by the call to DB.CreateDoc().
func (*ExpectedCreateDoc) WillReturnError ¶
func (e *ExpectedCreateDoc) WillReturnError(err error) *ExpectedCreateDoc
WillReturnError sets the error value that will be returned by the call to DB.CreateDoc().
func (*ExpectedCreateDoc) WithDoc ¶
func (e *ExpectedCreateDoc) WithDoc(doc interface{}) *ExpectedCreateDoc
WithDoc sets the expected doc for the call to CreateDoc().
func (*ExpectedCreateDoc) WithOptions ¶
func (e *ExpectedCreateDoc) WithOptions(options ...kivik.Option) *ExpectedCreateDoc
WithOptions sets the expected options for the call to DB.CreateDoc().
type ExpectedCreateIndex ¶
type ExpectedCreateIndex struct {
// contains filtered or unexported fields
}
ExpectedCreateIndex represents an expectation for a call to DB.CreateIndex().
func (*ExpectedCreateIndex) String ¶
func (e *ExpectedCreateIndex) String() string
func (*ExpectedCreateIndex) WillDelay ¶
func (e *ExpectedCreateIndex) WillDelay(delay time.Duration) *ExpectedCreateIndex
WillDelay causes the call to DB.CreateIndex() to delay.
func (*ExpectedCreateIndex) WillExecute ¶
func (e *ExpectedCreateIndex) WillExecute(cb func(ctx context.Context, arg0 string, arg1 string, arg2 interface{}, options driver.Options) error) *ExpectedCreateIndex
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedCreateIndex) WillReturnError ¶
func (e *ExpectedCreateIndex) WillReturnError(err error) *ExpectedCreateIndex
WillReturnError sets the error value that will be returned by the call to DB.CreateIndex().
func (*ExpectedCreateIndex) WithDDocID ¶
func (e *ExpectedCreateIndex) WithDDocID(ddocID string) *ExpectedCreateIndex
WithDDocID sets the expected ddocID value for the DB.CreateIndex() call.
func (*ExpectedCreateIndex) WithIndex ¶
func (e *ExpectedCreateIndex) WithIndex(index interface{}) *ExpectedCreateIndex
WithIndex sets the expected index value for the DB.CreateIndex() call.
func (*ExpectedCreateIndex) WithName ¶
func (e *ExpectedCreateIndex) WithName(name string) *ExpectedCreateIndex
WithName sets the expected name value for the DB.CreateIndex() call.
func (*ExpectedCreateIndex) WithOptions ¶
func (e *ExpectedCreateIndex) WithOptions(options ...kivik.Option) *ExpectedCreateIndex
WithOptions sets the expected options for the call to DB.CreateIndex().
type ExpectedDB ¶
type ExpectedDB struct {
// contains filtered or unexported fields
}
ExpectedDB represents an expectation for a call to DB().
func (*ExpectedDB) String ¶
func (e *ExpectedDB) String() string
func (*ExpectedDB) WillExecute ¶
func (e *ExpectedDB) WillExecute(cb func(arg0 string, options driver.Options) (driver.DB, error)) *ExpectedDB
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedDB) WillReturn ¶
func (e *ExpectedDB) WillReturn(ret0 *DB) *ExpectedDB
WillReturn sets the values that will be returned by the call to DB().
func (*ExpectedDB) WillReturnError ¶
func (e *ExpectedDB) WillReturnError(err error) *ExpectedDB
WillReturnError sets the error value that will be returned by the call to DB().
func (*ExpectedDB) WithName ¶
func (e *ExpectedDB) WithName(name string) *ExpectedDB
WithName sets the expectation that DB() will be called with this name.
func (*ExpectedDB) WithOptions ¶
func (e *ExpectedDB) WithOptions(options ...kivik.Option) *ExpectedDB
WithOptions sets the expected options for the call to DB().
type ExpectedDBClose ¶
type ExpectedDBClose struct {
// contains filtered or unexported fields
}
ExpectedDBClose is used to manage *kivik.Client.Close expectation returned by Mock.ExpectClose.
func (*ExpectedDBClose) String ¶
func (e *ExpectedDBClose) String() string
func (*ExpectedDBClose) WillExecute ¶
func (e *ExpectedDBClose) WillExecute(cb func() error) *ExpectedDBClose
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedDBClose) WillReturnError ¶
func (e *ExpectedDBClose) WillReturnError(err error) *ExpectedDBClose
WillReturnError allows setting an error for *kivik.Client.Close action.
type ExpectedDBExists ¶
type ExpectedDBExists struct {
// contains filtered or unexported fields
}
ExpectedDBExists represents an expectation for a call to DBExists().
func (*ExpectedDBExists) String ¶
func (e *ExpectedDBExists) String() string
func (*ExpectedDBExists) WillDelay ¶
func (e *ExpectedDBExists) WillDelay(delay time.Duration) *ExpectedDBExists
WillDelay causes the call to DBExists() to delay.
func (*ExpectedDBExists) WillExecute ¶
func (e *ExpectedDBExists) WillExecute(cb func(ctx context.Context, arg0 string, options driver.Options) (bool, error)) *ExpectedDBExists
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedDBExists) WillReturn ¶
func (e *ExpectedDBExists) WillReturn(ret0 bool) *ExpectedDBExists
WillReturn sets the values that will be returned by the call to DBExists().
func (*ExpectedDBExists) WillReturnError ¶
func (e *ExpectedDBExists) WillReturnError(err error) *ExpectedDBExists
WillReturnError sets the error value that will be returned by the call to DBExists().
func (*ExpectedDBExists) WithName ¶
func (e *ExpectedDBExists) WithName(name string) *ExpectedDBExists
WithName sets the expectation that DBExists will be called with the provided name.
func (*ExpectedDBExists) WithOptions ¶
func (e *ExpectedDBExists) WithOptions(options ...kivik.Option) *ExpectedDBExists
WithOptions sets the expected options for the call to DBExists().
type ExpectedDBUpdates ¶
type ExpectedDBUpdates struct {
// contains filtered or unexported fields
}
ExpectedDBUpdates represents an expectation for a call to DBUpdates().
func (*ExpectedDBUpdates) String ¶
func (e *ExpectedDBUpdates) String() string
func (*ExpectedDBUpdates) WillDelay ¶
func (e *ExpectedDBUpdates) WillDelay(delay time.Duration) *ExpectedDBUpdates
WillDelay causes the call to DBUpdates() to delay.
func (*ExpectedDBUpdates) WillExecute ¶
func (e *ExpectedDBUpdates) WillExecute(cb func(ctx context.Context, options driver.Options) (driver.DBUpdates, error)) *ExpectedDBUpdates
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedDBUpdates) WillReturn ¶
func (e *ExpectedDBUpdates) WillReturn(ret0 *Updates) *ExpectedDBUpdates
WillReturn sets the values that will be returned by the call to DBUpdates().
func (*ExpectedDBUpdates) WillReturnError ¶
func (e *ExpectedDBUpdates) WillReturnError(err error) *ExpectedDBUpdates
WillReturnError sets the error value that will be returned by the call to DBUpdates().
func (*ExpectedDBUpdates) WithOptions ¶
func (e *ExpectedDBUpdates) WithOptions(options ...kivik.Option) *ExpectedDBUpdates
WithOptions sets the expected options for the call to DBUpdates().
type ExpectedDBsStats ¶
type ExpectedDBsStats struct {
// contains filtered or unexported fields
}
ExpectedDBsStats represents an expectation for a call to DBsStats().
func (*ExpectedDBsStats) String ¶
func (e *ExpectedDBsStats) String() string
func (*ExpectedDBsStats) WillDelay ¶
func (e *ExpectedDBsStats) WillDelay(delay time.Duration) *ExpectedDBsStats
WillDelay causes the call to DBsStats() to delay.
func (*ExpectedDBsStats) WillExecute ¶
func (e *ExpectedDBsStats) WillExecute(cb func(ctx context.Context, arg0 []string) ([]*driver.DBStats, error)) *ExpectedDBsStats
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedDBsStats) WillReturn ¶
func (e *ExpectedDBsStats) WillReturn(ret0 []*driver.DBStats) *ExpectedDBsStats
WillReturn sets the values that will be returned by the call to DBsStats().
func (*ExpectedDBsStats) WillReturnError ¶
func (e *ExpectedDBsStats) WillReturnError(err error) *ExpectedDBsStats
WillReturnError sets the error value that will be returned by the call to DBsStats().
func (*ExpectedDBsStats) WithNames ¶
func (e *ExpectedDBsStats) WithNames(names []string) *ExpectedDBsStats
WithNames sets the expectation that DBsStats will be called with these names.
type ExpectedDelete ¶
type ExpectedDelete struct {
// contains filtered or unexported fields
}
ExpectedDelete represents an expectation for a call to DB.Delete().
func (*ExpectedDelete) String ¶
func (e *ExpectedDelete) String() string
func (*ExpectedDelete) WillDelay ¶
func (e *ExpectedDelete) WillDelay(delay time.Duration) *ExpectedDelete
WillDelay causes the call to DB.Delete() to delay.
func (*ExpectedDelete) WillExecute ¶
func (e *ExpectedDelete) WillExecute(cb func(ctx context.Context, arg0 string, options driver.Options) (string, error)) *ExpectedDelete
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedDelete) WillReturn ¶
func (e *ExpectedDelete) WillReturn(ret0 string) *ExpectedDelete
WillReturn sets the values that will be returned by the call to DB.Delete().
func (*ExpectedDelete) WillReturnError ¶
func (e *ExpectedDelete) WillReturnError(err error) *ExpectedDelete
WillReturnError sets the error value that will be returned by the call to DB.Delete().
func (*ExpectedDelete) WithDocID ¶
func (e *ExpectedDelete) WithDocID(docID string) *ExpectedDelete
WithDocID sets the expectation for the docID passed to the DB.Delete() call.
func (*ExpectedDelete) WithOptions ¶
func (e *ExpectedDelete) WithOptions(options ...kivik.Option) *ExpectedDelete
WithOptions sets the expected options for the call to DB.Delete().
type ExpectedDeleteAttachment ¶
type ExpectedDeleteAttachment struct {
// contains filtered or unexported fields
}
ExpectedDeleteAttachment represents an expectation for a call to DB.DeleteAttachment().
func (*ExpectedDeleteAttachment) String ¶
func (e *ExpectedDeleteAttachment) String() string
func (*ExpectedDeleteAttachment) WillDelay ¶
func (e *ExpectedDeleteAttachment) WillDelay(delay time.Duration) *ExpectedDeleteAttachment
WillDelay causes the call to DB.DeleteAttachment() to delay.
func (*ExpectedDeleteAttachment) WillExecute ¶
func (e *ExpectedDeleteAttachment) WillExecute(cb func(ctx context.Context, arg0 string, arg1 string, options driver.Options) (string, error)) *ExpectedDeleteAttachment
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedDeleteAttachment) WillReturn ¶
func (e *ExpectedDeleteAttachment) WillReturn(ret0 string) *ExpectedDeleteAttachment
WillReturn sets the values that will be returned by the call to DB.DeleteAttachment().
func (*ExpectedDeleteAttachment) WillReturnError ¶
func (e *ExpectedDeleteAttachment) WillReturnError(err error) *ExpectedDeleteAttachment
WillReturnError sets the error value that will be returned by the call to DB.DeleteAttachment().
func (*ExpectedDeleteAttachment) WithDocID ¶
func (e *ExpectedDeleteAttachment) WithDocID(docID string) *ExpectedDeleteAttachment
WithDocID sets the expectation for the docID passed to the DB.DeleteAttachment() call.
func (*ExpectedDeleteAttachment) WithFilename ¶
func (e *ExpectedDeleteAttachment) WithFilename(filename string) *ExpectedDeleteAttachment
WithFilename sets the expectation for the filename passed to the DB.DeleteAttachment() call.
func (*ExpectedDeleteAttachment) WithOptions ¶
func (e *ExpectedDeleteAttachment) WithOptions(options ...kivik.Option) *ExpectedDeleteAttachment
WithOptions sets the expected options for the call to DB.DeleteAttachment().
type ExpectedDeleteConfigKey ¶
type ExpectedDeleteConfigKey struct {
// contains filtered or unexported fields
}
ExpectedDeleteConfigKey represents an expectation for a call to DeleteConfigKey().
func (*ExpectedDeleteConfigKey) String ¶
func (e *ExpectedDeleteConfigKey) String() string
func (*ExpectedDeleteConfigKey) WillDelay ¶
func (e *ExpectedDeleteConfigKey) WillDelay(delay time.Duration) *ExpectedDeleteConfigKey
WillDelay causes the call to DeleteConfigKey() to delay.
func (*ExpectedDeleteConfigKey) WillExecute ¶
func (e *ExpectedDeleteConfigKey) WillExecute(cb func(ctx context.Context, arg0 string, arg1 string, arg2 string) (string, error)) *ExpectedDeleteConfigKey
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedDeleteConfigKey) WillReturn ¶
func (e *ExpectedDeleteConfigKey) WillReturn(ret0 string) *ExpectedDeleteConfigKey
WillReturn sets the values that will be returned by the call to DeleteConfigKey().
func (*ExpectedDeleteConfigKey) WillReturnError ¶
func (e *ExpectedDeleteConfigKey) WillReturnError(err error) *ExpectedDeleteConfigKey
WillReturnError sets the error value that will be returned by the call to DeleteConfigKey().
func (*ExpectedDeleteConfigKey) WithKey ¶
func (e *ExpectedDeleteConfigKey) WithKey(key string) *ExpectedDeleteConfigKey
WithKey sets the expected key.
func (*ExpectedDeleteConfigKey) WithNode ¶
func (e *ExpectedDeleteConfigKey) WithNode(node string) *ExpectedDeleteConfigKey
WithNode sets the expected node.
func (*ExpectedDeleteConfigKey) WithSection ¶
func (e *ExpectedDeleteConfigKey) WithSection(section string) *ExpectedDeleteConfigKey
WithSection sets the expected section.
type ExpectedDeleteIndex ¶
type ExpectedDeleteIndex struct {
// contains filtered or unexported fields
}
ExpectedDeleteIndex represents an expectation for a call to DB.DeleteIndex().
func (*ExpectedDeleteIndex) String ¶
func (e *ExpectedDeleteIndex) String() string
func (*ExpectedDeleteIndex) WillDelay ¶
func (e *ExpectedDeleteIndex) WillDelay(delay time.Duration) *ExpectedDeleteIndex
WillDelay causes the call to DB.DeleteIndex() to delay.
func (*ExpectedDeleteIndex) WillExecute ¶
func (e *ExpectedDeleteIndex) WillExecute(cb func(ctx context.Context, arg0 string, arg1 string, options driver.Options) error) *ExpectedDeleteIndex
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedDeleteIndex) WillReturnError ¶
func (e *ExpectedDeleteIndex) WillReturnError(err error) *ExpectedDeleteIndex
WillReturnError sets the error value that will be returned by the call to DB.DeleteIndex().
func (*ExpectedDeleteIndex) WithDDoc ¶
func (e *ExpectedDeleteIndex) WithDDoc(ddoc string) *ExpectedDeleteIndex
WithDDoc sets the expected ddoc to be passed to the DB.DeleteIndex() call.
func (*ExpectedDeleteIndex) WithName ¶
func (e *ExpectedDeleteIndex) WithName(name string) *ExpectedDeleteIndex
WithName sets the expected name to be passed to the DB.DeleteIndex() call.
func (*ExpectedDeleteIndex) WithOptions ¶
func (e *ExpectedDeleteIndex) WithOptions(options ...kivik.Option) *ExpectedDeleteIndex
WithOptions sets the expected options for the call to DB.DeleteIndex().
type ExpectedDesignDocs ¶
type ExpectedDesignDocs struct {
// contains filtered or unexported fields
}
ExpectedDesignDocs represents an expectation for a call to DB.DesignDocs().
func (*ExpectedDesignDocs) String ¶
func (e *ExpectedDesignDocs) String() string
func (*ExpectedDesignDocs) WillDelay ¶
func (e *ExpectedDesignDocs) WillDelay(delay time.Duration) *ExpectedDesignDocs
WillDelay causes the call to DB.DesignDocs() to delay.
func (*ExpectedDesignDocs) WillExecute ¶
func (e *ExpectedDesignDocs) WillExecute(cb func(ctx context.Context, options driver.Options) (driver.Rows, error)) *ExpectedDesignDocs
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedDesignDocs) WillReturn ¶
func (e *ExpectedDesignDocs) WillReturn(ret0 *Rows) *ExpectedDesignDocs
WillReturn sets the values that will be returned by the call to DB.DesignDocs().
func (*ExpectedDesignDocs) WillReturnError ¶
func (e *ExpectedDesignDocs) WillReturnError(err error) *ExpectedDesignDocs
WillReturnError sets the error value that will be returned by the call to DB.DesignDocs().
func (*ExpectedDesignDocs) WithOptions ¶
func (e *ExpectedDesignDocs) WithOptions(options ...kivik.Option) *ExpectedDesignDocs
WithOptions sets the expected options for the call to DB.DesignDocs().
type ExpectedDestroyDB ¶
type ExpectedDestroyDB struct {
// contains filtered or unexported fields
}
ExpectedDestroyDB represents an expectation for a call to DestroyDB().
func (*ExpectedDestroyDB) String ¶
func (e *ExpectedDestroyDB) String() string
func (*ExpectedDestroyDB) WillDelay ¶
func (e *ExpectedDestroyDB) WillDelay(delay time.Duration) *ExpectedDestroyDB
WillDelay causes the call to DestroyDB() to delay.
func (*ExpectedDestroyDB) WillExecute ¶
func (e *ExpectedDestroyDB) WillExecute(cb func(ctx context.Context, arg0 string, options driver.Options) error) *ExpectedDestroyDB
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedDestroyDB) WillReturnError ¶
func (e *ExpectedDestroyDB) WillReturnError(err error) *ExpectedDestroyDB
WillReturnError sets the error value that will be returned by the call to DestroyDB().
func (*ExpectedDestroyDB) WithName ¶
func (e *ExpectedDestroyDB) WithName(name string) *ExpectedDestroyDB
WithName sets the expectation that DestroyDB will be called with this name.
func (*ExpectedDestroyDB) WithOptions ¶
func (e *ExpectedDestroyDB) WithOptions(options ...kivik.Option) *ExpectedDestroyDB
WithOptions sets the expected options for the call to DestroyDB().
type ExpectedExplain ¶
type ExpectedExplain struct {
// contains filtered or unexported fields
}
ExpectedExplain represents an expectation for a call to DB.Explain().
func (*ExpectedExplain) String ¶
func (e *ExpectedExplain) String() string
func (*ExpectedExplain) WillDelay ¶
func (e *ExpectedExplain) WillDelay(delay time.Duration) *ExpectedExplain
WillDelay causes the call to DB.Explain() to delay.
func (*ExpectedExplain) WillExecute ¶
func (e *ExpectedExplain) WillExecute(cb func(ctx context.Context, arg0 interface{}, options driver.Options) (*driver.QueryPlan, error)) *ExpectedExplain
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedExplain) WillReturn ¶
func (e *ExpectedExplain) WillReturn(ret0 *driver.QueryPlan) *ExpectedExplain
WillReturn sets the values that will be returned by the call to DB.Explain().
func (*ExpectedExplain) WillReturnError ¶
func (e *ExpectedExplain) WillReturnError(err error) *ExpectedExplain
WillReturnError sets the error value that will be returned by the call to DB.Explain().
func (*ExpectedExplain) WithOptions ¶
func (e *ExpectedExplain) WithOptions(options ...kivik.Option) *ExpectedExplain
WithOptions sets the expected options for the call to DB.Explain().
func (*ExpectedExplain) WithQuery ¶
func (e *ExpectedExplain) WithQuery(query interface{}) *ExpectedExplain
WithQuery sets the expected query for the Explain() call.
type ExpectedFind ¶
type ExpectedFind struct {
// contains filtered or unexported fields
}
ExpectedFind represents an expectation for a call to DB.Find().
func (*ExpectedFind) String ¶
func (e *ExpectedFind) String() string
func (*ExpectedFind) WillDelay ¶
func (e *ExpectedFind) WillDelay(delay time.Duration) *ExpectedFind
WillDelay causes the call to DB.Find() to delay.
func (*ExpectedFind) WillExecute ¶
func (e *ExpectedFind) WillExecute(cb func(ctx context.Context, arg0 interface{}, options driver.Options) (driver.Rows, error)) *ExpectedFind
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedFind) WillReturn ¶
func (e *ExpectedFind) WillReturn(ret0 *Rows) *ExpectedFind
WillReturn sets the values that will be returned by the call to DB.Find().
func (*ExpectedFind) WillReturnError ¶
func (e *ExpectedFind) WillReturnError(err error) *ExpectedFind
WillReturnError sets the error value that will be returned by the call to DB.Find().
func (*ExpectedFind) WithOptions ¶
func (e *ExpectedFind) WithOptions(options ...kivik.Option) *ExpectedFind
WithOptions sets the expected options for the call to DB.Find().
func (*ExpectedFind) WithQuery ¶
func (e *ExpectedFind) WithQuery(query interface{}) *ExpectedFind
WithQuery sets the expected query for the Find() call.
type ExpectedFlush ¶
type ExpectedFlush struct {
// contains filtered or unexported fields
}
ExpectedFlush represents an expectation for a call to DB.Flush().
func (*ExpectedFlush) String ¶
func (e *ExpectedFlush) String() string
func (*ExpectedFlush) WillDelay ¶
func (e *ExpectedFlush) WillDelay(delay time.Duration) *ExpectedFlush
WillDelay causes the call to DB.Flush() to delay.
func (*ExpectedFlush) WillExecute ¶
func (e *ExpectedFlush) WillExecute(cb func(ctx context.Context) error) *ExpectedFlush
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedFlush) WillReturnError ¶
func (e *ExpectedFlush) WillReturnError(err error) *ExpectedFlush
WillReturnError sets the error value that will be returned by the call to DB.Flush().
type ExpectedGet ¶
type ExpectedGet struct {
// contains filtered or unexported fields
}
ExpectedGet represents an expectation for a call to DB.Get().
func (*ExpectedGet) String ¶
func (e *ExpectedGet) String() string
func (*ExpectedGet) WillDelay ¶
func (e *ExpectedGet) WillDelay(delay time.Duration) *ExpectedGet
WillDelay causes the call to DB.Get() to delay.
func (*ExpectedGet) WillExecute ¶
func (e *ExpectedGet) WillExecute(cb func(ctx context.Context, arg0 string, options driver.Options) (*driver.Document, error)) *ExpectedGet
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedGet) WillReturn ¶
func (e *ExpectedGet) WillReturn(ret0 *driver.Document) *ExpectedGet
WillReturn sets the values that will be returned by the call to DB.Get().
func (*ExpectedGet) WillReturnError ¶
func (e *ExpectedGet) WillReturnError(err error) *ExpectedGet
WillReturnError sets the error value that will be returned by the call to DB.Get().
func (*ExpectedGet) WithDocID ¶
func (e *ExpectedGet) WithDocID(docID string) *ExpectedGet
WithDocID sets the expected docID for the DB.Get() call.
func (*ExpectedGet) WithOptions ¶
func (e *ExpectedGet) WithOptions(options ...kivik.Option) *ExpectedGet
WithOptions sets the expected options for the call to DB.Get().
type ExpectedGetAttachment ¶
type ExpectedGetAttachment struct {
// contains filtered or unexported fields
}
ExpectedGetAttachment represents an expectation for a call to DB.GetAttachment().
func (*ExpectedGetAttachment) String ¶
func (e *ExpectedGetAttachment) String() string
func (*ExpectedGetAttachment) WillDelay ¶
func (e *ExpectedGetAttachment) WillDelay(delay time.Duration) *ExpectedGetAttachment
WillDelay causes the call to DB.GetAttachment() to delay.
func (*ExpectedGetAttachment) WillExecute ¶
func (e *ExpectedGetAttachment) WillExecute(cb func(ctx context.Context, arg0 string, arg1 string, options driver.Options) (*driver.Attachment, error)) *ExpectedGetAttachment
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedGetAttachment) WillReturn ¶
func (e *ExpectedGetAttachment) WillReturn(ret0 *driver.Attachment) *ExpectedGetAttachment
WillReturn sets the values that will be returned by the call to DB.GetAttachment().
func (*ExpectedGetAttachment) WillReturnError ¶
func (e *ExpectedGetAttachment) WillReturnError(err error) *ExpectedGetAttachment
WillReturnError sets the error value that will be returned by the call to DB.GetAttachment().
func (*ExpectedGetAttachment) WithDocID ¶
func (e *ExpectedGetAttachment) WithDocID(docID string) *ExpectedGetAttachment
WithDocID sets the expectation for the docID passed to the DB.GetAttachment() call.
func (*ExpectedGetAttachment) WithFilename ¶
func (e *ExpectedGetAttachment) WithFilename(docID string) *ExpectedGetAttachment
WithFilename sets the expectation for the filename passed to the DB.GetAttachment() call.
func (*ExpectedGetAttachment) WithOptions ¶
func (e *ExpectedGetAttachment) WithOptions(options ...kivik.Option) *ExpectedGetAttachment
WithOptions sets the expected options for the call to DB.GetAttachment().
type ExpectedGetAttachmentMeta ¶
type ExpectedGetAttachmentMeta struct {
// contains filtered or unexported fields
}
ExpectedGetAttachmentMeta represents an expectation for a call to DB.GetAttachmentMeta().
func (*ExpectedGetAttachmentMeta) String ¶
func (e *ExpectedGetAttachmentMeta) String() string
func (*ExpectedGetAttachmentMeta) WillDelay ¶
func (e *ExpectedGetAttachmentMeta) WillDelay(delay time.Duration) *ExpectedGetAttachmentMeta
WillDelay causes the call to DB.GetAttachmentMeta() to delay.
func (*ExpectedGetAttachmentMeta) WillExecute ¶
func (e *ExpectedGetAttachmentMeta) WillExecute(cb func(ctx context.Context, arg0 string, arg1 string, options driver.Options) (*driver.Attachment, error)) *ExpectedGetAttachmentMeta
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedGetAttachmentMeta) WillReturn ¶
func (e *ExpectedGetAttachmentMeta) WillReturn(ret0 *driver.Attachment) *ExpectedGetAttachmentMeta
WillReturn sets the values that will be returned by the call to DB.GetAttachmentMeta().
func (*ExpectedGetAttachmentMeta) WillReturnError ¶
func (e *ExpectedGetAttachmentMeta) WillReturnError(err error) *ExpectedGetAttachmentMeta
WillReturnError sets the error value that will be returned by the call to DB.GetAttachmentMeta().
func (*ExpectedGetAttachmentMeta) WithDocID ¶
func (e *ExpectedGetAttachmentMeta) WithDocID(docID string) *ExpectedGetAttachmentMeta
WithDocID sets the expectation for the docID passed to the DB.GetAttachmentMeta() call.
func (*ExpectedGetAttachmentMeta) WithFilename ¶
func (e *ExpectedGetAttachmentMeta) WithFilename(filename string) *ExpectedGetAttachmentMeta
WithFilename sets the expectation for the doc passed to the DB.GetAttachmentMeta() call.
func (*ExpectedGetAttachmentMeta) WithOptions ¶
func (e *ExpectedGetAttachmentMeta) WithOptions(options ...kivik.Option) *ExpectedGetAttachmentMeta
WithOptions sets the expected options for the call to DB.GetAttachmentMeta().
type ExpectedGetIndexes ¶
type ExpectedGetIndexes struct {
// contains filtered or unexported fields
}
ExpectedGetIndexes represents an expectation for a call to DB.GetIndexes().
func (*ExpectedGetIndexes) String ¶
func (e *ExpectedGetIndexes) String() string
func (*ExpectedGetIndexes) WillDelay ¶
func (e *ExpectedGetIndexes) WillDelay(delay time.Duration) *ExpectedGetIndexes
WillDelay causes the call to DB.GetIndexes() to delay.
func (*ExpectedGetIndexes) WillExecute ¶
func (e *ExpectedGetIndexes) WillExecute(cb func(ctx context.Context, options driver.Options) ([]driver.Index, error)) *ExpectedGetIndexes
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedGetIndexes) WillReturn ¶
func (e *ExpectedGetIndexes) WillReturn(ret0 []driver.Index) *ExpectedGetIndexes
WillReturn sets the values that will be returned by the call to DB.GetIndexes().
func (*ExpectedGetIndexes) WillReturnError ¶
func (e *ExpectedGetIndexes) WillReturnError(err error) *ExpectedGetIndexes
WillReturnError sets the error value that will be returned by the call to DB.GetIndexes().
func (*ExpectedGetIndexes) WithOptions ¶
func (e *ExpectedGetIndexes) WithOptions(options ...kivik.Option) *ExpectedGetIndexes
WithOptions sets the expected options for the call to DB.GetIndexes().
type ExpectedGetReplications ¶
type ExpectedGetReplications struct {
// contains filtered or unexported fields
}
ExpectedGetReplications represents an expectation for a call to GetReplications().
func (*ExpectedGetReplications) String ¶
func (e *ExpectedGetReplications) String() string
func (*ExpectedGetReplications) WillDelay ¶
func (e *ExpectedGetReplications) WillDelay(delay time.Duration) *ExpectedGetReplications
WillDelay causes the call to GetReplications() to delay.
func (*ExpectedGetReplications) WillExecute ¶
func (e *ExpectedGetReplications) WillExecute(cb func(ctx context.Context, options driver.Options) ([]driver.Replication, error)) *ExpectedGetReplications
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedGetReplications) WillReturn ¶
func (e *ExpectedGetReplications) WillReturn(ret0 []*Replication) *ExpectedGetReplications
WillReturn sets the values that will be returned by the call to GetReplications().
func (*ExpectedGetReplications) WillReturnError ¶
func (e *ExpectedGetReplications) WillReturnError(err error) *ExpectedGetReplications
WillReturnError sets the error value that will be returned by the call to GetReplications().
func (*ExpectedGetReplications) WithOptions ¶
func (e *ExpectedGetReplications) WithOptions(options ...kivik.Option) *ExpectedGetReplications
WithOptions sets the expected options for the call to GetReplications().
type ExpectedGetRev ¶
type ExpectedGetRev struct {
// contains filtered or unexported fields
}
ExpectedGetRev represents an expectation for a call to DB.GetRev().
func (*ExpectedGetRev) String ¶
func (e *ExpectedGetRev) String() string
func (*ExpectedGetRev) WillDelay ¶
func (e *ExpectedGetRev) WillDelay(delay time.Duration) *ExpectedGetRev
WillDelay causes the call to DB.GetRev() to delay.
func (*ExpectedGetRev) WillExecute ¶
func (e *ExpectedGetRev) WillExecute(cb func(ctx context.Context, arg0 string, options driver.Options) (string, error)) *ExpectedGetRev
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedGetRev) WillReturn ¶
func (e *ExpectedGetRev) WillReturn(ret0 string) *ExpectedGetRev
WillReturn sets the values that will be returned by the call to DB.GetRev().
func (*ExpectedGetRev) WillReturnError ¶
func (e *ExpectedGetRev) WillReturnError(err error) *ExpectedGetRev
WillReturnError sets the error value that will be returned by the call to DB.GetRev().
func (*ExpectedGetRev) WithDocID ¶
func (e *ExpectedGetRev) WithDocID(docID string) *ExpectedGetRev
WithDocID sets the expectation for the docID passed to the DB.GetRev call.
func (*ExpectedGetRev) WithOptions ¶
func (e *ExpectedGetRev) WithOptions(options ...kivik.Option) *ExpectedGetRev
WithOptions sets the expected options for the call to DB.GetRev().
type ExpectedLocalDocs ¶
type ExpectedLocalDocs struct {
// contains filtered or unexported fields
}
ExpectedLocalDocs represents an expectation for a call to DB.LocalDocs().
func (*ExpectedLocalDocs) String ¶
func (e *ExpectedLocalDocs) String() string
func (*ExpectedLocalDocs) WillDelay ¶
func (e *ExpectedLocalDocs) WillDelay(delay time.Duration) *ExpectedLocalDocs
WillDelay causes the call to DB.LocalDocs() to delay.
func (*ExpectedLocalDocs) WillExecute ¶
func (e *ExpectedLocalDocs) WillExecute(cb func(ctx context.Context, options driver.Options) (driver.Rows, error)) *ExpectedLocalDocs
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedLocalDocs) WillReturn ¶
func (e *ExpectedLocalDocs) WillReturn(ret0 *Rows) *ExpectedLocalDocs
WillReturn sets the values that will be returned by the call to DB.LocalDocs().
func (*ExpectedLocalDocs) WillReturnError ¶
func (e *ExpectedLocalDocs) WillReturnError(err error) *ExpectedLocalDocs
WillReturnError sets the error value that will be returned by the call to DB.LocalDocs().
func (*ExpectedLocalDocs) WithOptions ¶
func (e *ExpectedLocalDocs) WithOptions(options ...kivik.Option) *ExpectedLocalDocs
WithOptions sets the expected options for the call to DB.LocalDocs().
type ExpectedMembership ¶
type ExpectedMembership struct {
// contains filtered or unexported fields
}
ExpectedMembership represents an expectation for a call to Membership().
func (*ExpectedMembership) String ¶
func (e *ExpectedMembership) String() string
func (*ExpectedMembership) WillDelay ¶
func (e *ExpectedMembership) WillDelay(delay time.Duration) *ExpectedMembership
WillDelay causes the call to Membership() to delay.
func (*ExpectedMembership) WillExecute ¶
func (e *ExpectedMembership) WillExecute(cb func(ctx context.Context) (*driver.ClusterMembership, error)) *ExpectedMembership
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedMembership) WillReturn ¶
func (e *ExpectedMembership) WillReturn(ret0 *driver.ClusterMembership) *ExpectedMembership
WillReturn sets the values that will be returned by the call to Membership().
func (*ExpectedMembership) WillReturnError ¶
func (e *ExpectedMembership) WillReturnError(err error) *ExpectedMembership
WillReturnError sets the error value that will be returned by the call to Membership().
type ExpectedOpenRevs ¶
type ExpectedOpenRevs struct {
// contains filtered or unexported fields
}
ExpectedOpenRevs represents an expectation for a call to DB.OpenRevs().
func (*ExpectedOpenRevs) String ¶
func (e *ExpectedOpenRevs) String() string
func (*ExpectedOpenRevs) WillDelay ¶
func (e *ExpectedOpenRevs) WillDelay(delay time.Duration) *ExpectedOpenRevs
WillDelay causes the call to DB.OpenRevs() to delay.
func (*ExpectedOpenRevs) WillExecute ¶
func (e *ExpectedOpenRevs) WillExecute(cb func(ctx context.Context, arg0 string, arg1 []string, options driver.Options) (driver.Rows, error)) *ExpectedOpenRevs
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedOpenRevs) WillReturn ¶
func (e *ExpectedOpenRevs) WillReturn(ret0 *Rows) *ExpectedOpenRevs
WillReturn sets the values that will be returned by the call to DB.OpenRevs().
func (*ExpectedOpenRevs) WillReturnError ¶
func (e *ExpectedOpenRevs) WillReturnError(err error) *ExpectedOpenRevs
WillReturnError sets the error value that will be returned by the call to DB.OpenRevs().
func (*ExpectedOpenRevs) WithDocID ¶
func (e *ExpectedOpenRevs) WithDocID(docID string) *ExpectedOpenRevs
WithDocID sets the expected docID for the DB.OpenRevs() call.
func (*ExpectedOpenRevs) WithOptions ¶
func (e *ExpectedOpenRevs) WithOptions(options ...kivik.Option) *ExpectedOpenRevs
WithOptions sets the expected options for the call to DB.OpenRevs().
func (*ExpectedOpenRevs) WithRevs ¶
func (e *ExpectedOpenRevs) WithRevs(revs []string) *ExpectedOpenRevs
WithRevs sets the expected revs for the DB.OpenRevs() call.
type ExpectedPartitionStats ¶
type ExpectedPartitionStats struct {
// contains filtered or unexported fields
}
ExpectedPartitionStats represents an expectation for a call to DB.PartitionStats().
func (*ExpectedPartitionStats) String ¶
func (e *ExpectedPartitionStats) String() string
func (*ExpectedPartitionStats) WillDelay ¶
func (e *ExpectedPartitionStats) WillDelay(delay time.Duration) *ExpectedPartitionStats
WillDelay causes the call to DB.PartitionStats() to delay.
func (*ExpectedPartitionStats) WillExecute ¶
func (e *ExpectedPartitionStats) WillExecute(cb func(ctx context.Context, arg0 string) (*driver.PartitionStats, error)) *ExpectedPartitionStats
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedPartitionStats) WillReturn ¶
func (e *ExpectedPartitionStats) WillReturn(ret0 *driver.PartitionStats) *ExpectedPartitionStats
WillReturn sets the values that will be returned by the call to DB.PartitionStats().
func (*ExpectedPartitionStats) WillReturnError ¶
func (e *ExpectedPartitionStats) WillReturnError(err error) *ExpectedPartitionStats
WillReturnError sets the error value that will be returned by the call to DB.PartitionStats().
func (*ExpectedPartitionStats) WithName ¶
func (e *ExpectedPartitionStats) WithName(name string) *ExpectedPartitionStats
WithName sets the expectation for the partition name passed to the DB.PartitionStats() call.
type ExpectedPing ¶
type ExpectedPing struct {
// contains filtered or unexported fields
}
ExpectedPing represents an expectation for a call to Ping().
func (*ExpectedPing) String ¶
func (e *ExpectedPing) String() string
func (*ExpectedPing) WillDelay ¶
func (e *ExpectedPing) WillDelay(delay time.Duration) *ExpectedPing
WillDelay causes the call to Ping() to delay.
func (*ExpectedPing) WillExecute ¶
func (e *ExpectedPing) WillExecute(cb func(ctx context.Context) (bool, error)) *ExpectedPing
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedPing) WillReturn ¶
func (e *ExpectedPing) WillReturn(ret0 bool) *ExpectedPing
WillReturn sets the values that will be returned by the call to Ping().
func (*ExpectedPing) WillReturnError ¶
func (e *ExpectedPing) WillReturnError(err error) *ExpectedPing
WillReturnError sets the error value that will be returned by the call to Ping().
type ExpectedPurge ¶
type ExpectedPurge struct {
// contains filtered or unexported fields
}
ExpectedPurge represents an expectation for a call to DB.Purge().
func (*ExpectedPurge) String ¶
func (e *ExpectedPurge) String() string
func (*ExpectedPurge) WillDelay ¶
func (e *ExpectedPurge) WillDelay(delay time.Duration) *ExpectedPurge
WillDelay causes the call to DB.Purge() to delay.
func (*ExpectedPurge) WillExecute ¶
func (e *ExpectedPurge) WillExecute(cb func(ctx context.Context, arg0 map[string][]string) (*driver.PurgeResult, error)) *ExpectedPurge
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedPurge) WillReturn ¶
func (e *ExpectedPurge) WillReturn(ret0 *driver.PurgeResult) *ExpectedPurge
WillReturn sets the values that will be returned by the call to DB.Purge().
func (*ExpectedPurge) WillReturnError ¶
func (e *ExpectedPurge) WillReturnError(err error) *ExpectedPurge
WillReturnError sets the error value that will be returned by the call to DB.Purge().
func (*ExpectedPurge) WithDocRevMap ¶
func (e *ExpectedPurge) WithDocRevMap(docRevMap map[string][]string) *ExpectedPurge
WithDocRevMap sets the expected docRevMap for the call to DB.Purge().
type ExpectedPut ¶
type ExpectedPut struct {
// contains filtered or unexported fields
}
ExpectedPut represents an expectation for a call to DB.Put().
func (*ExpectedPut) String ¶
func (e *ExpectedPut) String() string
func (*ExpectedPut) WillDelay ¶
func (e *ExpectedPut) WillDelay(delay time.Duration) *ExpectedPut
WillDelay causes the call to DB.Put() to delay.
func (*ExpectedPut) WillExecute ¶
func (e *ExpectedPut) WillExecute(cb func(ctx context.Context, arg0 string, arg1 interface{}, options driver.Options) (string, error)) *ExpectedPut
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedPut) WillReturn ¶
func (e *ExpectedPut) WillReturn(ret0 string) *ExpectedPut
WillReturn sets the values that will be returned by the call to DB.Put().
func (*ExpectedPut) WillReturnError ¶
func (e *ExpectedPut) WillReturnError(err error) *ExpectedPut
WillReturnError sets the error value that will be returned by the call to DB.Put().
func (*ExpectedPut) WithDoc ¶
func (e *ExpectedPut) WithDoc(doc interface{}) *ExpectedPut
WithDoc sets the expectation for the doc passed to the DB.Put() call.
func (*ExpectedPut) WithDocID ¶
func (e *ExpectedPut) WithDocID(docID string) *ExpectedPut
WithDocID sets the expectation for the docID passed to the DB.Put() call.
func (*ExpectedPut) WithOptions ¶
func (e *ExpectedPut) WithOptions(options ...kivik.Option) *ExpectedPut
WithOptions sets the expected options for the call to DB.Put().
type ExpectedPutAttachment ¶
type ExpectedPutAttachment struct {
// contains filtered or unexported fields
}
ExpectedPutAttachment represents an expectation for a call to DB.PutAttachment().
func (*ExpectedPutAttachment) String ¶
func (e *ExpectedPutAttachment) String() string
func (*ExpectedPutAttachment) WillDelay ¶
func (e *ExpectedPutAttachment) WillDelay(delay time.Duration) *ExpectedPutAttachment
WillDelay causes the call to DB.PutAttachment() to delay.
func (*ExpectedPutAttachment) WillExecute ¶
func (e *ExpectedPutAttachment) WillExecute(cb func(ctx context.Context, arg0 string, arg1 *driver.Attachment, options driver.Options) (string, error)) *ExpectedPutAttachment
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedPutAttachment) WillReturn ¶
func (e *ExpectedPutAttachment) WillReturn(ret0 string) *ExpectedPutAttachment
WillReturn sets the values that will be returned by the call to DB.PutAttachment().
func (*ExpectedPutAttachment) WillReturnError ¶
func (e *ExpectedPutAttachment) WillReturnError(err error) *ExpectedPutAttachment
WillReturnError sets the error value that will be returned by the call to DB.PutAttachment().
func (*ExpectedPutAttachment) WithAttachment ¶
func (e *ExpectedPutAttachment) WithAttachment(att *driver.Attachment) *ExpectedPutAttachment
WithAttachment sets the expectation for the rev passed to the DB.PutAttachment() call.
func (*ExpectedPutAttachment) WithDocID ¶
func (e *ExpectedPutAttachment) WithDocID(docID string) *ExpectedPutAttachment
WithDocID sets the expectation for the docID passed to the DB.PutAttachment() call.
func (*ExpectedPutAttachment) WithOptions ¶
func (e *ExpectedPutAttachment) WithOptions(options ...kivik.Option) *ExpectedPutAttachment
WithOptions sets the expected options for the call to DB.PutAttachment().
type ExpectedQuery ¶
type ExpectedQuery struct {
// contains filtered or unexported fields
}
ExpectedQuery represents an expectation for a call to DB.Query().
func (*ExpectedQuery) String ¶
func (e *ExpectedQuery) String() string
func (*ExpectedQuery) WillDelay ¶
func (e *ExpectedQuery) WillDelay(delay time.Duration) *ExpectedQuery
WillDelay causes the call to DB.Query() to delay.
func (*ExpectedQuery) WillExecute ¶
func (e *ExpectedQuery) WillExecute(cb func(ctx context.Context, arg0 string, arg1 string, options driver.Options) (driver.Rows, error)) *ExpectedQuery
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedQuery) WillReturn ¶
func (e *ExpectedQuery) WillReturn(ret0 *Rows) *ExpectedQuery
WillReturn sets the values that will be returned by the call to DB.Query().
func (*ExpectedQuery) WillReturnError ¶
func (e *ExpectedQuery) WillReturnError(err error) *ExpectedQuery
WillReturnError sets the error value that will be returned by the call to DB.Query().
func (*ExpectedQuery) WithDDocID ¶
func (e *ExpectedQuery) WithDDocID(ddocID string) *ExpectedQuery
WithDDocID sets the expected ddocID value for the DB.Query() call.
func (*ExpectedQuery) WithOptions ¶
func (e *ExpectedQuery) WithOptions(options ...kivik.Option) *ExpectedQuery
WithOptions sets the expected options for the call to DB.Query().
func (*ExpectedQuery) WithView ¶
func (e *ExpectedQuery) WithView(view string) *ExpectedQuery
WithView sets the expected view value for the DB.Query() call.
type ExpectedReplicate ¶
type ExpectedReplicate struct {
// contains filtered or unexported fields
}
ExpectedReplicate represents an expectation for a call to Replicate().
func (*ExpectedReplicate) String ¶
func (e *ExpectedReplicate) String() string
func (*ExpectedReplicate) WillDelay ¶
func (e *ExpectedReplicate) WillDelay(delay time.Duration) *ExpectedReplicate
WillDelay causes the call to Replicate() to delay.
func (*ExpectedReplicate) WillExecute ¶
func (e *ExpectedReplicate) WillExecute(cb func(ctx context.Context, arg0 string, arg1 string, options driver.Options) (driver.Replication, error)) *ExpectedReplicate
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedReplicate) WillReturn ¶
func (e *ExpectedReplicate) WillReturn(ret0 *Replication) *ExpectedReplicate
WillReturn sets the values that will be returned by the call to Replicate().
func (*ExpectedReplicate) WillReturnError ¶
func (e *ExpectedReplicate) WillReturnError(err error) *ExpectedReplicate
WillReturnError sets the error value that will be returned by the call to Replicate().
func (*ExpectedReplicate) WithOptions ¶
func (e *ExpectedReplicate) WithOptions(options ...kivik.Option) *ExpectedReplicate
WithOptions sets the expected options for the call to Replicate().
func (*ExpectedReplicate) WithSource ¶
func (e *ExpectedReplicate) WithSource(source string) *ExpectedReplicate
WithSource sets the expected source.
func (*ExpectedReplicate) WithTarget ¶
func (e *ExpectedReplicate) WithTarget(target string) *ExpectedReplicate
WithTarget sets the expected target.
type ExpectedRevsDiff ¶
type ExpectedRevsDiff struct {
// contains filtered or unexported fields
}
ExpectedRevsDiff represents an expectation for a call to DB.RevsDiff().
func (*ExpectedRevsDiff) String ¶
func (e *ExpectedRevsDiff) String() string
func (*ExpectedRevsDiff) WillDelay ¶
func (e *ExpectedRevsDiff) WillDelay(delay time.Duration) *ExpectedRevsDiff
WillDelay causes the call to DB.RevsDiff() to delay.
func (*ExpectedRevsDiff) WillExecute ¶
func (e *ExpectedRevsDiff) WillExecute(cb func(ctx context.Context, arg0 interface{}) (driver.Rows, error)) *ExpectedRevsDiff
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedRevsDiff) WillReturn ¶
func (e *ExpectedRevsDiff) WillReturn(ret0 *Rows) *ExpectedRevsDiff
WillReturn sets the values that will be returned by the call to DB.RevsDiff().
func (*ExpectedRevsDiff) WillReturnError ¶
func (e *ExpectedRevsDiff) WillReturnError(err error) *ExpectedRevsDiff
WillReturnError sets the error value that will be returned by the call to DB.RevsDiff().
func (*ExpectedRevsDiff) WithRevLookup ¶
func (e *ExpectedRevsDiff) WithRevLookup(revLookup interface{}) *ExpectedRevsDiff
WithRevLookup sets the expectation for the rev lookup passed to the DB.RevsDiff() call.
type ExpectedSecurity ¶
type ExpectedSecurity struct {
// contains filtered or unexported fields
}
ExpectedSecurity represents an expectation for a call to DB.Security().
func (*ExpectedSecurity) String ¶
func (e *ExpectedSecurity) String() string
func (*ExpectedSecurity) WillDelay ¶
func (e *ExpectedSecurity) WillDelay(delay time.Duration) *ExpectedSecurity
WillDelay causes the call to DB.Security() to delay.
func (*ExpectedSecurity) WillExecute ¶
func (e *ExpectedSecurity) WillExecute(cb func(ctx context.Context) (*driver.Security, error)) *ExpectedSecurity
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedSecurity) WillReturn ¶
func (e *ExpectedSecurity) WillReturn(ret0 *driver.Security) *ExpectedSecurity
WillReturn sets the values that will be returned by the call to DB.Security().
func (*ExpectedSecurity) WillReturnError ¶
func (e *ExpectedSecurity) WillReturnError(err error) *ExpectedSecurity
WillReturnError sets the error value that will be returned by the call to DB.Security().
type ExpectedSession ¶
type ExpectedSession struct {
// contains filtered or unexported fields
}
ExpectedSession represents an expectation for a call to Session().
func (*ExpectedSession) String ¶
func (e *ExpectedSession) String() string
func (*ExpectedSession) WillDelay ¶
func (e *ExpectedSession) WillDelay(delay time.Duration) *ExpectedSession
WillDelay causes the call to Session() to delay.
func (*ExpectedSession) WillExecute ¶
func (e *ExpectedSession) WillExecute(cb func(ctx context.Context) (*driver.Session, error)) *ExpectedSession
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedSession) WillReturn ¶
func (e *ExpectedSession) WillReturn(ret0 *driver.Session) *ExpectedSession
WillReturn sets the values that will be returned by the call to Session().
func (*ExpectedSession) WillReturnError ¶
func (e *ExpectedSession) WillReturnError(err error) *ExpectedSession
WillReturnError sets the error value that will be returned by the call to Session().
type ExpectedSetConfigValue ¶
type ExpectedSetConfigValue struct {
// contains filtered or unexported fields
}
ExpectedSetConfigValue represents an expectation for a call to SetConfigValue().
func (*ExpectedSetConfigValue) String ¶
func (e *ExpectedSetConfigValue) String() string
func (*ExpectedSetConfigValue) WillDelay ¶
func (e *ExpectedSetConfigValue) WillDelay(delay time.Duration) *ExpectedSetConfigValue
WillDelay causes the call to SetConfigValue() to delay.
func (*ExpectedSetConfigValue) WillExecute ¶
func (e *ExpectedSetConfigValue) WillExecute(cb func(ctx context.Context, arg0 string, arg1 string, arg2 string, arg3 string) (string, error)) *ExpectedSetConfigValue
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedSetConfigValue) WillReturn ¶
func (e *ExpectedSetConfigValue) WillReturn(ret0 string) *ExpectedSetConfigValue
WillReturn sets the values that will be returned by the call to SetConfigValue().
func (*ExpectedSetConfigValue) WillReturnError ¶
func (e *ExpectedSetConfigValue) WillReturnError(err error) *ExpectedSetConfigValue
WillReturnError sets the error value that will be returned by the call to SetConfigValue().
func (*ExpectedSetConfigValue) WithKey ¶
func (e *ExpectedSetConfigValue) WithKey(key string) *ExpectedSetConfigValue
WithKey sets the expected key.
func (*ExpectedSetConfigValue) WithNode ¶
func (e *ExpectedSetConfigValue) WithNode(node string) *ExpectedSetConfigValue
WithNode sets the expected node.
func (*ExpectedSetConfigValue) WithSection ¶
func (e *ExpectedSetConfigValue) WithSection(section string) *ExpectedSetConfigValue
WithSection sets the expected section.
func (*ExpectedSetConfigValue) WithValue ¶
func (e *ExpectedSetConfigValue) WithValue(value string) *ExpectedSetConfigValue
WithValue sets the expected value.
type ExpectedSetSecurity ¶
type ExpectedSetSecurity struct {
// contains filtered or unexported fields
}
ExpectedSetSecurity represents an expectation for a call to DB.SetSecurity().
func (*ExpectedSetSecurity) String ¶
func (e *ExpectedSetSecurity) String() string
func (*ExpectedSetSecurity) WillDelay ¶
func (e *ExpectedSetSecurity) WillDelay(delay time.Duration) *ExpectedSetSecurity
WillDelay causes the call to DB.SetSecurity() to delay.
func (*ExpectedSetSecurity) WillExecute ¶
func (e *ExpectedSetSecurity) WillExecute(cb func(ctx context.Context, arg0 *driver.Security) error) *ExpectedSetSecurity
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedSetSecurity) WillReturnError ¶
func (e *ExpectedSetSecurity) WillReturnError(err error) *ExpectedSetSecurity
WillReturnError sets the error value that will be returned by the call to DB.SetSecurity().
func (*ExpectedSetSecurity) WithSecurity ¶
func (e *ExpectedSetSecurity) WithSecurity(sec *driver.Security) *ExpectedSetSecurity
WithSecurity sets the expected security object for the DB.SetSecurity() call.
type ExpectedStats ¶
type ExpectedStats struct {
// contains filtered or unexported fields
}
ExpectedStats represents an expectation for a call to DB.Stats().
func (*ExpectedStats) String ¶
func (e *ExpectedStats) String() string
func (*ExpectedStats) WillDelay ¶
func (e *ExpectedStats) WillDelay(delay time.Duration) *ExpectedStats
WillDelay causes the call to DB.Stats() to delay.
func (*ExpectedStats) WillExecute ¶
func (e *ExpectedStats) WillExecute(cb func(ctx context.Context) (*driver.DBStats, error)) *ExpectedStats
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedStats) WillReturn ¶
func (e *ExpectedStats) WillReturn(ret0 *driver.DBStats) *ExpectedStats
WillReturn sets the values that will be returned by the call to DB.Stats().
func (*ExpectedStats) WillReturnError ¶
func (e *ExpectedStats) WillReturnError(err error) *ExpectedStats
WillReturnError sets the error value that will be returned by the call to DB.Stats().
type ExpectedVersion ¶
type ExpectedVersion struct {
// contains filtered or unexported fields
}
ExpectedVersion represents an expectation for a call to Version().
func (*ExpectedVersion) String ¶
func (e *ExpectedVersion) String() string
func (*ExpectedVersion) WillDelay ¶
func (e *ExpectedVersion) WillDelay(delay time.Duration) *ExpectedVersion
WillDelay causes the call to Version() to delay.
func (*ExpectedVersion) WillExecute ¶
func (e *ExpectedVersion) WillExecute(cb func(ctx context.Context) (*driver.Version, error)) *ExpectedVersion
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedVersion) WillReturn ¶
func (e *ExpectedVersion) WillReturn(ret0 *driver.Version) *ExpectedVersion
WillReturn sets the values that will be returned by the call to Version().
func (*ExpectedVersion) WillReturnError ¶
func (e *ExpectedVersion) WillReturnError(err error) *ExpectedVersion
WillReturnError sets the error value that will be returned by the call to Version().
type ExpectedViewCleanup ¶
type ExpectedViewCleanup struct {
// contains filtered or unexported fields
}
ExpectedViewCleanup represents an expectation for a call to DB.ViewCleanup().
func (*ExpectedViewCleanup) String ¶
func (e *ExpectedViewCleanup) String() string
func (*ExpectedViewCleanup) WillDelay ¶
func (e *ExpectedViewCleanup) WillDelay(delay time.Duration) *ExpectedViewCleanup
WillDelay causes the call to DB.ViewCleanup() to delay.
func (*ExpectedViewCleanup) WillExecute ¶
func (e *ExpectedViewCleanup) WillExecute(cb func(ctx context.Context) error) *ExpectedViewCleanup
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (*ExpectedViewCleanup) WillReturnError ¶
func (e *ExpectedViewCleanup) WillReturnError(err error) *ExpectedViewCleanup
WillReturnError sets the error value that will be returned by the call to DB.ViewCleanup().
type Replication ¶
type Replication struct {
// contains filtered or unexported fields
}
Replication is a replication instance.
func (*Replication) EndTime ¶
func (r *Replication) EndTime(t time.Time) *Replication
EndTime sets the replication end time.
func (*Replication) Err ¶
func (r *Replication) Err(e error) *Replication
Err sets the replication error.
func (*Replication) ID ¶
func (r *Replication) ID(id string) *Replication
ID sets the replication ID.
func (*Replication) MarshalJSON ¶
func (r *Replication) MarshalJSON() ([]byte, error)
MarshalJSON satisfies the json.Marshaler interface.
func (*Replication) Source ¶
func (r *Replication) Source(s string) *Replication
Source sets the replication source.
func (*Replication) StartTime ¶
func (r *Replication) StartTime(t time.Time) *Replication
StartTime sets the replication start time.
func (*Replication) State ¶
func (r *Replication) State(s kivik.ReplicationState) *Replication
State sets the replication state.
func (*Replication) Target ¶
func (r *Replication) Target(t string) *Replication
Target sets the replication target.
type Rows ¶
type Rows struct {
// contains filtered or unexported fields
}
Rows is a mocked collection of rows.
func NewRows ¶
func NewRows() *Rows
NewRows returns a new, empty set of rows, which can be returned by any of the row-returning expectations.
func (*Rows) AddRow ¶
AddRow adds a row to be returned by the rows iterator. If AddrowError has been set, this method will panic.
func (*Rows) AddRowError ¶
AddRowError adds an error to be returned during row iteration.
func (*Rows) CloseError ¶
CloseError sets an error to be returned when the rows iterator is closed.
func (*Rows) Final ¶
Final converts the Rows object to a driver.Rows. This method is intended for use within WillExecute() to return results.
type Updates ¶
type Updates struct {
// contains filtered or unexported fields
}
Updates is a mocked collection of database updates.
func NewDBUpdates ¶
func NewDBUpdates() *Updates
NewDBUpdates returns a new, empty update set, which can be returned by the DBUpdates() expectation.
func (*Updates) AddUpdate ¶
AddUpdate adds a database update to be returned by the DBUpdates iterator. If AddUpdateError has been set, this method will panic.
func (*Updates) AddUpdateError ¶
AddUpdateError adds an error to be returned during update iteration.
func (*Updates) CloseError ¶
CloseError sets an error to be returned when the updates iterator is closed.