kivikmock: github.com/go-kivik/kivikmock Index | Files | Directories

package kivikmock

import "github.com/go-kivik/kivikmock"

Package kivikmock provides a full Kivik driver implementation, for mocking unit tests.

Index

Package Files

bulk.go changes.go client.go client_gen.go clientexpectations_gen.go clientmock.go clientmock_gen.go common.go db.go db_gen.go dbexpectations.go dbexpectations_gen.go dbmock.go dbmock_gen.go driver.go expectations.go helpers.go iter.go kivikmock.go meets.go rows.go updates.go util.go

func Document Uses

func Document(i interface{}) (*driver.Document, error)

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

func DocumentT Uses

func DocumentT(t *testing.T, i interface{}) *driver.Document

DocumentT calls Document, and passes any error to t.Fatal.

func ToDocument Uses

func ToDocument(i interface{}) (*driver.Document, error)

ToDocument is deprecated.

func ToDocumentT Uses

func ToDocumentT(t *testing.T, i interface{}) *driver.Document

ToDocumentT is deprecated.

type BulkResults Uses

type BulkResults struct {
    // contains filtered or unexported fields
}

BulkResults is a mocked collection of BulkDoc results.

func NewBulkResults Uses

func NewBulkResults() *BulkResults

NewBulkResults returns a new, empty set of bulk results, which can be returned by the DB.BulkDocs() expectation.

func (*BulkResults) AddDelay Uses

func (r *BulkResults) AddDelay(delay time.Duration) *BulkResults

AddDelay adds a delay before the next iteration will complete.

func (*BulkResults) AddResult Uses

func (r *BulkResults) AddResult(result *driver.BulkResult) *BulkResults

AddResult adds a bulk result to be returned by the iterator. If AddResultError has been set, this method will panic.

func (*BulkResults) AddResultError Uses

func (r *BulkResults) AddResultError(err error) *BulkResults

AddResultError adds an error to be returned during iteration.

func (*BulkResults) Close Uses

func (i *BulkResults) Close() error

func (*BulkResults) CloseError Uses

func (r *BulkResults) CloseError(err error) *BulkResults

CloseError sets an error to be returned when the iterator is closed.

func (*BulkResults) Final Uses

func (r *BulkResults) Final() driver.BulkResults

Final converts the BulkResults object to a driver.BulkResults. This method is intended for use within WillExecute() to return results.

type Changes Uses

type Changes struct {
    // contains filtered or unexported fields
}

Changes is a mocked collection of Changes results.

func NewChanges Uses

func NewChanges() *Changes

NewChanges returns a new, empty changes set, which can be returned by the DB.Changes() expectation.

func (*Changes) AddChange Uses

func (r *Changes) AddChange(change *driver.Change) *Changes

AddChange adds a change result to be returned by the iterator. If AddResultError has been set, this method will panic.

func (*Changes) AddChangeError Uses

func (r *Changes) AddChangeError(err error) *Changes

AddChangeError adds an error to be returned during iteration.

func (*Changes) AddDelay Uses

func (r *Changes) AddDelay(delay time.Duration) *Changes

AddDelay adds a delay before the next iteration will complete.

func (*Changes) Close Uses

func (i *Changes) Close() error

func (*Changes) CloseError Uses

func (r *Changes) CloseError(err error) *Changes

CloseError sets an error to be returned when the iterator is closed.

func (*Changes) ETag Uses

func (r *Changes) ETag(etag string) *Changes

ETag sets the etag value to be returned by the changes iterator.

func (*Changes) Final Uses

func (r *Changes) Final() driver.Changes

Final converts the Changes object to a driver.Changes. This method is intended for use within WillExecute() to return results.

func (*Changes) LastSeq Uses

func (r *Changes) LastSeq(seq string) *Changes

LastSeq sets the last_seq value to be returned by the changes iterator.

func (*Changes) Pending Uses

func (r *Changes) Pending(pending int64) *Changes

Pending sets the pending value to be returned by the changes iterator.

type Client Uses

type Client struct {
    // contains filtered or unexported fields
}

Client allows configuring the mock kivik client.

func New Uses

func New() (*kivik.Client, *Client, error)

New creates a kivik client connection and a mock to manage expectations.

func NewT Uses

func NewT(t *testing.T) (*kivik.Client, *Client)

NewT works exactly as New, except that any error will be passed to t.Fatal.

func (*Client) ExpectAllDBs Uses

func (c *Client) ExpectAllDBs() *ExpectedAllDBs

ExpectAllDBs queues an expectation that AllDBs will be called.

func (*Client) ExpectAuthenticate Uses

func (c *Client) ExpectAuthenticate() *ExpectedAuthenticate

ExpectAuthenticate queues an expectation for an Authenticate() call.

func (*Client) ExpectClose Uses

func (c *Client) ExpectClose() *ExpectedClose

ExpectClose queues an expectation that Close will be called.

func (*Client) ExpectClusterSetup Uses

func (c *Client) ExpectClusterSetup() *ExpectedClusterSetup

ExpectClusterSetup queues an expectation that ClusterSetup will be called.

func (*Client) ExpectClusterStatus Uses

func (c *Client) ExpectClusterStatus() *ExpectedClusterStatus

ExpectClusterStatus queues an expectation that ClusterStatus will be called.

func (*Client) ExpectConfig Uses

func (c *Client) ExpectConfig() *ExpectedConfig

ExpectConfig queues an expectation that Config will be called.

func (*Client) ExpectConfigSection Uses

func (c *Client) ExpectConfigSection() *ExpectedConfigSection

ExpectConfigSection queues an expectation that ConfigSection will be called.

func (*Client) ExpectConfigValue Uses

func (c *Client) ExpectConfigValue() *ExpectedConfigValue

ExpectConfigValue queues an expectation that ConfigValue will be called.

func (*Client) ExpectCreateDB Uses

func (c *Client) ExpectCreateDB() *ExpectedCreateDB

ExpectCreateDB queues an expectation for a CreateDB() call.

func (*Client) ExpectDB Uses

func (c *Client) ExpectDB() *ExpectedDB

ExpectDB queues an expectation that DB will be called.

func (*Client) ExpectDBExists Uses

func (c *Client) ExpectDBExists() *ExpectedDBExists

ExpectDBExists queues an expectation that DBExists will be called.

func (*Client) ExpectDBUpdates Uses

func (c *Client) ExpectDBUpdates() *ExpectedDBUpdates

ExpectDBUpdates queues an expectation that DBUpdates will be called.

func (*Client) ExpectDBsStats Uses

func (c *Client) ExpectDBsStats() *ExpectedDBsStats

ExpectDBsStats queues an expectation that DBsStats will be called.

func (*Client) ExpectDeleteConfigKey Uses

func (c *Client) ExpectDeleteConfigKey() *ExpectedDeleteConfigKey

ExpectDeleteConfigKey queues an expectation that DeleteConfigKey will be called.

func (*Client) ExpectDestroyDB Uses

func (c *Client) ExpectDestroyDB() *ExpectedDestroyDB

ExpectDestroyDB queues an expectation that DestroyDB will be called.

func (*Client) ExpectGetReplications Uses

func (c *Client) ExpectGetReplications() *ExpectedGetReplications

ExpectGetReplications queues an expectation that GetReplications will be called.

func (*Client) ExpectPing Uses

func (c *Client) ExpectPing() *ExpectedPing

ExpectPing queues an expectation that Ping will be called.

func (*Client) ExpectReplicate Uses

func (c *Client) ExpectReplicate() *ExpectedReplicate

ExpectReplicate queues an expectation that Replicate will be called.

func (*Client) ExpectSession Uses

func (c *Client) ExpectSession() *ExpectedSession

ExpectSession queues an expectation that Session will be called.

func (*Client) ExpectSetConfigValue Uses

func (c *Client) ExpectSetConfigValue() *ExpectedSetConfigValue

ExpectSetConfigValue queues an expectation that SetConfigValue will be called.

func (*Client) ExpectVersion Uses

func (c *Client) ExpectVersion() *ExpectedVersion

ExpectVersion queues an expectation that Version will be called.

func (*Client) ExpectationsWereMet Uses

func (c *Client) ExpectationsWereMet() error

ExpectationsWereMet returns an error if any outstanding expectatios were not met.

func (*Client) MatchExpectationsInOrder Uses

func (c *Client) MatchExpectationsInOrder(b bool)

MatchExpectationsInOrder sets whether expectations should occur in the precise order in which they were defined.

func (*Client) NewDB Uses

func (c *Client) NewDB() *DB

NewDB creates a new mock DB object, which can be used along with ExpectDB() or ExpectCreateDB() calls to mock database actions.

func (*Client) NewReplication Uses

func (c *Client) NewReplication() *Replication

NewReplication returns a new, empty Replication.

type DB Uses

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 Uses

func (db *DB) ExpectAllDocs() *ExpectedAllDocs

ExpectAllDocs queues an expectation that DB.AllDocs will be called.

func (*DB) ExpectBulkDocs Uses

func (db *DB) ExpectBulkDocs() *ExpectedBulkDocs

ExpectBulkDocs queues an expectation that DB.BulkDocs will be called.

func (*DB) ExpectBulkGet Uses

func (db *DB) ExpectBulkGet() *ExpectedBulkGet

ExpectBulkGet queues an expectation that DB.BulkGet will be called.

func (*DB) ExpectChanges Uses

func (db *DB) ExpectChanges() *ExpectedChanges

ExpectChanges queues an expectation that DB.Changes will be called.

func (*DB) ExpectClose Uses

func (db *DB) ExpectClose() *ExpectedDBClose

ExpectClose queues an expectation for DB.Close() to be called.

func (*DB) ExpectCompact Uses

func (db *DB) ExpectCompact() *ExpectedCompact

ExpectCompact queues an expectation that DB.Compact will be called.

func (*DB) ExpectCompactView Uses

func (db *DB) ExpectCompactView() *ExpectedCompactView

ExpectCompactView queues an expectation that DB.CompactView will be called.

func (*DB) ExpectCopy Uses

func (db *DB) ExpectCopy() *ExpectedCopy

ExpectCopy queues an expectation that DB.Copy will be called.

func (*DB) ExpectCreateDoc Uses

func (db *DB) ExpectCreateDoc() *ExpectedCreateDoc

ExpectCreateDoc queues an expectation that DB.CreateDoc will be called.

func (*DB) ExpectCreateIndex Uses

func (db *DB) ExpectCreateIndex() *ExpectedCreateIndex

ExpectCreateIndex queues an expectation that DB.CreateIndex will be called.

func (*DB) ExpectDelete Uses

func (db *DB) ExpectDelete() *ExpectedDelete

ExpectDelete queues an expectation that DB.Delete will be called.

func (*DB) ExpectDeleteAttachment Uses

func (db *DB) ExpectDeleteAttachment() *ExpectedDeleteAttachment

ExpectDeleteAttachment queues an expectation that DB.DeleteAttachment will be called.

func (*DB) ExpectDeleteIndex Uses

func (db *DB) ExpectDeleteIndex() *ExpectedDeleteIndex

ExpectDeleteIndex queues an expectation that DB.DeleteIndex will be called.

func (*DB) ExpectDesignDocs Uses

func (db *DB) ExpectDesignDocs() *ExpectedDesignDocs

ExpectDesignDocs queues an expectation that DB.DesignDocs will be called.

func (*DB) ExpectExplain Uses

func (db *DB) ExpectExplain() *ExpectedExplain

ExpectExplain queues an expectation that DB.Explain will be called.

func (*DB) ExpectFind Uses

func (db *DB) ExpectFind() *ExpectedFind

ExpectFind queues an expectation that DB.Find will be called.

func (*DB) ExpectFlush Uses

func (db *DB) ExpectFlush() *ExpectedFlush

ExpectFlush queues an expectation that DB.Flush will be called.

func (*DB) ExpectGet Uses

func (db *DB) ExpectGet() *ExpectedGet

ExpectGet queues an expectation that DB.Get will be called.

func (*DB) ExpectGetAttachment Uses

func (db *DB) ExpectGetAttachment() *ExpectedGetAttachment

ExpectGetAttachment queues an expectation that DB.GetAttachment will be called.

func (*DB) ExpectGetAttachmentMeta Uses

func (db *DB) ExpectGetAttachmentMeta() *ExpectedGetAttachmentMeta

ExpectGetAttachmentMeta queues an expectation that DB.GetAttachmentMeta will be called.

func (*DB) ExpectGetIndexes Uses

func (db *DB) ExpectGetIndexes() *ExpectedGetIndexes

ExpectGetIndexes queues an expectation that DB.GetIndexes will be called.

func (*DB) ExpectGetMeta Uses

func (db *DB) ExpectGetMeta() *ExpectedGetMeta

ExpectGetMeta queues an expectation that DB.GetMeta will be called.

func (*DB) ExpectLocalDocs Uses

func (db *DB) ExpectLocalDocs() *ExpectedLocalDocs

ExpectLocalDocs queues an expectation that DB.LocalDocs will be called.

func (*DB) ExpectPurge Uses

func (db *DB) ExpectPurge() *ExpectedPurge

ExpectPurge queues an expectation that DB.Purge will be called.

func (*DB) ExpectPut Uses

func (db *DB) ExpectPut() *ExpectedPut

ExpectPut queues an expectation that DB.Put will be called.

func (*DB) ExpectPutAttachment Uses

func (db *DB) ExpectPutAttachment() *ExpectedPutAttachment

ExpectPutAttachment queues an expectation that DB.PutAttachment will be called.

func (*DB) ExpectQuery Uses

func (db *DB) ExpectQuery() *ExpectedQuery

ExpectQuery queues an expectation that DB.Query will be called.

func (*DB) ExpectRevsDiff Uses

func (db *DB) ExpectRevsDiff() *ExpectedRevsDiff

ExpectRevsDiff queues an expectation that DB.RevsDiff will be called.

func (*DB) ExpectSecurity Uses

func (db *DB) ExpectSecurity() *ExpectedSecurity

ExpectSecurity queues an expectation that DB.Security will be called.

func (*DB) ExpectSetSecurity Uses

func (db *DB) ExpectSetSecurity() *ExpectedSetSecurity

ExpectSetSecurity queues an expectation that DB.SetSecurity will be called.

func (*DB) ExpectStats Uses

func (db *DB) ExpectStats() *ExpectedStats

ExpectStats queues an expectation that DB.Stats will be called.

func (*DB) ExpectViewCleanup Uses

func (db *DB) ExpectViewCleanup() *ExpectedViewCleanup

ExpectViewCleanup queues an expectation that DB.ViewCleanup will be called.

type ExpectedAllDBs Uses

type ExpectedAllDBs struct {
    // contains filtered or unexported fields
}

ExpectedAllDBs represents an expectation for a call to AllDBs().

func (*ExpectedAllDBs) String Uses

func (e *ExpectedAllDBs) String() string

String satisfies the fmt.Stringer interface.

func (*ExpectedAllDBs) WillDelay Uses

func (e *ExpectedAllDBs) WillDelay(delay time.Duration) *ExpectedAllDBs

WillDelay causes the call to AllDBs() to delay.

func (*ExpectedAllDBs) WillExecute Uses

func (e *ExpectedAllDBs) WillExecute(cb func(ctx context.Context, options map[string]interface{}) ([]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 Uses

func (e *ExpectedAllDBs) WillReturn(ret0 []string) *ExpectedAllDBs

WillReturn sets the values that will be returned by the call to AllDBs().

func (*ExpectedAllDBs) WillReturnError Uses

func (e *ExpectedAllDBs) WillReturnError(err error) *ExpectedAllDBs

WillReturnError sets the error value that will be returned by the call to AllDBs().

func (*ExpectedAllDBs) WithOptions Uses

func (e *ExpectedAllDBs) WithOptions(options map[string]interface{}) *ExpectedAllDBs

WithOptions sets the expected options for the call to AllDBs().

type ExpectedAllDocs Uses

type ExpectedAllDocs struct {
    // contains filtered or unexported fields
}

ExpectedAllDocs represents an expectation for a call to DB.AllDocs().

func (*ExpectedAllDocs) String Uses

func (e *ExpectedAllDocs) String() string

func (*ExpectedAllDocs) WillDelay Uses

func (e *ExpectedAllDocs) WillDelay(delay time.Duration) *ExpectedAllDocs

WillDelay causes the call to DB.AllDocs() to delay.

func (*ExpectedAllDocs) WillExecute Uses

func (e *ExpectedAllDocs) WillExecute(cb func(ctx context.Context, options map[string]interface{}) (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 Uses

func (e *ExpectedAllDocs) WillReturn(ret0 *Rows) *ExpectedAllDocs

WillReturn sets the values that will be returned by the call to DB.AllDocs().

func (*ExpectedAllDocs) WillReturnError Uses

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 Uses

func (e *ExpectedAllDocs) WithOptions(options map[string]interface{}) *ExpectedAllDocs

WithOptions sets the expected options for the call to DB.AllDocs().

type ExpectedAuthenticate Uses

type ExpectedAuthenticate struct {
    // contains filtered or unexported fields
}

ExpectedAuthenticate is used to manage *kivik.Client.Authenticate expectation returned by Mock.ExpectAuthenticate.

func (*ExpectedAuthenticate) String Uses

func (e *ExpectedAuthenticate) String() string

String satisfies the fmt.Stringer interface.

func (*ExpectedAuthenticate) WillDelay Uses

func (e *ExpectedAuthenticate) WillDelay(d time.Duration) *ExpectedAuthenticate

WillDelay will cause execution of Authenticate() to delay by duration d.

func (*ExpectedAuthenticate) WillExecute Uses

func (e *ExpectedAuthenticate) WillExecute(cb func(ctx context.Context, authenticator interface{}) error) *ExpectedAuthenticate

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 (*ExpectedAuthenticate) WillReturnError Uses

func (e *ExpectedAuthenticate) WillReturnError(err error) *ExpectedAuthenticate

WillReturnError allows setting an error for *kivik.Client.Authenticate action.

func (*ExpectedAuthenticate) WithAuthenticator Uses

func (e *ExpectedAuthenticate) WithAuthenticator(authenticator interface{}) *ExpectedAuthenticate

WithAuthenticator will match the the provide authenticator _type_ against that provided. There is no way to validate the authenticated credentials with this method.

type ExpectedBulkDocs Uses

type ExpectedBulkDocs struct {
    // contains filtered or unexported fields
}

ExpectedBulkDocs represents an expectation for a call to DB.BulkDocs().

func (*ExpectedBulkDocs) String Uses

func (e *ExpectedBulkDocs) String() string

func (*ExpectedBulkDocs) WillDelay Uses

func (e *ExpectedBulkDocs) WillDelay(delay time.Duration) *ExpectedBulkDocs

WillDelay causes the call to DB.BulkDocs() to delay.

func (*ExpectedBulkDocs) WillExecute Uses

func (e *ExpectedBulkDocs) WillExecute(cb func(ctx context.Context, arg0 []interface{}, options map[string]interface{}) (driver.BulkResults, 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 Uses

func (e *ExpectedBulkDocs) WillReturn(ret0 *BulkResults) *ExpectedBulkDocs

WillReturn sets the values that will be returned by the call to DB.BulkDocs().

func (*ExpectedBulkDocs) WillReturnError Uses

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 Uses

func (e *ExpectedBulkDocs) WithOptions(options map[string]interface{}) *ExpectedBulkDocs

WithOptions sets the expected options for the call to DB.BulkDocs().

type ExpectedBulkGet Uses

type ExpectedBulkGet struct {
    // contains filtered or unexported fields
}

ExpectedBulkGet represents an expectation for a call to DB.BulkGet().

func (*ExpectedBulkGet) String Uses

func (e *ExpectedBulkGet) String() string

func (*ExpectedBulkGet) WillDelay Uses

func (e *ExpectedBulkGet) WillDelay(delay time.Duration) *ExpectedBulkGet

WillDelay causes the call to DB.BulkGet() to delay.

func (*ExpectedBulkGet) WillExecute Uses

func (e *ExpectedBulkGet) WillExecute(cb func(ctx context.Context, arg0 []driver.BulkGetReference, options map[string]interface{}) (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 Uses

func (e *ExpectedBulkGet) WillReturn(ret0 *Rows) *ExpectedBulkGet

WillReturn sets the values that will be returned by the call to DB.BulkGet().

func (*ExpectedBulkGet) WillReturnError Uses

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 Uses

func (e *ExpectedBulkGet) WithOptions(options map[string]interface{}) *ExpectedBulkGet

WithOptions sets the expected options for the call to DB.BulkGet().

type ExpectedChanges Uses

type ExpectedChanges struct {
    // contains filtered or unexported fields
}

ExpectedChanges represents an expectation for a call to DB.Changes().

func (*ExpectedChanges) String Uses

func (e *ExpectedChanges) String() string

func (*ExpectedChanges) WillDelay Uses

func (e *ExpectedChanges) WillDelay(delay time.Duration) *ExpectedChanges

WillDelay causes the call to DB.Changes() to delay.

func (*ExpectedChanges) WillExecute Uses

func (e *ExpectedChanges) WillExecute(cb func(ctx context.Context, options map[string]interface{}) (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 Uses

func (e *ExpectedChanges) WillReturn(ret0 *Changes) *ExpectedChanges

WillReturn sets the values that will be returned by the call to DB.Changes().

func (*ExpectedChanges) WillReturnError Uses

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 Uses

func (e *ExpectedChanges) WithOptions(options map[string]interface{}) *ExpectedChanges

WithOptions sets the expected options for the call to DB.Changes().

type ExpectedClose Uses

type ExpectedClose struct {
    // contains filtered or unexported fields
}

ExpectedClose represents an expectation for a call to Close().

func (*ExpectedClose) String Uses

func (e *ExpectedClose) String() string

func (*ExpectedClose) WillDelay Uses

func (e *ExpectedClose) WillDelay(delay time.Duration) *ExpectedClose

WillDelay causes the call to Close() to delay.

func (*ExpectedClose) WillExecute Uses

func (e *ExpectedClose) WillExecute(cb func(ctx context.Context) 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 Uses

func (e *ExpectedClose) WillReturnError(err error) *ExpectedClose

WillReturnError sets the error value that will be returned by the call to Close().

type ExpectedClusterSetup Uses

type ExpectedClusterSetup struct {
    // contains filtered or unexported fields
}

ExpectedClusterSetup represents an expectation for a call to ClusterSetup().

func (*ExpectedClusterSetup) String Uses

func (e *ExpectedClusterSetup) String() string

func (*ExpectedClusterSetup) WillDelay Uses

func (e *ExpectedClusterSetup) WillDelay(delay time.Duration) *ExpectedClusterSetup

WillDelay causes the call to ClusterSetup() to delay.

func (*ExpectedClusterSetup) WillExecute Uses

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 Uses

func (e *ExpectedClusterSetup) WillReturnError(err error) *ExpectedClusterSetup

WillReturnError sets the error value that will be returned by the call to ClusterSetup().

func (*ExpectedClusterSetup) WithAction Uses

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 Uses

type ExpectedClusterStatus struct {
    // contains filtered or unexported fields
}

ExpectedClusterStatus represents an expectation for a call to ClusterStatus().

func (*ExpectedClusterStatus) String Uses

func (e *ExpectedClusterStatus) String() string

String satisfies the fmt.Stringer interface

func (*ExpectedClusterStatus) WillDelay Uses

func (e *ExpectedClusterStatus) WillDelay(delay time.Duration) *ExpectedClusterStatus

WillDelay causes the call to ClusterStatus() to delay.

func (*ExpectedClusterStatus) WillExecute Uses

func (e *ExpectedClusterStatus) WillExecute(cb func(ctx context.Context, options map[string]interface{}) (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 Uses

func (e *ExpectedClusterStatus) WillReturn(ret0 string) *ExpectedClusterStatus

WillReturn sets the values that will be returned by the call to ClusterStatus().

func (*ExpectedClusterStatus) WillReturnError Uses

func (e *ExpectedClusterStatus) WillReturnError(err error) *ExpectedClusterStatus

WillReturnError sets the error value that will be returned by the call to ClusterStatus().

func (*ExpectedClusterStatus) WithOptions Uses

func (e *ExpectedClusterStatus) WithOptions(options map[string]interface{}) *ExpectedClusterStatus

WithOptions sets the expected options for the call to ClusterStatus().

type ExpectedCompact Uses

type ExpectedCompact struct {
    // contains filtered or unexported fields
}

ExpectedCompact represents an expectation for a call to DB.Compact().

func (*ExpectedCompact) String Uses

func (e *ExpectedCompact) String() string

func (*ExpectedCompact) WillDelay Uses

func (e *ExpectedCompact) WillDelay(delay time.Duration) *ExpectedCompact

WillDelay causes the call to DB.Compact() to delay.

func (*ExpectedCompact) WillExecute Uses

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 Uses

func (e *ExpectedCompact) WillReturnError(err error) *ExpectedCompact

WillReturnError sets the error value that will be returned by the call to DB.Compact().

type ExpectedCompactView Uses

type ExpectedCompactView struct {
    // contains filtered or unexported fields
}

ExpectedCompactView represents an expectation for a call to DB.CompactView().

func (*ExpectedCompactView) String Uses

func (e *ExpectedCompactView) String() string

func (*ExpectedCompactView) WillDelay Uses

func (e *ExpectedCompactView) WillDelay(delay time.Duration) *ExpectedCompactView

WillDelay causes the call to DB.CompactView() to delay.

func (*ExpectedCompactView) WillExecute Uses

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 Uses

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 Uses

func (e *ExpectedCompactView) WithDDoc(ddocID string) *ExpectedCompactView

WithDDoc sets the expected design doc name for the call to DB.CompactView().

type ExpectedConfig Uses

type ExpectedConfig struct {
    // contains filtered or unexported fields
}

ExpectedConfig represents an expectation for a call to Config().

func (*ExpectedConfig) String Uses

func (e *ExpectedConfig) String() string

func (*ExpectedConfig) WillDelay Uses

func (e *ExpectedConfig) WillDelay(delay time.Duration) *ExpectedConfig

WillDelay causes the call to Config() to delay.

func (*ExpectedConfig) WillExecute Uses

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 Uses

func (e *ExpectedConfig) WillReturn(ret0 driver.Config) *ExpectedConfig

WillReturn sets the values that will be returned by the call to Config().

func (*ExpectedConfig) WillReturnError Uses

func (e *ExpectedConfig) WillReturnError(err error) *ExpectedConfig

WillReturnError sets the error value that will be returned by the call to Config().

func (*ExpectedConfig) WithNode Uses

func (e *ExpectedConfig) WithNode(node string) *ExpectedConfig

type ExpectedConfigSection Uses

type ExpectedConfigSection struct {
    // contains filtered or unexported fields
}

ExpectedConfigSection represents an expectation for a call to ConfigSection().

func (*ExpectedConfigSection) String Uses

func (e *ExpectedConfigSection) String() string

func (*ExpectedConfigSection) WillDelay Uses

func (e *ExpectedConfigSection) WillDelay(delay time.Duration) *ExpectedConfigSection

WillDelay causes the call to ConfigSection() to delay.

func (*ExpectedConfigSection) WillExecute Uses

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 Uses

func (e *ExpectedConfigSection) WillReturn(ret0 driver.ConfigSection) *ExpectedConfigSection

WillReturn sets the values that will be returned by the call to ConfigSection().

func (*ExpectedConfigSection) WillReturnError Uses

func (e *ExpectedConfigSection) WillReturnError(err error) *ExpectedConfigSection

WillReturnError sets the error value that will be returned by the call to ConfigSection().

func (*ExpectedConfigSection) WithNode Uses

func (e *ExpectedConfigSection) WithNode(node string) *ExpectedConfigSection

func (*ExpectedConfigSection) WithSection Uses

func (e *ExpectedConfigSection) WithSection(section string) *ExpectedConfigSection

type ExpectedConfigValue Uses

type ExpectedConfigValue struct {
    // contains filtered or unexported fields
}

ExpectedConfigValue represents an expectation for a call to ConfigValue().

func (*ExpectedConfigValue) String Uses

func (e *ExpectedConfigValue) String() string

func (*ExpectedConfigValue) WillDelay Uses

func (e *ExpectedConfigValue) WillDelay(delay time.Duration) *ExpectedConfigValue

WillDelay causes the call to ConfigValue() to delay.

func (*ExpectedConfigValue) WillExecute Uses

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 Uses

func (e *ExpectedConfigValue) WillReturn(ret0 string) *ExpectedConfigValue

WillReturn sets the values that will be returned by the call to ConfigValue().

func (*ExpectedConfigValue) WillReturnError Uses

func (e *ExpectedConfigValue) WillReturnError(err error) *ExpectedConfigValue

WillReturnError sets the error value that will be returned by the call to ConfigValue().

func (*ExpectedConfigValue) WithKey Uses

func (e *ExpectedConfigValue) WithKey(key string) *ExpectedConfigValue

func (*ExpectedConfigValue) WithNode Uses

func (e *ExpectedConfigValue) WithNode(node string) *ExpectedConfigValue

func (*ExpectedConfigValue) WithSection Uses

func (e *ExpectedConfigValue) WithSection(section string) *ExpectedConfigValue

type ExpectedCopy Uses

type ExpectedCopy struct {
    // contains filtered or unexported fields
}

ExpectedCopy represents an expectation for a call to DB.Copy().

func (*ExpectedCopy) String Uses

func (e *ExpectedCopy) String() string

func (*ExpectedCopy) WillDelay Uses

func (e *ExpectedCopy) WillDelay(delay time.Duration) *ExpectedCopy

WillDelay causes the call to DB.Copy() to delay.

func (*ExpectedCopy) WillExecute Uses

func (e *ExpectedCopy) WillExecute(cb func(ctx context.Context, arg0 string, arg1 string, options map[string]interface{}) (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 Uses

func (e *ExpectedCopy) WillReturn(ret0 string) *ExpectedCopy

WillReturn sets the values that will be returned by the call to DB.Copy().

func (*ExpectedCopy) WillReturnError Uses

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 Uses

func (e *ExpectedCopy) WithOptions(options map[string]interface{}) *ExpectedCopy

WithOptions sets the expected options for the call to DB.Copy().

func (*ExpectedCopy) WithSourceID Uses

func (e *ExpectedCopy) WithSourceID(docID string) *ExpectedCopy

WithSourceID sets the expectation for the docID passed to the DB.Copy() call.

func (*ExpectedCopy) WithTargetID Uses

func (e *ExpectedCopy) WithTargetID(docID string) *ExpectedCopy

WithTargetID sets the expectation for the docID passed to the DB.Copy() call.

type ExpectedCreateDB Uses

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 Uses

func (e *ExpectedCreateDB) String() string

func (*ExpectedCreateDB) WillDelay Uses

func (e *ExpectedCreateDB) WillDelay(delay time.Duration) *ExpectedCreateDB

WillDelay will cause execution of DB() to delay by duration d.

func (*ExpectedCreateDB) WillExecute Uses

func (e *ExpectedCreateDB) WillExecute(cb func(ctx context.Context, arg0 string, options map[string]interface{}) 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 Uses

func (e *ExpectedCreateDB) WillReturnError(err error) *ExpectedCreateDB

WillReturnError sets the return value for the DB() call.

func (*ExpectedCreateDB) WithName Uses

func (e *ExpectedCreateDB) WithName(name string) *ExpectedCreateDB

WithName sets the expectation that DB() will be called with this name.

func (*ExpectedCreateDB) WithOptions Uses

func (e *ExpectedCreateDB) WithOptions(options map[string]interface{}) *ExpectedCreateDB

WithOptions set the expectation that DB() will be called with these options.

type ExpectedCreateDoc Uses

type ExpectedCreateDoc struct {
    // contains filtered or unexported fields
}

ExpectedCreateDoc represents an expectation for a call to DB.CreateDoc().

func (*ExpectedCreateDoc) String Uses

func (e *ExpectedCreateDoc) String() string

func (*ExpectedCreateDoc) WillDelay Uses

func (e *ExpectedCreateDoc) WillDelay(delay time.Duration) *ExpectedCreateDoc

WillDelay causes the call to DB.CreateDoc() to delay.

func (*ExpectedCreateDoc) WillExecute Uses

func (e *ExpectedCreateDoc) WillExecute(cb func(ctx context.Context, arg0 interface{}, options map[string]interface{}) (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 Uses

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 Uses

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 Uses

func (e *ExpectedCreateDoc) WithDoc(doc interface{}) *ExpectedCreateDoc

WithDoc sets the expected doc for the call to CreateDoc().

func (*ExpectedCreateDoc) WithOptions Uses

func (e *ExpectedCreateDoc) WithOptions(options map[string]interface{}) *ExpectedCreateDoc

WithOptions sets the expected options for the call to DB.CreateDoc().

type ExpectedCreateIndex Uses

type ExpectedCreateIndex struct {
    // contains filtered or unexported fields
}

ExpectedCreateIndex represents an expectation for a call to DB.CreateIndex().

func (*ExpectedCreateIndex) String Uses

func (e *ExpectedCreateIndex) String() string

func (*ExpectedCreateIndex) WillDelay Uses

func (e *ExpectedCreateIndex) WillDelay(delay time.Duration) *ExpectedCreateIndex

WillDelay causes the call to DB.CreateIndex() to delay.

func (*ExpectedCreateIndex) WillExecute Uses

func (e *ExpectedCreateIndex) WillExecute(cb func(ctx context.Context, arg0 string, arg1 string, arg2 interface{}) 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 Uses

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 Uses

func (e *ExpectedCreateIndex) WithDDocID(ddocID string) *ExpectedCreateIndex

WithDDocID sets the expected ddocID value for the DB.CreateIndex() call.

func (*ExpectedCreateIndex) WithIndex Uses

func (e *ExpectedCreateIndex) WithIndex(index interface{}) *ExpectedCreateIndex

WithIndex sets the expected index value for the DB.CreateIndex() call.

func (*ExpectedCreateIndex) WithName Uses

func (e *ExpectedCreateIndex) WithName(name string) *ExpectedCreateIndex

WithName sets the expected name value for the DB.CreateIndex() call.

type ExpectedDB Uses

type ExpectedDB struct {
    // contains filtered or unexported fields
}

ExpectedDB represents an expectation for a call to DB().

func (*ExpectedDB) String Uses

func (e *ExpectedDB) String() string

func (*ExpectedDB) WillDelay Uses

func (e *ExpectedDB) WillDelay(delay time.Duration) *ExpectedDB

WillDelay causes the call to DB() to delay.

func (*ExpectedDB) WillExecute Uses

func (e *ExpectedDB) WillExecute(cb func(ctx context.Context, arg0 string, options map[string]interface{}) (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 Uses

func (e *ExpectedDB) WillReturn(ret0 *DB) *ExpectedDB

WillReturn sets the values that will be returned by the call to DB().

func (*ExpectedDB) WillReturnError Uses

func (e *ExpectedDB) WillReturnError(err error) *ExpectedDB

WillReturnError sets the error value that will be returned by the call to DB().

func (*ExpectedDB) WithName Uses

func (e *ExpectedDB) WithName(name string) *ExpectedDB

WithName sets the expectation that DB() will be called with this name.

func (*ExpectedDB) WithOptions Uses

func (e *ExpectedDB) WithOptions(options map[string]interface{}) *ExpectedDB

WithOptions sets the expected options for the call to DB().

type ExpectedDBClose Uses

type ExpectedDBClose struct {
    // contains filtered or unexported fields
}

ExpectedDBClose is used to manage *kivik.Client.Close expectation returned by Mock.ExpectClose.

func (*ExpectedDBClose) String Uses

func (e *ExpectedDBClose) String() string

func (*ExpectedDBClose) WillDelay Uses

func (e *ExpectedDBClose) WillDelay(d time.Duration) *ExpectedDBClose

WillDelay will cause execution of Close() to delay by duration d.

func (*ExpectedDBClose) WillExecute Uses

func (e *ExpectedDBClose) WillExecute(cb func(ctx context.Context) 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 Uses

func (e *ExpectedDBClose) WillReturnError(err error) *ExpectedDBClose

WillReturnError allows setting an error for *kivik.Client.Close action.

type ExpectedDBExists Uses

type ExpectedDBExists struct {
    // contains filtered or unexported fields
}

ExpectedDBExists represents an expectation for a call to DBExists().

func (*ExpectedDBExists) String Uses

func (e *ExpectedDBExists) String() string

func (*ExpectedDBExists) WillDelay Uses

func (e *ExpectedDBExists) WillDelay(delay time.Duration) *ExpectedDBExists

WillDelay causes the call to DBExists() to delay.

func (*ExpectedDBExists) WillExecute Uses

func (e *ExpectedDBExists) WillExecute(cb func(ctx context.Context, arg0 string, options map[string]interface{}) (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 Uses

func (e *ExpectedDBExists) WillReturn(ret0 bool) *ExpectedDBExists

WillReturn sets the values that will be returned by the call to DBExists().

func (*ExpectedDBExists) WillReturnError Uses

func (e *ExpectedDBExists) WillReturnError(err error) *ExpectedDBExists

WillReturnError sets the error value that will be returned by the call to DBExists().

func (*ExpectedDBExists) WithName Uses

func (e *ExpectedDBExists) WithName(name string) *ExpectedDBExists

WithName sets the expectation that DBExists will be called with the provided name.

func (*ExpectedDBExists) WithOptions Uses

func (e *ExpectedDBExists) WithOptions(options map[string]interface{}) *ExpectedDBExists

WithOptions sets the expected options for the call to DBExists().

type ExpectedDBUpdates Uses

type ExpectedDBUpdates struct {
    // contains filtered or unexported fields
}

ExpectedDBUpdates represents an expectation for a call to DBUpdates().

func (*ExpectedDBUpdates) String Uses

func (e *ExpectedDBUpdates) String() string

func (*ExpectedDBUpdates) WillDelay Uses

func (e *ExpectedDBUpdates) WillDelay(delay time.Duration) *ExpectedDBUpdates

WillDelay causes the call to DBUpdates() to delay.

func (*ExpectedDBUpdates) WillExecute Uses

func (e *ExpectedDBUpdates) WillExecute(cb func(ctx context.Context) (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 Uses

func (e *ExpectedDBUpdates) WillReturn(ret0 *Updates) *ExpectedDBUpdates

WillReturn sets the values that will be returned by the call to DBUpdates().

func (*ExpectedDBUpdates) WillReturnError Uses

func (e *ExpectedDBUpdates) WillReturnError(err error) *ExpectedDBUpdates

WillReturnError sets the error value that will be returned by the call to DBUpdates().

type ExpectedDBsStats Uses

type ExpectedDBsStats struct {
    // contains filtered or unexported fields
}

ExpectedDBsStats represents an expectation for a call to DBsStats().

func (*ExpectedDBsStats) String Uses

func (e *ExpectedDBsStats) String() string

func (*ExpectedDBsStats) WillDelay Uses

func (e *ExpectedDBsStats) WillDelay(delay time.Duration) *ExpectedDBsStats

WillDelay causes the call to DBsStats() to delay.

func (*ExpectedDBsStats) WillExecute Uses

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 Uses

func (e *ExpectedDBsStats) WillReturn(ret0 []*driver.DBStats) *ExpectedDBsStats

WillReturn sets the values that will be returned by the call to DBsStats().

func (*ExpectedDBsStats) WillReturnError Uses

func (e *ExpectedDBsStats) WillReturnError(err error) *ExpectedDBsStats

WillReturnError sets the error value that will be returned by the call to DBsStats().

func (*ExpectedDBsStats) WithNames Uses

func (e *ExpectedDBsStats) WithNames(names []string) *ExpectedDBsStats

WithNames sets the expectation that DBsStats will be called with these names.

type ExpectedDelete Uses

type ExpectedDelete struct {
    // contains filtered or unexported fields
}

ExpectedDelete represents an expectation for a call to DB.Delete().

func (*ExpectedDelete) String Uses

func (e *ExpectedDelete) String() string

func (*ExpectedDelete) WillDelay Uses

func (e *ExpectedDelete) WillDelay(delay time.Duration) *ExpectedDelete

WillDelay causes the call to DB.Delete() to delay.

func (*ExpectedDelete) WillExecute Uses

func (e *ExpectedDelete) WillExecute(cb func(ctx context.Context, arg0 string, arg1 string, options map[string]interface{}) (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 Uses

func (e *ExpectedDelete) WillReturn(ret0 string) *ExpectedDelete

WillReturn sets the values that will be returned by the call to DB.Delete().

func (*ExpectedDelete) WillReturnError Uses

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 Uses

func (e *ExpectedDelete) WithDocID(docID string) *ExpectedDelete

WithDocID sets the expectation for the docID passed to the DB.Delete() call.

func (*ExpectedDelete) WithOptions Uses

func (e *ExpectedDelete) WithOptions(options map[string]interface{}) *ExpectedDelete

WithOptions sets the expected options for the call to DB.Delete().

func (*ExpectedDelete) WithRev Uses

func (e *ExpectedDelete) WithRev(rev string) *ExpectedDelete

WithRev sets the expectation for the rev passed to the DB.Delete() call.

type ExpectedDeleteAttachment Uses

type ExpectedDeleteAttachment struct {
    // contains filtered or unexported fields
}

ExpectedDeleteAttachment represents an expectation for a call to DB.DeleteAttachment().

func (*ExpectedDeleteAttachment) String Uses

func (e *ExpectedDeleteAttachment) String() string

func (*ExpectedDeleteAttachment) WillDelay Uses

func (e *ExpectedDeleteAttachment) WillDelay(delay time.Duration) *ExpectedDeleteAttachment

WillDelay causes the call to DB.DeleteAttachment() to delay.

func (*ExpectedDeleteAttachment) WillExecute Uses

func (e *ExpectedDeleteAttachment) WillExecute(cb func(ctx context.Context, arg0 string, arg1 string, arg2 string, options map[string]interface{}) (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 Uses

func (e *ExpectedDeleteAttachment) WillReturn(ret0 string) *ExpectedDeleteAttachment

WillReturn sets the values that will be returned by the call to DB.DeleteAttachment().

func (*ExpectedDeleteAttachment) WillReturnError Uses

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 Uses

func (e *ExpectedDeleteAttachment) WithDocID(docID string) *ExpectedDeleteAttachment

WithDocID sets the expectation for the docID passed to the DB.DeleteAttachment() call.

func (*ExpectedDeleteAttachment) WithFilename Uses

func (e *ExpectedDeleteAttachment) WithFilename(filename string) *ExpectedDeleteAttachment

WithFilename sets the expectation for the filename passed to the DB.DeleteAttachment() call.

func (*ExpectedDeleteAttachment) WithOptions Uses

func (e *ExpectedDeleteAttachment) WithOptions(options map[string]interface{}) *ExpectedDeleteAttachment

WithOptions sets the expected options for the call to DB.DeleteAttachment().

func (*ExpectedDeleteAttachment) WithRev Uses

func (e *ExpectedDeleteAttachment) WithRev(rev string) *ExpectedDeleteAttachment

WithRev sets the expectation for the rev passed to the DB.DeleteAttachment() call.

type ExpectedDeleteConfigKey Uses

type ExpectedDeleteConfigKey struct {
    // contains filtered or unexported fields
}

ExpectedDeleteConfigKey represents an expectation for a call to DeleteConfigKey().

func (*ExpectedDeleteConfigKey) String Uses

func (e *ExpectedDeleteConfigKey) String() string

func (*ExpectedDeleteConfigKey) WillDelay Uses

func (e *ExpectedDeleteConfigKey) WillDelay(delay time.Duration) *ExpectedDeleteConfigKey

WillDelay causes the call to DeleteConfigKey() to delay.

func (*ExpectedDeleteConfigKey) WillExecute Uses

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 Uses

func (e *ExpectedDeleteConfigKey) WillReturn(ret0 string) *ExpectedDeleteConfigKey

WillReturn sets the values that will be returned by the call to DeleteConfigKey().

func (*ExpectedDeleteConfigKey) WillReturnError Uses

func (e *ExpectedDeleteConfigKey) WillReturnError(err error) *ExpectedDeleteConfigKey

WillReturnError sets the error value that will be returned by the call to DeleteConfigKey().

func (*ExpectedDeleteConfigKey) WithKey Uses

func (e *ExpectedDeleteConfigKey) WithKey(key string) *ExpectedDeleteConfigKey

func (*ExpectedDeleteConfigKey) WithNode Uses

func (e *ExpectedDeleteConfigKey) WithNode(node string) *ExpectedDeleteConfigKey

func (*ExpectedDeleteConfigKey) WithSection Uses

func (e *ExpectedDeleteConfigKey) WithSection(section string) *ExpectedDeleteConfigKey

type ExpectedDeleteIndex Uses

type ExpectedDeleteIndex struct {
    // contains filtered or unexported fields
}

ExpectedDeleteIndex represents an expectation for a call to DB.DeleteIndex().

func (*ExpectedDeleteIndex) String Uses

func (e *ExpectedDeleteIndex) String() string

func (*ExpectedDeleteIndex) WillDelay Uses

func (e *ExpectedDeleteIndex) WillDelay(delay time.Duration) *ExpectedDeleteIndex

WillDelay causes the call to DB.DeleteIndex() to delay.

func (*ExpectedDeleteIndex) WillExecute Uses

func (e *ExpectedDeleteIndex) WillExecute(cb func(ctx context.Context, arg0 string, arg1 string) 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 Uses

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 Uses

func (e *ExpectedDeleteIndex) WithDDoc(ddoc string) *ExpectedDeleteIndex

WithDDoc sets the expected ddoc to be passed to the DB.DeleteIndex() call.

func (*ExpectedDeleteIndex) WithName Uses

func (e *ExpectedDeleteIndex) WithName(name string) *ExpectedDeleteIndex

WithName sets the expected name to be passed to the DB.DeleteIndex() call.

type ExpectedDesignDocs Uses

type ExpectedDesignDocs struct {
    // contains filtered or unexported fields
}

ExpectedDesignDocs represents an expectation for a call to DB.DesignDocs().

func (*ExpectedDesignDocs) String Uses

func (e *ExpectedDesignDocs) String() string

func (*ExpectedDesignDocs) WillDelay Uses

func (e *ExpectedDesignDocs) WillDelay(delay time.Duration) *ExpectedDesignDocs

WillDelay causes the call to DB.DesignDocs() to delay.

func (*ExpectedDesignDocs) WillExecute Uses

func (e *ExpectedDesignDocs) WillExecute(cb func(ctx context.Context, options map[string]interface{}) (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 Uses

func (e *ExpectedDesignDocs) WillReturn(ret0 *Rows) *ExpectedDesignDocs

WillReturn sets the values that will be returned by the call to DB.DesignDocs().

func (*ExpectedDesignDocs) WillReturnError Uses

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 Uses

func (e *ExpectedDesignDocs) WithOptions(options map[string]interface{}) *ExpectedDesignDocs

WithOptions sets the expected options for the call to DB.DesignDocs().

type ExpectedDestroyDB Uses

type ExpectedDestroyDB struct {
    // contains filtered or unexported fields
}

ExpectedDestroyDB represents an expectation for a call to DestroyDB().

func (*ExpectedDestroyDB) String Uses

func (e *ExpectedDestroyDB) String() string

func (*ExpectedDestroyDB) WillDelay Uses

func (e *ExpectedDestroyDB) WillDelay(delay time.Duration) *ExpectedDestroyDB

WillDelay causes the call to DestroyDB() to delay.

func (*ExpectedDestroyDB) WillExecute Uses

func (e *ExpectedDestroyDB) WillExecute(cb func(ctx context.Context, arg0 string, options map[string]interface{}) 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 Uses

func (e *ExpectedDestroyDB) WillReturnError(err error) *ExpectedDestroyDB

WillReturnError sets the error value that will be returned by the call to DestroyDB().

func (*ExpectedDestroyDB) WithName Uses

func (e *ExpectedDestroyDB) WithName(name string) *ExpectedDestroyDB

WithName sets the expectation that DestroyDB will be called with this name.

func (*ExpectedDestroyDB) WithOptions Uses

func (e *ExpectedDestroyDB) WithOptions(options map[string]interface{}) *ExpectedDestroyDB

WithOptions sets the expected options for the call to DestroyDB().

type ExpectedExplain Uses

type ExpectedExplain struct {
    // contains filtered or unexported fields
}

ExpectedExplain represents an expectation for a call to DB.Explain().

func (*ExpectedExplain) String Uses

func (e *ExpectedExplain) String() string

func (*ExpectedExplain) WillDelay Uses

func (e *ExpectedExplain) WillDelay(delay time.Duration) *ExpectedExplain

WillDelay causes the call to DB.Explain() to delay.

func (*ExpectedExplain) WillExecute Uses

func (e *ExpectedExplain) WillExecute(cb func(ctx context.Context, arg0 interface{}) (*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 Uses

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 Uses

func (e *ExpectedExplain) WillReturnError(err error) *ExpectedExplain

WillReturnError sets the error value that will be returned by the call to DB.Explain().

func (*ExpectedExplain) WithQuery Uses

func (e *ExpectedExplain) WithQuery(query interface{}) *ExpectedExplain

WithQuery sets the expected query for the Explain() call.

type ExpectedFind Uses

type ExpectedFind struct {
    // contains filtered or unexported fields
}

ExpectedFind represents an expectation for a call to DB.Find().

func (*ExpectedFind) String Uses

func (e *ExpectedFind) String() string

func (*ExpectedFind) WillDelay Uses

func (e *ExpectedFind) WillDelay(delay time.Duration) *ExpectedFind

WillDelay causes the call to DB.Find() to delay.

func (*ExpectedFind) WillExecute Uses

func (e *ExpectedFind) WillExecute(cb func(ctx context.Context, arg0 interface{}) (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 Uses

func (e *ExpectedFind) WillReturn(ret0 *Rows) *ExpectedFind

WillReturn sets the values that will be returned by the call to DB.Find().

func (*ExpectedFind) WillReturnError Uses

func (e *ExpectedFind) WillReturnError(err error) *ExpectedFind

WillReturnError sets the error value that will be returned by the call to DB.Find().

func (*ExpectedFind) WithQuery Uses

func (e *ExpectedFind) WithQuery(query interface{}) *ExpectedFind

WithQuery sets the expected query for the Find() call.

type ExpectedFlush Uses

type ExpectedFlush struct {
    // contains filtered or unexported fields
}

ExpectedFlush represents an expectation for a call to DB.Flush().

func (*ExpectedFlush) String Uses

func (e *ExpectedFlush) String() string

func (*ExpectedFlush) WillDelay Uses

func (e *ExpectedFlush) WillDelay(delay time.Duration) *ExpectedFlush

WillDelay causes the call to DB.Flush() to delay.

func (*ExpectedFlush) WillExecute Uses

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 Uses

func (e *ExpectedFlush) WillReturnError(err error) *ExpectedFlush

WillReturnError sets the error value that will be returned by the call to DB.Flush().

type ExpectedGet Uses

type ExpectedGet struct {
    // contains filtered or unexported fields
}

ExpectedGet represents an expectation for a call to DB.Get().

func (*ExpectedGet) String Uses

func (e *ExpectedGet) String() string

func (*ExpectedGet) WillDelay Uses

func (e *ExpectedGet) WillDelay(delay time.Duration) *ExpectedGet

WillDelay causes the call to DB.Get() to delay.

func (*ExpectedGet) WillExecute Uses

func (e *ExpectedGet) WillExecute(cb func(ctx context.Context, arg0 string, options map[string]interface{}) (*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 Uses

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 Uses

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 Uses

func (e *ExpectedGet) WithDocID(docID string) *ExpectedGet

WithDocID sets the expected docID for the DB.Get() call.

func (*ExpectedGet) WithOptions Uses

func (e *ExpectedGet) WithOptions(options map[string]interface{}) *ExpectedGet

WithOptions sets the expected options for the call to DB.Get().

type ExpectedGetAttachment Uses

type ExpectedGetAttachment struct {
    // contains filtered or unexported fields
}

ExpectedGetAttachment represents an expectation for a call to DB.GetAttachment().

func (*ExpectedGetAttachment) String Uses

func (e *ExpectedGetAttachment) String() string

func (*ExpectedGetAttachment) WillDelay Uses

func (e *ExpectedGetAttachment) WillDelay(delay time.Duration) *ExpectedGetAttachment

WillDelay causes the call to DB.GetAttachment() to delay.

func (*ExpectedGetAttachment) WillExecute Uses

func (e *ExpectedGetAttachment) WillExecute(cb func(ctx context.Context, arg0 string, arg1 string, options map[string]interface{}) (*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 Uses

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 Uses

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 Uses

func (e *ExpectedGetAttachment) WithDocID(docID string) *ExpectedGetAttachment

WithDocID sets the expectation for the docID passed to the DB.GetAttachment() call.

func (*ExpectedGetAttachment) WithFilename Uses

func (e *ExpectedGetAttachment) WithFilename(docID string) *ExpectedGetAttachment

WithFilename sets the expectation for the filename passed to the DB.GetAttachment() call.

func (*ExpectedGetAttachment) WithOptions Uses

func (e *ExpectedGetAttachment) WithOptions(options map[string]interface{}) *ExpectedGetAttachment

WithOptions sets the expected options for the call to DB.GetAttachment().

type ExpectedGetAttachmentMeta Uses

type ExpectedGetAttachmentMeta struct {
    // contains filtered or unexported fields
}

ExpectedGetAttachmentMeta represents an expectation for a call to DB.GetAttachmentMeta().

func (*ExpectedGetAttachmentMeta) String Uses

func (e *ExpectedGetAttachmentMeta) String() string

func (*ExpectedGetAttachmentMeta) WillDelay Uses

func (e *ExpectedGetAttachmentMeta) WillDelay(delay time.Duration) *ExpectedGetAttachmentMeta

WillDelay causes the call to DB.GetAttachmentMeta() to delay.

func (*ExpectedGetAttachmentMeta) WillExecute Uses

func (e *ExpectedGetAttachmentMeta) WillExecute(cb func(ctx context.Context, arg0 string, arg1 string, options map[string]interface{}) (*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 Uses

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 Uses

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 Uses

func (e *ExpectedGetAttachmentMeta) WithDocID(docID string) *ExpectedGetAttachmentMeta

WithDocID sets the expectation for the docID passed to the DB.GetAttachmentMeta() call.

func (*ExpectedGetAttachmentMeta) WithFilename Uses

func (e *ExpectedGetAttachmentMeta) WithFilename(filename string) *ExpectedGetAttachmentMeta

WithFilename sets the expectation for the doc passed to the DB.GetAttachmentMeta() call.

func (*ExpectedGetAttachmentMeta) WithOptions Uses

func (e *ExpectedGetAttachmentMeta) WithOptions(options map[string]interface{}) *ExpectedGetAttachmentMeta

WithOptions sets the expected options for the call to DB.GetAttachmentMeta().

type ExpectedGetIndexes Uses

type ExpectedGetIndexes struct {
    // contains filtered or unexported fields
}

ExpectedGetIndexes represents an expectation for a call to DB.GetIndexes().

func (*ExpectedGetIndexes) String Uses

func (e *ExpectedGetIndexes) String() string

func (*ExpectedGetIndexes) WillDelay Uses

func (e *ExpectedGetIndexes) WillDelay(delay time.Duration) *ExpectedGetIndexes

WillDelay causes the call to DB.GetIndexes() to delay.

func (*ExpectedGetIndexes) WillExecute Uses

func (e *ExpectedGetIndexes) WillExecute(cb func(ctx context.Context) ([]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 Uses

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 Uses

func (e *ExpectedGetIndexes) WillReturnError(err error) *ExpectedGetIndexes

WillReturnError sets the error value that will be returned by the call to DB.GetIndexes().

type ExpectedGetMeta Uses

type ExpectedGetMeta struct {
    // contains filtered or unexported fields
}

ExpectedGetMeta represents an expectation for a call to DB.GetMeta().

func (*ExpectedGetMeta) String Uses

func (e *ExpectedGetMeta) String() string

func (*ExpectedGetMeta) WillDelay Uses

func (e *ExpectedGetMeta) WillDelay(delay time.Duration) *ExpectedGetMeta

WillDelay causes the call to DB.GetMeta() to delay.

func (*ExpectedGetMeta) WillExecute Uses

func (e *ExpectedGetMeta) WillExecute(cb func(ctx context.Context, arg0 string, options map[string]interface{}) (int64, string, error)) *ExpectedGetMeta

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 (*ExpectedGetMeta) WillReturn Uses

func (e *ExpectedGetMeta) WillReturn(ret0 int64, ret1 string) *ExpectedGetMeta

WillReturn sets the values that will be returned by the call to DB.GetMeta().

func (*ExpectedGetMeta) WillReturnError Uses

func (e *ExpectedGetMeta) WillReturnError(err error) *ExpectedGetMeta

WillReturnError sets the error value that will be returned by the call to DB.GetMeta().

func (*ExpectedGetMeta) WithDocID Uses

func (e *ExpectedGetMeta) WithDocID(docID string) *ExpectedGetMeta

WithDocID sets the expectation for the docID passed to the DB.GetMeta() call.

func (*ExpectedGetMeta) WithOptions Uses

func (e *ExpectedGetMeta) WithOptions(options map[string]interface{}) *ExpectedGetMeta

WithOptions sets the expected options for the call to DB.GetMeta().

type ExpectedGetReplications Uses

type ExpectedGetReplications struct {
    // contains filtered or unexported fields
}

ExpectedGetReplications represents an expectation for a call to GetReplications().

func (*ExpectedGetReplications) String Uses

func (e *ExpectedGetReplications) String() string

func (*ExpectedGetReplications) WillDelay Uses

func (e *ExpectedGetReplications) WillDelay(delay time.Duration) *ExpectedGetReplications

WillDelay causes the call to GetReplications() to delay.

func (*ExpectedGetReplications) WillExecute Uses

func (e *ExpectedGetReplications) WillExecute(cb func(ctx context.Context, options map[string]interface{}) ([]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 Uses

func (e *ExpectedGetReplications) WillReturn(ret0 []*Replication) *ExpectedGetReplications

WillReturn sets the values that will be returned by the call to GetReplications().

func (*ExpectedGetReplications) WillReturnError Uses

func (e *ExpectedGetReplications) WillReturnError(err error) *ExpectedGetReplications

WillReturnError sets the error value that will be returned by the call to GetReplications().

func (*ExpectedGetReplications) WithOptions Uses

func (e *ExpectedGetReplications) WithOptions(options map[string]interface{}) *ExpectedGetReplications

WithOptions sets the expected options for the call to GetReplications().

type ExpectedLocalDocs Uses

type ExpectedLocalDocs struct {
    // contains filtered or unexported fields
}

ExpectedLocalDocs represents an expectation for a call to DB.LocalDocs().

func (*ExpectedLocalDocs) String Uses

func (e *ExpectedLocalDocs) String() string

func (*ExpectedLocalDocs) WillDelay Uses

func (e *ExpectedLocalDocs) WillDelay(delay time.Duration) *ExpectedLocalDocs

WillDelay causes the call to DB.LocalDocs() to delay.

func (*ExpectedLocalDocs) WillExecute Uses

func (e *ExpectedLocalDocs) WillExecute(cb func(ctx context.Context, options map[string]interface{}) (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 Uses

func (e *ExpectedLocalDocs) WillReturn(ret0 *Rows) *ExpectedLocalDocs

WillReturn sets the values that will be returned by the call to DB.LocalDocs().

func (*ExpectedLocalDocs) WillReturnError Uses

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 Uses

func (e *ExpectedLocalDocs) WithOptions(options map[string]interface{}) *ExpectedLocalDocs

WithOptions sets the expected options for the call to DB.LocalDocs().

type ExpectedPing Uses

type ExpectedPing struct {
    // contains filtered or unexported fields
}

ExpectedPing represents an expectation for a call to Ping().

func (*ExpectedPing) String Uses

func (e *ExpectedPing) String() string

func (*ExpectedPing) WillDelay Uses

func (e *ExpectedPing) WillDelay(delay time.Duration) *ExpectedPing

WillDelay causes the call to Ping() to delay.

func (*ExpectedPing) WillExecute Uses

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 Uses

func (e *ExpectedPing) WillReturn(ret0 bool) *ExpectedPing

WillReturn sets the values that will be returned by the call to Ping().

func (*ExpectedPing) WillReturnError Uses

func (e *ExpectedPing) WillReturnError(err error) *ExpectedPing

WillReturnError sets the error value that will be returned by the call to Ping().

type ExpectedPurge Uses

type ExpectedPurge struct {
    // contains filtered or unexported fields
}

ExpectedPurge represents an expectation for a call to DB.Purge().

func (*ExpectedPurge) String Uses

func (e *ExpectedPurge) String() string

func (*ExpectedPurge) WillDelay Uses

func (e *ExpectedPurge) WillDelay(delay time.Duration) *ExpectedPurge

WillDelay causes the call to DB.Purge() to delay.

func (*ExpectedPurge) WillExecute Uses

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 Uses

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 Uses

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 Uses

func (e *ExpectedPurge) WithDocRevMap(docRevMap map[string][]string) *ExpectedPurge

WithDocRevMap sets the expected docRevMap for the call to DB.Purge().

type ExpectedPut Uses

type ExpectedPut struct {
    // contains filtered or unexported fields
}

ExpectedPut represents an expectation for a call to DB.Put().

func (*ExpectedPut) String Uses

func (e *ExpectedPut) String() string

func (*ExpectedPut) WillDelay Uses

func (e *ExpectedPut) WillDelay(delay time.Duration) *ExpectedPut

WillDelay causes the call to DB.Put() to delay.

func (*ExpectedPut) WillExecute Uses

func (e *ExpectedPut) WillExecute(cb func(ctx context.Context, arg0 string, arg1 interface{}, options map[string]interface{}) (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 Uses

func (e *ExpectedPut) WillReturn(ret0 string) *ExpectedPut

WillReturn sets the values that will be returned by the call to DB.Put().

func (*ExpectedPut) WillReturnError Uses

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 Uses

func (e *ExpectedPut) WithDoc(doc interface{}) *ExpectedPut

WithDoc sets the expectation for the doc passed to the DB.Put() call.

func (*ExpectedPut) WithDocID Uses

func (e *ExpectedPut) WithDocID(docID string) *ExpectedPut

WithDocID sets the expectation for the docID passed to the DB.Put() call.

func (*ExpectedPut) WithOptions Uses

func (e *ExpectedPut) WithOptions(options map[string]interface{}) *ExpectedPut

WithOptions sets the expected options for the call to DB.Put().

type ExpectedPutAttachment Uses

type ExpectedPutAttachment struct {
    // contains filtered or unexported fields
}

ExpectedPutAttachment represents an expectation for a call to DB.PutAttachment().

func (*ExpectedPutAttachment) String Uses

func (e *ExpectedPutAttachment) String() string

func (*ExpectedPutAttachment) WillDelay Uses

func (e *ExpectedPutAttachment) WillDelay(delay time.Duration) *ExpectedPutAttachment

WillDelay causes the call to DB.PutAttachment() to delay.

func (*ExpectedPutAttachment) WillExecute Uses

func (e *ExpectedPutAttachment) WillExecute(cb func(ctx context.Context, arg0 string, arg1 string, arg2 *driver.Attachment, options map[string]interface{}) (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 Uses

func (e *ExpectedPutAttachment) WillReturn(ret0 string) *ExpectedPutAttachment

WillReturn sets the values that will be returned by the call to DB.PutAttachment().

func (*ExpectedPutAttachment) WillReturnError Uses

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 Uses

func (e *ExpectedPutAttachment) WithAttachment(att *driver.Attachment) *ExpectedPutAttachment

WithAttachment sets the expectation for the rev passed to the DB.PutAttachment() call.

func (*ExpectedPutAttachment) WithDocID Uses

func (e *ExpectedPutAttachment) WithDocID(docID string) *ExpectedPutAttachment

WithDocID sets the expectation for the docID passed to the DB.PutAttachment() call.

func (*ExpectedPutAttachment) WithOptions Uses

func (e *ExpectedPutAttachment) WithOptions(options map[string]interface{}) *ExpectedPutAttachment

WithOptions sets the expected options for the call to DB.PutAttachment().

func (*ExpectedPutAttachment) WithRev Uses

func (e *ExpectedPutAttachment) WithRev(rev string) *ExpectedPutAttachment

WithRev sets the expectation for the rev passed to the DB.PutAttachment() call.

type ExpectedQuery Uses

type ExpectedQuery struct {
    // contains filtered or unexported fields
}

ExpectedQuery represents an expectation for a call to DB.Query().

func (*ExpectedQuery) String Uses

func (e *ExpectedQuery) String() string

func (*ExpectedQuery) WillDelay Uses

func (e *ExpectedQuery) WillDelay(delay time.Duration) *ExpectedQuery

WillDelay causes the call to DB.Query() to delay.

func (*ExpectedQuery) WillExecute Uses

func (e *ExpectedQuery) WillExecute(cb func(ctx context.Context, arg0 string, arg1 string, options map[string]interface{}) (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 Uses

func (e *ExpectedQuery) WillReturn(ret0 *Rows) *ExpectedQuery

WillReturn sets the values that will be returned by the call to DB.Query().

func (*ExpectedQuery) WillReturnError Uses

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 Uses

func (e *ExpectedQuery) WithDDocID(ddocID string) *ExpectedQuery

WithDDocID sets the expected ddocID value for the DB.Query() call.

func (*ExpectedQuery) WithOptions Uses

func (e *ExpectedQuery) WithOptions(options map[string]interface{}) *ExpectedQuery

WithOptions sets the expected options for the call to DB.Query().

func (*ExpectedQuery) WithView Uses

func (e *ExpectedQuery) WithView(view string) *ExpectedQuery

WithView sets the expected view value for the DB.Query() call.

type ExpectedReplicate Uses

type ExpectedReplicate struct {
    // contains filtered or unexported fields
}

ExpectedReplicate represents an expectation for a call to Replicate().

func (*ExpectedReplicate) String Uses

func (e *ExpectedReplicate) String() string

func (*ExpectedReplicate) WillDelay Uses

func (e *ExpectedReplicate) WillDelay(delay time.Duration) *ExpectedReplicate

WillDelay causes the call to Replicate() to delay.

func (*ExpectedReplicate) WillExecute Uses

func (e *ExpectedReplicate) WillExecute(cb func(ctx context.Context, arg0 string, arg1 string, options map[string]interface{}) (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 Uses

func (e *ExpectedReplicate) WillReturn(ret0 *Replication) *ExpectedReplicate

WillReturn sets the values that will be returned by the call to Replicate().

func (*ExpectedReplicate) WillReturnError Uses

func (e *ExpectedReplicate) WillReturnError(err error) *ExpectedReplicate

WillReturnError sets the error value that will be returned by the call to Replicate().

func (*ExpectedReplicate) WithOptions Uses

func (e *ExpectedReplicate) WithOptions(options map[string]interface{}) *ExpectedReplicate

WithOptions sets the expected options for the call to Replicate().

func (*ExpectedReplicate) WithSource Uses

func (e *ExpectedReplicate) WithSource(source string) *ExpectedReplicate

func (*ExpectedReplicate) WithTarget Uses

func (e *ExpectedReplicate) WithTarget(target string) *ExpectedReplicate

type ExpectedRevsDiff Uses

type ExpectedRevsDiff struct {
    // contains filtered or unexported fields
}

ExpectedRevsDiff represents an expectation for a call to DB.RevsDiff().

func (*ExpectedRevsDiff) String Uses

func (e *ExpectedRevsDiff) String() string

func (*ExpectedRevsDiff) WillDelay Uses

func (e *ExpectedRevsDiff) WillDelay(delay time.Duration) *ExpectedRevsDiff

WillDelay causes the call to DB.RevsDiff() to delay.

func (*ExpectedRevsDiff) WillExecute Uses

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 Uses

func (e *ExpectedRevsDiff) WillReturn(ret0 *Rows) *ExpectedRevsDiff

WillReturn sets the values that will be returned by the call to DB.RevsDiff().

func (*ExpectedRevsDiff) WillReturnError Uses

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 Uses

func (e *ExpectedRevsDiff) WithRevLookup(revLookup interface{}) *ExpectedRevsDiff

WithRevLookup sets the expectation for the rev lookup passed to the DB.RevsDiff() call.

type ExpectedSecurity Uses

type ExpectedSecurity struct {
    // contains filtered or unexported fields
}

ExpectedSecurity represents an expectation for a call to DB.Security().

func (*ExpectedSecurity) String Uses

func (e *ExpectedSecurity) String() string

func (*ExpectedSecurity) WillDelay Uses

func (e *ExpectedSecurity) WillDelay(delay time.Duration) *ExpectedSecurity

WillDelay causes the call to DB.Security() to delay.

func (*ExpectedSecurity) WillExecute Uses

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 Uses

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 Uses

func (e *ExpectedSecurity) WillReturnError(err error) *ExpectedSecurity

WillReturnError sets the error value that will be returned by the call to DB.Security().

type ExpectedSession Uses

type ExpectedSession struct {
    // contains filtered or unexported fields
}

ExpectedSession represents an expectation for a call to Session().

func (*ExpectedSession) String Uses

func (e *ExpectedSession) String() string

func (*ExpectedSession) WillDelay Uses

func (e *ExpectedSession) WillDelay(delay time.Duration) *ExpectedSession

WillDelay causes the call to Session() to delay.

func (*ExpectedSession) WillExecute Uses

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 Uses

func (e *ExpectedSession) WillReturn(ret0 *driver.Session) *ExpectedSession

WillReturn sets the values that will be returned by the call to Session().

func (*ExpectedSession) WillReturnError Uses

func (e *ExpectedSession) WillReturnError(err error) *ExpectedSession

WillReturnError sets the error value that will be returned by the call to Session().

type ExpectedSetConfigValue Uses

type ExpectedSetConfigValue struct {
    // contains filtered or unexported fields
}

ExpectedSetConfigValue represents an expectation for a call to SetConfigValue().

func (*ExpectedSetConfigValue) String Uses

func (e *ExpectedSetConfigValue) String() string

func (*ExpectedSetConfigValue) WillDelay Uses

func (e *ExpectedSetConfigValue) WillDelay(delay time.Duration) *ExpectedSetConfigValue

WillDelay causes the call to SetConfigValue() to delay.

func (*ExpectedSetConfigValue) WillExecute Uses

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 Uses

func (e *ExpectedSetConfigValue) WillReturn(ret0 string) *ExpectedSetConfigValue

WillReturn sets the values that will be returned by the call to SetConfigValue().

func (*ExpectedSetConfigValue) WillReturnError Uses

func (e *ExpectedSetConfigValue) WillReturnError(err error) *ExpectedSetConfigValue

WillReturnError sets the error value that will be returned by the call to SetConfigValue().

func (*ExpectedSetConfigValue) WithKey Uses

func (e *ExpectedSetConfigValue) WithKey(key string) *ExpectedSetConfigValue

func (*ExpectedSetConfigValue) WithNode Uses

func (e *ExpectedSetConfigValue) WithNode(node string) *ExpectedSetConfigValue

func (*ExpectedSetConfigValue) WithSection Uses

func (e *ExpectedSetConfigValue) WithSection(section string) *ExpectedSetConfigValue

func (*ExpectedSetConfigValue) WithValue Uses

func (e *ExpectedSetConfigValue) WithValue(value string) *ExpectedSetConfigValue

type ExpectedSetSecurity Uses

type ExpectedSetSecurity struct {
    // contains filtered or unexported fields
}

ExpectedSetSecurity represents an expectation for a call to DB.SetSecurity().

func (*ExpectedSetSecurity) String Uses

func (e *ExpectedSetSecurity) String() string

func (*ExpectedSetSecurity) WillDelay Uses

func (e *ExpectedSetSecurity) WillDelay(delay time.Duration) *ExpectedSetSecurity

WillDelay causes the call to DB.SetSecurity() to delay.

func (*ExpectedSetSecurity) WillExecute Uses

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 Uses

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 Uses

func (e *ExpectedSetSecurity) WithSecurity(sec *driver.Security) *ExpectedSetSecurity

WithSecurity sets the expected security object for the DB.SetSecurity() call.

type ExpectedStats Uses

type ExpectedStats struct {
    // contains filtered or unexported fields
}

ExpectedStats represents an expectation for a call to DB.Stats().

func (*ExpectedStats) String Uses

func (e *ExpectedStats) String() string

func (*ExpectedStats) WillDelay Uses

func (e *ExpectedStats) WillDelay(delay time.Duration) *ExpectedStats

WillDelay causes the call to DB.Stats() to delay.

func (*ExpectedStats) WillExecute Uses

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 Uses

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 Uses

func (e *ExpectedStats) WillReturnError(err error) *ExpectedStats

WillReturnError sets the error value that will be returned by the call to DB.Stats().

type ExpectedVersion Uses

type ExpectedVersion struct {
    // contains filtered or unexported fields
}

ExpectedVersion represents an expectation for a call to Version().

func (*ExpectedVersion) String Uses

func (e *ExpectedVersion) String() string

func (*ExpectedVersion) WillDelay Uses

func (e *ExpectedVersion) WillDelay(delay time.Duration) *ExpectedVersion

WillDelay causes the call to Version() to delay.

func (*ExpectedVersion) WillExecute Uses

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 Uses

func (e *ExpectedVersion) WillReturn(ret0 *driver.Version) *ExpectedVersion

WillReturn sets the values that will be returned by the call to Version().

func (*ExpectedVersion) WillReturnError Uses

func (e *ExpectedVersion) WillReturnError(err error) *ExpectedVersion

WillReturnError sets the error value that will be returned by the call to Version().

type ExpectedViewCleanup Uses

type ExpectedViewCleanup struct {
    // contains filtered or unexported fields
}

ExpectedViewCleanup represents an expectation for a call to DB.ViewCleanup().

func (*ExpectedViewCleanup) String Uses

func (e *ExpectedViewCleanup) String() string

func (*ExpectedViewCleanup) WillDelay Uses

func (e *ExpectedViewCleanup) WillDelay(delay time.Duration) *ExpectedViewCleanup

WillDelay causes the call to DB.ViewCleanup() to delay.

func (*ExpectedViewCleanup) WillExecute Uses

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 Uses

func (e *ExpectedViewCleanup) WillReturnError(err error) *ExpectedViewCleanup

WillReturnError sets the error value that will be returned by the call to DB.ViewCleanup().

type MockClient Uses

type MockClient = Client

MockClient is deprecated

type MockDB Uses

type MockDB = DB

MockDB is deprecated

type Replication Uses

type Replication struct {
    // contains filtered or unexported fields
}

Replication is a replication instance.

func (*Replication) EndTime Uses

func (r *Replication) EndTime(t time.Time) *Replication

func (*Replication) Err Uses

func (r *Replication) Err(e error) *Replication

func (*Replication) ID Uses

func (r *Replication) ID(id string) *Replication

func (*Replication) MarshalJSON Uses

func (r *Replication) MarshalJSON() ([]byte, error)

func (*Replication) Source Uses

func (r *Replication) Source(s string) *Replication

func (*Replication) StartTime Uses

func (r *Replication) StartTime(t time.Time) *Replication

func (*Replication) State Uses

func (r *Replication) State(s kivik.ReplicationState) *Replication

func (*Replication) Target Uses

func (r *Replication) Target(t string) *Replication

type Rows Uses

type Rows struct {
    // contains filtered or unexported fields
}

Rows is a mocked collection of rows.

func NewRows Uses

func NewRows() *Rows

NewRows returns a new, empty set of rows, which can be returned by any of the row-returning expectations.

func (*Rows) AddDelay Uses

func (r *Rows) AddDelay(delay time.Duration) *Rows

AddDelay adds a delay before the next iteration will complete.

func (*Rows) AddRow Uses

func (r *Rows) AddRow(row *driver.Row) *Rows

AddRow adds a row to be returned by the rows iterator. If AddrowError has been set, this method will panic.

func (*Rows) AddRowError Uses

func (r *Rows) AddRowError(err error) *Rows

AddRowError adds an error to be returned during row iteration.

func (*Rows) Close Uses

func (i *Rows) Close() error

func (*Rows) CloseError Uses

func (r *Rows) CloseError(err error) *Rows

CloseError sets an error to be returned when the rows iterator is closed.

func (*Rows) Final Uses

func (r *Rows) Final() driver.Rows

Final converts the Rows object to a driver.Rows. This method is intended for use within WillExecute() to return results.

func (*Rows) Offset Uses

func (r *Rows) Offset(offset int64) *Rows

Offset sets the offset value to be returned by the rows iterator.

func (*Rows) TotalRows Uses

func (r *Rows) TotalRows(totalRows int64) *Rows

TotalRows sets the total rows value to be returned by the rows iterator.

func (*Rows) UpdateSeq Uses

func (r *Rows) UpdateSeq(seq string) *Rows

UpdateSeq sets the update sequence value to be returned by the rows iterator.

func (*Rows) Warning Uses

func (r *Rows) Warning(warning string) *Rows

Warning sets the warning value to be returned by the rows iterator.

type Updates Uses

type Updates struct {
    // contains filtered or unexported fields
}

Updates is a mocked collection of database updates.

func NewDBUpdates Uses

func NewDBUpdates() *Updates

NewDBUpdates returns a new, empty update set, which can be returned by the DBUpdates() expectation.

func (*Updates) AddDelay Uses

func (u *Updates) AddDelay(delay time.Duration) *Updates

AddDelay adds a delay before the next iteration will complete.

func (*Updates) AddUpdate Uses

func (u *Updates) AddUpdate(update *driver.DBUpdate) *Updates

AddUpdate adds a database update to be returned by the DBUpdates iterator. If AddUpdateError has been set, this method will panic.

func (*Updates) AddUpdateError Uses

func (u *Updates) AddUpdateError(err error) *Updates

AddUpdateError adds an error to be returned during update iteration.

func (*Updates) Close Uses

func (i *Updates) Close() error

func (*Updates) CloseError Uses

func (u *Updates) CloseError(err error) *Updates

CloseError sets an error to be returned when the updates iterator is closed.

func (*Updates) Final Uses

func (u *Updates) Final() driver.DBUpdates

Final converts the Updates object to a driver.DBUpdates. This method is intended for use within WillExecute() to return results.

Directories

PathSynopsis
gen

Package kivikmock imports 13 packages (graph). Updated 2020-02-16. Refresh now. Tools for package owners.