kivikmock

package module
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

README

Build Status Codecov Go Report Card GoDoc Website

Kivikmock

Package kivikmock is a mock library implementing a Kivik driver.

This package is heavily influenced by github.com/DATA-DOG/go-sqlmock, the SQL mock driver from Datadog.

Usage

To use this package, in your *_test.go file, create a mock Kivik connection:

client, mock, err := kivikmock.New()
if err != nil {
    panic(err)
}

The returned client object is a *kivik.Client, and can be passed to your methods to be tested. mock is used to control the execution of the mock driver, by setting expectations. To test a function which fetches a user, for example, you might do something like this:

func TestGetUser(t *testing.T) {
    client, mock, err := kivikmock.New()
    if err != nil {
        t.Fatal(err)
    }

    mock.ExpectDB().WithName("_users").WillReturn(mock.NewDB().
        ExpectGet().WithDocID("bob").
            WillReturn(kivikmock.DocumentT(t, `{"_id":"org.couchdb.user:bob"}`)),
    )
    user, err := GetUser(client, "bob")
    if err != nil {
        t.Error(err)
    }
    // other validation
}

Versions

This package targets the unstable release of Kivik.

License

This software is released under the terms of the Apache 2.0 license. See LICENCE.md, or read the full license.

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Document

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

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

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

func ToDocument

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

ToDocument is deprecated.

func ToDocumentT

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

ToDocumentT is deprecated.

Types

type BulkResults

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

BulkResults is a mocked collection of BulkDoc results.

func NewBulkResults

func NewBulkResults() *BulkResults

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

func (*BulkResults) AddDelay

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

AddDelay adds a delay before the next iteration will complete.

func (*BulkResults) AddResult

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

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

AddResultError adds an error to be returned during iteration.

func (*BulkResults) Close

func (i *BulkResults) Close() error

func (*BulkResults) CloseError

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

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

func (*BulkResults) Final

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

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

Changes is a mocked collection of Changes results.

func NewChanges

func NewChanges() *Changes

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

func (*Changes) AddChange

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

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

AddChangeError adds an error to be returned during iteration.

func (*Changes) AddDelay

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

AddDelay adds a delay before the next iteration will complete.

func (*Changes) Close

func (i *Changes) Close() error

func (*Changes) CloseError

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

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

func (*Changes) ETag

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

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

func (*Changes) Final

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

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

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

func (*Changes) Pending

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

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

type Client

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

Client allows configuring the mock kivik client.

func New

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

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

func NewT

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

func (c *Client) ExpectAllDBs() *ExpectedAllDBs

ExpectAllDBs queues an expectation that AllDBs will be called.

func (*Client) ExpectAuthenticate

func (c *Client) ExpectAuthenticate() *ExpectedAuthenticate

ExpectAuthenticate queues an expectation for an Authenticate() call.

func (*Client) ExpectClose

func (c *Client) ExpectClose() *ExpectedClose

ExpectClose queues an expectation that Close will be called.

func (*Client) ExpectClusterSetup

func (c *Client) ExpectClusterSetup() *ExpectedClusterSetup

ExpectClusterSetup queues an expectation that ClusterSetup will be called.

func (*Client) ExpectClusterStatus

func (c *Client) ExpectClusterStatus() *ExpectedClusterStatus

ExpectClusterStatus queues an expectation that ClusterStatus will be called.

func (*Client) ExpectConfig

func (c *Client) ExpectConfig() *ExpectedConfig

ExpectConfig queues an expectation that Config will be called.

func (*Client) ExpectConfigSection

func (c *Client) ExpectConfigSection() *ExpectedConfigSection

ExpectConfigSection queues an expectation that ConfigSection will be called.

func (*Client) ExpectConfigValue

func (c *Client) ExpectConfigValue() *ExpectedConfigValue

ExpectConfigValue queues an expectation that ConfigValue will be called.

func (*Client) ExpectCreateDB

func (c *Client) ExpectCreateDB() *ExpectedCreateDB

ExpectCreateDB queues an expectation for a CreateDB() call.

func (*Client) ExpectDB

func (c *Client) ExpectDB() *ExpectedDB

ExpectDB queues an expectation that DB will be called.

func (*Client) ExpectDBExists

func (c *Client) ExpectDBExists() *ExpectedDBExists

ExpectDBExists queues an expectation that DBExists will be called.

func (*Client) ExpectDBUpdates

func (c *Client) ExpectDBUpdates() *ExpectedDBUpdates

ExpectDBUpdates queues an expectation that DBUpdates will be called.

func (*Client) ExpectDBsStats

func (c *Client) ExpectDBsStats() *ExpectedDBsStats

ExpectDBsStats queues an expectation that DBsStats will be called.

func (*Client) ExpectDeleteConfigKey

func (c *Client) ExpectDeleteConfigKey() *ExpectedDeleteConfigKey

ExpectDeleteConfigKey queues an expectation that DeleteConfigKey will be called.

func (*Client) ExpectDestroyDB

func (c *Client) ExpectDestroyDB() *ExpectedDestroyDB

ExpectDestroyDB queues an expectation that DestroyDB will be called.

func (*Client) ExpectGetReplications

func (c *Client) ExpectGetReplications() *ExpectedGetReplications

ExpectGetReplications queues an expectation that GetReplications will be called.

func (*Client) ExpectPing

func (c *Client) ExpectPing() *ExpectedPing

ExpectPing queues an expectation that Ping will be called.

func (*Client) ExpectReplicate

func (c *Client) ExpectReplicate() *ExpectedReplicate

ExpectReplicate queues an expectation that Replicate will be called.

func (*Client) ExpectSession

func (c *Client) ExpectSession() *ExpectedSession

ExpectSession queues an expectation that Session will be called.

func (*Client) ExpectSetConfigValue

func (c *Client) ExpectSetConfigValue() *ExpectedSetConfigValue

ExpectSetConfigValue queues an expectation that SetConfigValue will be called.

func (*Client) ExpectVersion

func (c *Client) ExpectVersion() *ExpectedVersion

ExpectVersion queues an expectation that Version will be called.

func (*Client) ExpectationsWereMet

func (c *Client) ExpectationsWereMet() error

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

func (*Client) MatchExpectationsInOrder

func (c *Client) MatchExpectationsInOrder(b bool)

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

func (*Client) NewDB

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

func (c *Client) NewReplication() *Replication

NewReplication returns a new, empty Replication.

type DB

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

DB serves to create expectations for database actions to mock and test real database behavior.

func (*DB) ExpectAllDocs

func (db *DB) ExpectAllDocs() *ExpectedAllDocs

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

func (*DB) ExpectBulkDocs

func (db *DB) ExpectBulkDocs() *ExpectedBulkDocs

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

func (*DB) ExpectBulkGet

func (db *DB) ExpectBulkGet() *ExpectedBulkGet

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

func (*DB) ExpectChanges

func (db *DB) ExpectChanges() *ExpectedChanges

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

func (*DB) ExpectClose

func (db *DB) ExpectClose() *ExpectedDBClose

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

func (*DB) ExpectCompact

func (db *DB) ExpectCompact() *ExpectedCompact

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

func (*DB) ExpectCompactView

func (db *DB) ExpectCompactView() *ExpectedCompactView

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

func (*DB) ExpectCopy

func (db *DB) ExpectCopy() *ExpectedCopy

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

func (*DB) ExpectCreateDoc

func (db *DB) ExpectCreateDoc() *ExpectedCreateDoc

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

func (*DB) ExpectCreateIndex

func (db *DB) ExpectCreateIndex() *ExpectedCreateIndex

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

func (*DB) ExpectDelete

func (db *DB) ExpectDelete() *ExpectedDelete

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

func (*DB) ExpectDeleteAttachment

func (db *DB) ExpectDeleteAttachment() *ExpectedDeleteAttachment

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

func (*DB) ExpectDeleteIndex

func (db *DB) ExpectDeleteIndex() *ExpectedDeleteIndex

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

func (*DB) ExpectDesignDocs

func (db *DB) ExpectDesignDocs() *ExpectedDesignDocs

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

func (*DB) ExpectExplain

func (db *DB) ExpectExplain() *ExpectedExplain

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

func (*DB) ExpectFind

func (db *DB) ExpectFind() *ExpectedFind

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

func (*DB) ExpectFlush

func (db *DB) ExpectFlush() *ExpectedFlush

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

func (*DB) ExpectGet

func (db *DB) ExpectGet() *ExpectedGet

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

func (*DB) ExpectGetAttachment

func (db *DB) ExpectGetAttachment() *ExpectedGetAttachment

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

func (*DB) ExpectGetAttachmentMeta

func (db *DB) ExpectGetAttachmentMeta() *ExpectedGetAttachmentMeta

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

func (*DB) ExpectGetIndexes

func (db *DB) ExpectGetIndexes() *ExpectedGetIndexes

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

func (*DB) ExpectGetMeta

func (db *DB) ExpectGetMeta() *ExpectedGetMeta

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

func (*DB) ExpectLocalDocs

func (db *DB) ExpectLocalDocs() *ExpectedLocalDocs

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

func (*DB) ExpectPurge

func (db *DB) ExpectPurge() *ExpectedPurge

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

func (*DB) ExpectPut

func (db *DB) ExpectPut() *ExpectedPut

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

func (*DB) ExpectPutAttachment

func (db *DB) ExpectPutAttachment() *ExpectedPutAttachment

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

func (*DB) ExpectQuery

func (db *DB) ExpectQuery() *ExpectedQuery

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

func (*DB) ExpectRevsDiff

func (db *DB) ExpectRevsDiff() *ExpectedRevsDiff

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

func (*DB) ExpectSecurity

func (db *DB) ExpectSecurity() *ExpectedSecurity

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

func (*DB) ExpectSetSecurity

func (db *DB) ExpectSetSecurity() *ExpectedSetSecurity

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

func (*DB) ExpectStats

func (db *DB) ExpectStats() *ExpectedStats

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

func (*DB) ExpectViewCleanup

func (db *DB) ExpectViewCleanup() *ExpectedViewCleanup

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

type ExpectedAllDBs

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

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

func (*ExpectedAllDBs) String

func (e *ExpectedAllDBs) String() string

String satisfies the fmt.Stringer interface.

func (*ExpectedAllDBs) WillDelay

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

WillDelay causes the call to AllDBs() to delay.

func (*ExpectedAllDBs) WillExecute

func (e *ExpectedAllDBs) WillExecute(cb func(ctx context.Context, options 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

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

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

func (*ExpectedAllDBs) WillReturnError

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

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

func (*ExpectedAllDBs) WithOptions

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

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

type ExpectedAllDocs

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

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

func (*ExpectedAllDocs) String

func (e *ExpectedAllDocs) String() string

func (*ExpectedAllDocs) WillDelay

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

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

func (*ExpectedAllDocs) WillExecute

func (e *ExpectedAllDocs) WillExecute(cb func(ctx context.Context, options 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

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

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

func (*ExpectedAllDocs) WillReturnError

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

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

func (*ExpectedAllDocs) WithOptions

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

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

type ExpectedAuthenticate

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

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

func (*ExpectedAuthenticate) String

func (e *ExpectedAuthenticate) String() string

String satisfies the fmt.Stringer interface.

func (*ExpectedAuthenticate) WillDelay

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

func (*ExpectedAuthenticate) WillExecute

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

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

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

func (*ExpectedAuthenticate) WithAuthenticator

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

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

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

func (*ExpectedBulkDocs) String

func (e *ExpectedBulkDocs) String() string

func (*ExpectedBulkDocs) WillDelay

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

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

func (*ExpectedBulkDocs) WillExecute

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

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

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

func (*ExpectedBulkDocs) WillReturnError

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

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

func (*ExpectedBulkDocs) WithOptions

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

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

type ExpectedBulkGet

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

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

func (*ExpectedBulkGet) String

func (e *ExpectedBulkGet) String() string

func (*ExpectedBulkGet) WillDelay

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

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

func (*ExpectedBulkGet) WillExecute

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

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

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

func (*ExpectedBulkGet) WillReturnError

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

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

func (*ExpectedBulkGet) WithOptions

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

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

type ExpectedChanges

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

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

func (*ExpectedChanges) String

func (e *ExpectedChanges) String() string

func (*ExpectedChanges) WillDelay

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

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

func (*ExpectedChanges) WillExecute

func (e *ExpectedChanges) WillExecute(cb func(ctx context.Context, options 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

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

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

func (*ExpectedChanges) WillReturnError

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

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

func (*ExpectedChanges) WithOptions

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

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

type ExpectedClose

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

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

func (*ExpectedClose) String

func (e *ExpectedClose) String() string

func (*ExpectedClose) WillDelay

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

WillDelay causes the call to Close() to delay.

func (*ExpectedClose) WillExecute

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

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

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

type ExpectedClusterSetup

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

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

func (*ExpectedClusterSetup) String

func (e *ExpectedClusterSetup) String() string

func (*ExpectedClusterSetup) WillDelay

WillDelay causes the call to ClusterSetup() to delay.

func (*ExpectedClusterSetup) WillExecute

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

WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.

func (*ExpectedClusterSetup) WillReturnError

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

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

func (*ExpectedClusterSetup) WithAction

func (e *ExpectedClusterSetup) WithAction(action interface{}) *ExpectedClusterSetup

WithAction specifies the action to be matched. Note that this expectation is compared with the actual action's marshaled JSON output, so it is not essential that the data types match exactly, in a Go sense.

type ExpectedClusterStatus

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

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

func (*ExpectedClusterStatus) String

func (e *ExpectedClusterStatus) String() string

String satisfies the fmt.Stringer interface

func (*ExpectedClusterStatus) WillDelay

WillDelay causes the call to ClusterStatus() to delay.

func (*ExpectedClusterStatus) WillExecute

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

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

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

func (*ExpectedClusterStatus) WillReturnError

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

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

func (*ExpectedClusterStatus) WithOptions

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

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

type ExpectedCompact

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

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

func (*ExpectedCompact) String

func (e *ExpectedCompact) String() string

func (*ExpectedCompact) WillDelay

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

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

func (*ExpectedCompact) WillExecute

func (e *ExpectedCompact) WillExecute(cb func(ctx context.Context) error) *ExpectedCompact

WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.

func (*ExpectedCompact) WillReturnError

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

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

type ExpectedCompactView

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

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

func (*ExpectedCompactView) String

func (e *ExpectedCompactView) String() string

func (*ExpectedCompactView) WillDelay

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

func (*ExpectedCompactView) WillExecute

func (e *ExpectedCompactView) WillExecute(cb func(ctx context.Context, arg0 string) error) *ExpectedCompactView

WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.

func (*ExpectedCompactView) WillReturnError

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

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

func (*ExpectedCompactView) WithDDoc

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

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

type ExpectedConfig

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

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

func (*ExpectedConfig) String

func (e *ExpectedConfig) String() string

func (*ExpectedConfig) WillDelay

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

WillDelay causes the call to Config() to delay.

func (*ExpectedConfig) WillExecute

func (e *ExpectedConfig) WillExecute(cb func(ctx context.Context, arg0 string) (driver.Config, error)) *ExpectedConfig

WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.

func (*ExpectedConfig) WillReturn

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

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

func (*ExpectedConfig) WillReturnError

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

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

func (*ExpectedConfig) WithNode

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

type ExpectedConfigSection

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

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

func (*ExpectedConfigSection) String

func (e *ExpectedConfigSection) String() string

func (*ExpectedConfigSection) WillDelay

WillDelay causes the call to ConfigSection() to delay.

func (*ExpectedConfigSection) WillExecute

func (e *ExpectedConfigSection) WillExecute(cb func(ctx context.Context, arg0 string, arg1 string) (driver.ConfigSection, error)) *ExpectedConfigSection

WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.

func (*ExpectedConfigSection) WillReturn

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

func (*ExpectedConfigSection) WillReturnError

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

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

func (*ExpectedConfigSection) WithNode

func (*ExpectedConfigSection) WithSection

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

type ExpectedConfigValue

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

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

func (*ExpectedConfigValue) String

func (e *ExpectedConfigValue) String() string

func (*ExpectedConfigValue) WillDelay

WillDelay causes the call to ConfigValue() to delay.

func (*ExpectedConfigValue) WillExecute

func (e *ExpectedConfigValue) WillExecute(cb func(ctx context.Context, arg0 string, arg1 string, arg2 string) (string, error)) *ExpectedConfigValue

WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.

func (*ExpectedConfigValue) WillReturn

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

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

func (*ExpectedConfigValue) WillReturnError

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

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

func (*ExpectedConfigValue) WithKey

func (*ExpectedConfigValue) WithNode

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

func (*ExpectedConfigValue) WithSection

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

type ExpectedCopy

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

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

func (*ExpectedCopy) String

func (e *ExpectedCopy) String() string

func (*ExpectedCopy) WillDelay

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

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

func (*ExpectedCopy) WillExecute

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

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

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

func (*ExpectedCopy) WillReturnError

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

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

func (*ExpectedCopy) WithOptions

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

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

func (*ExpectedCopy) WithSourceID

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

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

func (*ExpectedCopy) WithTargetID

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

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

type ExpectedCreateDB

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

ExpectedCreateDB represents an expectation to call the CreateDB() method.

Implementation note: Because kivik always calls DB() after a successful CreateDB() is executed, ExpectCreateDB() creates two expectations under the covers, one for the backend CreateDB() call, and one for the DB() call. If WillReturnError() is called, the DB() call expectation is removed.

func (*ExpectedCreateDB) String

func (e *ExpectedCreateDB) String() string

func (*ExpectedCreateDB) WillDelay

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

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

func (*ExpectedCreateDB) WillExecute

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

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

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

func (*ExpectedCreateDB) WithName

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

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

func (*ExpectedCreateDB) WithOptions

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

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

type ExpectedCreateDoc

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

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

func (*ExpectedCreateDoc) String

func (e *ExpectedCreateDoc) String() string

func (*ExpectedCreateDoc) WillDelay

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

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

func (*ExpectedCreateDoc) WillExecute

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

func (e *ExpectedCreateDoc) WillReturn(ret0 string, ret1 string) *ExpectedCreateDoc

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

func (*ExpectedCreateDoc) WillReturnError

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

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

func (*ExpectedCreateDoc) WithDoc

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

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

func (*ExpectedCreateDoc) WithOptions

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

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

type ExpectedCreateIndex

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

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

func (*ExpectedCreateIndex) String

func (e *ExpectedCreateIndex) String() string

func (*ExpectedCreateIndex) WillDelay

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

func (*ExpectedCreateIndex) WillExecute

func (e *ExpectedCreateIndex) WillExecute(cb func(ctx context.Context, arg0 string, arg1 string, arg2 interface{}) error) *ExpectedCreateIndex

WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.

func (*ExpectedCreateIndex) WillReturnError

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

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

func (*ExpectedCreateIndex) WithDDocID

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

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

func (*ExpectedCreateIndex) WithIndex

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

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

func (*ExpectedCreateIndex) WithName

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

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

type ExpectedDB

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

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

func (*ExpectedDB) String

func (e *ExpectedDB) String() string

func (*ExpectedDB) WillDelay

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

WillDelay causes the call to DB() to delay.

func (*ExpectedDB) WillExecute

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

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

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

func (*ExpectedDB) WillReturnError

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

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

func (*ExpectedDB) WithName

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

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

func (*ExpectedDB) WithOptions

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

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

type ExpectedDBClose

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

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

func (*ExpectedDBClose) String

func (e *ExpectedDBClose) String() string

func (*ExpectedDBClose) WillDelay

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

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

func (*ExpectedDBClose) WillExecute

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

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

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

type ExpectedDBExists

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

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

func (*ExpectedDBExists) String

func (e *ExpectedDBExists) String() string

func (*ExpectedDBExists) WillDelay

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

WillDelay causes the call to DBExists() to delay.

func (*ExpectedDBExists) WillExecute

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

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

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

func (*ExpectedDBExists) WillReturnError

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

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

func (*ExpectedDBExists) WithName

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

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

func (*ExpectedDBExists) WithOptions

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

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

type ExpectedDBUpdates

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

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

func (*ExpectedDBUpdates) String

func (e *ExpectedDBUpdates) String() string

func (*ExpectedDBUpdates) WillDelay

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

WillDelay causes the call to DBUpdates() to delay.

func (*ExpectedDBUpdates) WillExecute

func (e *ExpectedDBUpdates) WillExecute(cb func(ctx context.Context) (driver.DBUpdates, error)) *ExpectedDBUpdates

WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.

func (*ExpectedDBUpdates) WillReturn

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

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

func (*ExpectedDBUpdates) WillReturnError

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

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

type ExpectedDBsStats

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

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

func (*ExpectedDBsStats) String

func (e *ExpectedDBsStats) String() string

func (*ExpectedDBsStats) WillDelay

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

WillDelay causes the call to DBsStats() to delay.

func (*ExpectedDBsStats) WillExecute

func (e *ExpectedDBsStats) WillExecute(cb func(ctx context.Context, arg0 []string) ([]*driver.DBStats, error)) *ExpectedDBsStats

WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.

func (*ExpectedDBsStats) WillReturn

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

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

func (*ExpectedDBsStats) WillReturnError

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

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

func (*ExpectedDBsStats) WithNames

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

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

type ExpectedDelete

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

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

func (*ExpectedDelete) String

func (e *ExpectedDelete) String() string

func (*ExpectedDelete) WillDelay

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

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

func (*ExpectedDelete) WillExecute

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

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

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

func (*ExpectedDelete) WillReturnError

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

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

func (*ExpectedDelete) WithDocID

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

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

func (*ExpectedDelete) WithOptions

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

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

func (*ExpectedDelete) WithRev

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

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

type ExpectedDeleteAttachment

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

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

func (*ExpectedDeleteAttachment) String

func (e *ExpectedDeleteAttachment) String() string

func (*ExpectedDeleteAttachment) WillDelay

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

func (*ExpectedDeleteAttachment) WillExecute

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

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

func (*ExpectedDeleteAttachment) WillReturnError

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

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

func (*ExpectedDeleteAttachment) WithDocID

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

func (*ExpectedDeleteAttachment) WithFilename

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

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

func (*ExpectedDeleteAttachment) WithOptions

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

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

func (*ExpectedDeleteAttachment) WithRev

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

type ExpectedDeleteConfigKey

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

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

func (*ExpectedDeleteConfigKey) String

func (e *ExpectedDeleteConfigKey) String() string

func (*ExpectedDeleteConfigKey) WillDelay

WillDelay causes the call to DeleteConfigKey() to delay.

func (*ExpectedDeleteConfigKey) WillExecute

func (e *ExpectedDeleteConfigKey) WillExecute(cb func(ctx context.Context, arg0 string, arg1 string, arg2 string) (string, error)) *ExpectedDeleteConfigKey

WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.

func (*ExpectedDeleteConfigKey) WillReturn

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

func (*ExpectedDeleteConfigKey) WillReturnError

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

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

func (*ExpectedDeleteConfigKey) WithKey

func (*ExpectedDeleteConfigKey) WithNode

func (*ExpectedDeleteConfigKey) WithSection

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

type ExpectedDeleteIndex

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

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

func (*ExpectedDeleteIndex) String

func (e *ExpectedDeleteIndex) String() string

func (*ExpectedDeleteIndex) WillDelay

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

func (*ExpectedDeleteIndex) WillExecute

func (e *ExpectedDeleteIndex) WillExecute(cb func(ctx context.Context, arg0 string, arg1 string) error) *ExpectedDeleteIndex

WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.

func (*ExpectedDeleteIndex) WillReturnError

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

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

func (*ExpectedDeleteIndex) WithDDoc

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

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

func (*ExpectedDeleteIndex) WithName

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

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

type ExpectedDesignDocs

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

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

func (*ExpectedDesignDocs) String

func (e *ExpectedDesignDocs) String() string

func (*ExpectedDesignDocs) WillDelay

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

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

func (*ExpectedDesignDocs) WillExecute

func (e *ExpectedDesignDocs) WillExecute(cb func(ctx context.Context, options 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

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

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

func (*ExpectedDesignDocs) WillReturnError

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

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

func (*ExpectedDesignDocs) WithOptions

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

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

type ExpectedDestroyDB

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

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

func (*ExpectedDestroyDB) String

func (e *ExpectedDestroyDB) String() string

func (*ExpectedDestroyDB) WillDelay

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

WillDelay causes the call to DestroyDB() to delay.

func (*ExpectedDestroyDB) WillExecute

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

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

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

func (*ExpectedDestroyDB) WithName

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

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

func (*ExpectedDestroyDB) WithOptions

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

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

type ExpectedExplain

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

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

func (*ExpectedExplain) String

func (e *ExpectedExplain) String() string

func (*ExpectedExplain) WillDelay

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

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

func (*ExpectedExplain) WillExecute

func (e *ExpectedExplain) WillExecute(cb func(ctx context.Context, arg0 interface{}) (*driver.QueryPlan, error)) *ExpectedExplain

WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.

func (*ExpectedExplain) WillReturn

func (e *ExpectedExplain) WillReturn(ret0 *driver.QueryPlan) *ExpectedExplain

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

func (*ExpectedExplain) WillReturnError

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

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

func (*ExpectedExplain) WithQuery

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

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

type ExpectedFind

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

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

func (*ExpectedFind) String

func (e *ExpectedFind) String() string

func (*ExpectedFind) WillDelay

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

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

func (*ExpectedFind) WillExecute

func (e *ExpectedFind) WillExecute(cb func(ctx context.Context, arg0 interface{}) (driver.Rows, error)) *ExpectedFind

WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.

func (*ExpectedFind) WillReturn

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

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

func (*ExpectedFind) WillReturnError

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

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

func (*ExpectedFind) WithQuery

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

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

type ExpectedFlush

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

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

func (*ExpectedFlush) String

func (e *ExpectedFlush) String() string

func (*ExpectedFlush) WillDelay

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

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

func (*ExpectedFlush) WillExecute

func (e *ExpectedFlush) WillExecute(cb func(ctx context.Context) error) *ExpectedFlush

WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.

func (*ExpectedFlush) WillReturnError

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

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

type ExpectedGet

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

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

func (*ExpectedGet) String

func (e *ExpectedGet) String() string

func (*ExpectedGet) WillDelay

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

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

func (*ExpectedGet) WillExecute

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

func (e *ExpectedGet) WillReturn(ret0 *driver.Document) *ExpectedGet

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

func (*ExpectedGet) WillReturnError

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

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

func (*ExpectedGet) WithDocID

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

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

func (*ExpectedGet) WithOptions

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

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

type ExpectedGetAttachment

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

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

func (*ExpectedGetAttachment) String

func (e *ExpectedGetAttachment) String() string

func (*ExpectedGetAttachment) WillDelay

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

func (*ExpectedGetAttachment) WillExecute

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

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

func (*ExpectedGetAttachment) WillReturnError

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

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

func (*ExpectedGetAttachment) WithDocID

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

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

func (*ExpectedGetAttachment) WithFilename

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

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

func (*ExpectedGetAttachment) WithOptions

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

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

type ExpectedGetAttachmentMeta

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

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

func (*ExpectedGetAttachmentMeta) String

func (e *ExpectedGetAttachmentMeta) String() string

func (*ExpectedGetAttachmentMeta) WillDelay

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

func (*ExpectedGetAttachmentMeta) WillExecute

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

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

func (*ExpectedGetAttachmentMeta) WillReturnError

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

func (*ExpectedGetAttachmentMeta) WithDocID

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

func (*ExpectedGetAttachmentMeta) WithFilename

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

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

func (*ExpectedGetAttachmentMeta) WithOptions

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

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

type ExpectedGetIndexes

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

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

func (*ExpectedGetIndexes) String

func (e *ExpectedGetIndexes) String() string

func (*ExpectedGetIndexes) WillDelay

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

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

func (*ExpectedGetIndexes) WillExecute

func (e *ExpectedGetIndexes) WillExecute(cb func(ctx context.Context) ([]driver.Index, error)) *ExpectedGetIndexes

WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.

func (*ExpectedGetIndexes) WillReturn

func (e *ExpectedGetIndexes) WillReturn(ret0 []driver.Index) *ExpectedGetIndexes

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

func (*ExpectedGetIndexes) WillReturnError

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

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

type ExpectedGetMeta

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

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

func (*ExpectedGetMeta) String

func (e *ExpectedGetMeta) String() string

func (*ExpectedGetMeta) WillDelay

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

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

func (*ExpectedGetMeta) WillExecute

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

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

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

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

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

func (*ExpectedGetMeta) WithOptions

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

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

type ExpectedGetReplications

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

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

func (*ExpectedGetReplications) String

func (e *ExpectedGetReplications) String() string

func (*ExpectedGetReplications) WillDelay

WillDelay causes the call to GetReplications() to delay.

func (*ExpectedGetReplications) WillExecute

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

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

func (*ExpectedGetReplications) WillReturnError

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

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

func (*ExpectedGetReplications) WithOptions

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

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

type ExpectedLocalDocs

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

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

func (*ExpectedLocalDocs) String

func (e *ExpectedLocalDocs) String() string

func (*ExpectedLocalDocs) WillDelay

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

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

func (*ExpectedLocalDocs) WillExecute

func (e *ExpectedLocalDocs) WillExecute(cb func(ctx context.Context, options 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

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

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

func (*ExpectedLocalDocs) WillReturnError

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

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

func (*ExpectedLocalDocs) WithOptions

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

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

type ExpectedPing

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

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

func (*ExpectedPing) String

func (e *ExpectedPing) String() string

func (*ExpectedPing) WillDelay

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

WillDelay causes the call to Ping() to delay.

func (*ExpectedPing) WillExecute

func (e *ExpectedPing) WillExecute(cb func(ctx context.Context) (bool, error)) *ExpectedPing

WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.

func (*ExpectedPing) WillReturn

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

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

func (*ExpectedPing) WillReturnError

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

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

type ExpectedPurge

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

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

func (*ExpectedPurge) String

func (e *ExpectedPurge) String() string

func (*ExpectedPurge) WillDelay

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

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

func (*ExpectedPurge) WillExecute

func (e *ExpectedPurge) WillExecute(cb func(ctx context.Context, arg0 map[string][]string) (*driver.PurgeResult, error)) *ExpectedPurge

WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.

func (*ExpectedPurge) WillReturn

func (e *ExpectedPurge) WillReturn(ret0 *driver.PurgeResult) *ExpectedPurge

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

func (*ExpectedPurge) WillReturnError

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

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

func (*ExpectedPurge) WithDocRevMap

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

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

type ExpectedPut

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

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

func (*ExpectedPut) String

func (e *ExpectedPut) String() string

func (*ExpectedPut) WillDelay

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

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

func (*ExpectedPut) WillExecute

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

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

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

func (*ExpectedPut) WillReturnError

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

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

func (*ExpectedPut) WithDoc

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

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

func (*ExpectedPut) WithDocID

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

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

func (*ExpectedPut) WithOptions

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

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

type ExpectedPutAttachment

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

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

func (*ExpectedPutAttachment) String

func (e *ExpectedPutAttachment) String() string

func (*ExpectedPutAttachment) WillDelay

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

func (*ExpectedPutAttachment) WillExecute

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

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

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

func (*ExpectedPutAttachment) WillReturnError

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

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

func (*ExpectedPutAttachment) WithAttachment

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

func (*ExpectedPutAttachment) WithDocID

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

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

func (*ExpectedPutAttachment) WithOptions

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

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

func (*ExpectedPutAttachment) WithRev

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

type ExpectedQuery

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

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

func (*ExpectedQuery) String

func (e *ExpectedQuery) String() string

func (*ExpectedQuery) WillDelay

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

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

func (*ExpectedQuery) WillExecute

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

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

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

func (*ExpectedQuery) WillReturnError

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

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

func (*ExpectedQuery) WithDDocID

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

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

func (*ExpectedQuery) WithOptions

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

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

func (*ExpectedQuery) WithView

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

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

type ExpectedReplicate

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

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

func (*ExpectedReplicate) String

func (e *ExpectedReplicate) String() string

func (*ExpectedReplicate) WillDelay

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

WillDelay causes the call to Replicate() to delay.

func (*ExpectedReplicate) WillExecute

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

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

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

func (*ExpectedReplicate) WillReturnError

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

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

func (*ExpectedReplicate) WithOptions

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

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

func (*ExpectedReplicate) WithSource

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

func (*ExpectedReplicate) WithTarget

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

type ExpectedRevsDiff

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

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

func (*ExpectedRevsDiff) String

func (e *ExpectedRevsDiff) String() string

func (*ExpectedRevsDiff) WillDelay

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

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

func (*ExpectedRevsDiff) WillExecute

func (e *ExpectedRevsDiff) WillExecute(cb func(ctx context.Context, arg0 interface{}) (driver.Rows, error)) *ExpectedRevsDiff

WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.

func (*ExpectedRevsDiff) WillReturn

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

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

func (*ExpectedRevsDiff) WillReturnError

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

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

func (*ExpectedRevsDiff) WithRevLookup

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

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

type ExpectedSecurity

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

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

func (*ExpectedSecurity) String

func (e *ExpectedSecurity) String() string

func (*ExpectedSecurity) WillDelay

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

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

func (*ExpectedSecurity) WillExecute

func (e *ExpectedSecurity) WillExecute(cb func(ctx context.Context) (*driver.Security, error)) *ExpectedSecurity

WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.

func (*ExpectedSecurity) WillReturn

func (e *ExpectedSecurity) WillReturn(ret0 *driver.Security) *ExpectedSecurity

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

func (*ExpectedSecurity) WillReturnError

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

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

type ExpectedSession

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

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

func (*ExpectedSession) String

func (e *ExpectedSession) String() string

func (*ExpectedSession) WillDelay

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

WillDelay causes the call to Session() to delay.

func (*ExpectedSession) WillExecute

func (e *ExpectedSession) WillExecute(cb func(ctx context.Context) (*driver.Session, error)) *ExpectedSession

WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.

func (*ExpectedSession) WillReturn

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

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

func (*ExpectedSession) WillReturnError

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

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

type ExpectedSetConfigValue

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

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

func (*ExpectedSetConfigValue) String

func (e *ExpectedSetConfigValue) String() string

func (*ExpectedSetConfigValue) WillDelay

WillDelay causes the call to SetConfigValue() to delay.

func (*ExpectedSetConfigValue) WillExecute

func (e *ExpectedSetConfigValue) WillExecute(cb func(ctx context.Context, arg0 string, arg1 string, arg2 string, arg3 string) (string, error)) *ExpectedSetConfigValue

WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.

func (*ExpectedSetConfigValue) WillReturn

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

func (*ExpectedSetConfigValue) WillReturnError

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

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

func (*ExpectedSetConfigValue) WithKey

func (*ExpectedSetConfigValue) WithNode

func (*ExpectedSetConfigValue) WithSection

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

func (*ExpectedSetConfigValue) WithValue

type ExpectedSetSecurity

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

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

func (*ExpectedSetSecurity) String

func (e *ExpectedSetSecurity) String() string

func (*ExpectedSetSecurity) WillDelay

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

func (*ExpectedSetSecurity) WillExecute

func (e *ExpectedSetSecurity) WillExecute(cb func(ctx context.Context, arg0 *driver.Security) error) *ExpectedSetSecurity

WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.

func (*ExpectedSetSecurity) WillReturnError

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

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

func (*ExpectedSetSecurity) WithSecurity

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

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

type ExpectedStats

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

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

func (*ExpectedStats) String

func (e *ExpectedStats) String() string

func (*ExpectedStats) WillDelay

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

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

func (*ExpectedStats) WillExecute

func (e *ExpectedStats) WillExecute(cb func(ctx context.Context) (*driver.DBStats, error)) *ExpectedStats

WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.

func (*ExpectedStats) WillReturn

func (e *ExpectedStats) WillReturn(ret0 *driver.DBStats) *ExpectedStats

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

func (*ExpectedStats) WillReturnError

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

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

type ExpectedVersion

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

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

func (*ExpectedVersion) String

func (e *ExpectedVersion) String() string

func (*ExpectedVersion) WillDelay

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

WillDelay causes the call to Version() to delay.

func (*ExpectedVersion) WillExecute

func (e *ExpectedVersion) WillExecute(cb func(ctx context.Context) (*driver.Version, error)) *ExpectedVersion

WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.

func (*ExpectedVersion) WillReturn

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

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

func (*ExpectedVersion) WillReturnError

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

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

type ExpectedViewCleanup

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

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

func (*ExpectedViewCleanup) String

func (e *ExpectedViewCleanup) String() string

func (*ExpectedViewCleanup) WillDelay

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

func (*ExpectedViewCleanup) WillExecute

func (e *ExpectedViewCleanup) WillExecute(cb func(ctx context.Context) error) *ExpectedViewCleanup

WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.

func (*ExpectedViewCleanup) WillReturnError

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

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

type MockClient

type MockClient = Client

MockClient is deprecated

type MockDB

type MockDB = DB

MockDB is deprecated

type Replication

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

Replication is a replication instance.

func (*Replication) EndTime

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

func (*Replication) Err

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

func (*Replication) ID

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

func (*Replication) MarshalJSON

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

func (*Replication) Source

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

func (*Replication) StartTime

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

func (*Replication) State

func (*Replication) Target

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

type Rows

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

Rows is a mocked collection of rows.

func NewRows

func NewRows() *Rows

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

func (*Rows) AddDelay

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

AddDelay adds a delay before the next iteration will complete.

func (*Rows) AddRow

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

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

AddRowError adds an error to be returned during row iteration.

func (*Rows) Close

func (i *Rows) Close() error

func (*Rows) CloseError

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

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

func (*Rows) Final

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

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

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

func (*Rows) TotalRows

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

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

func (*Rows) UpdateSeq

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

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

func (*Rows) Warning

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

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

type Updates

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

Updates is a mocked collection of database updates.

func NewDBUpdates

func NewDBUpdates() *Updates

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

func (*Updates) AddDelay

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

AddDelay adds a delay before the next iteration will complete.

func (*Updates) AddUpdate

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

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

AddUpdateError adds an error to be returned during update iteration.

func (*Updates) Close

func (i *Updates) Close() error

func (*Updates) CloseError

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

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

func (*Updates) Final

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

Path Synopsis

Jump to

Keyboard shortcuts

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