mockdb

package
v4.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

README

Go Reference

MockDB

Package mockdb 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 := mockdb.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 := mockdb.New()
    if err != nil {
        t.Fatal(err)
    }

    mock.ExpectDB().WithName("_users").WillReturn(mock.NewDB().
        ExpectGet().WithDocID("bob").
            WillReturn(mockdb.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 mockdb provides a full Kivik driver implementation, for mocking in 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.

Types

type Changes

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

Changes is a mocked collection of Changes results.

func NewChanges

func NewChanges() *Changes

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

func (*Changes) AddChange

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) ExpectAllDBsStats added in v4.1.0

func (c *Client) ExpectAllDBsStats() *ExpectedAllDBsStats

ExpectAllDBsStats queues an expectation that AllDBsStats will be called.

func (*Client) ExpectClose

func (c *Client) ExpectClose() *ExpectedClose

ExpectClose queues an expectation that Close will be called.

func (*Client) ExpectClusterSetup

func (c *Client) ExpectClusterSetup() *ExpectedClusterSetup

ExpectClusterSetup queues an expectation that ClusterSetup will be called.

func (*Client) ExpectClusterStatus

func (c *Client) ExpectClusterStatus() *ExpectedClusterStatus

ExpectClusterStatus queues an expectation that ClusterStatus will be called.

func (*Client) ExpectConfig

func (c *Client) ExpectConfig() *ExpectedConfig

ExpectConfig queues an expectation that Config will be called.

func (*Client) ExpectConfigSection

func (c *Client) ExpectConfigSection() *ExpectedConfigSection

ExpectConfigSection queues an expectation that ConfigSection will be called.

func (*Client) ExpectConfigValue

func (c *Client) ExpectConfigValue() *ExpectedConfigValue

ExpectConfigValue queues an expectation that ConfigValue will be called.

func (*Client) ExpectCreateDB

func (c *Client) ExpectCreateDB() *ExpectedCreateDB

ExpectCreateDB queues an expectation for a CreateDB() call.

func (*Client) ExpectDB

func (c *Client) ExpectDB() *ExpectedDB

ExpectDB queues an expectation that DB will be called.

func (*Client) ExpectDBExists

func (c *Client) ExpectDBExists() *ExpectedDBExists

ExpectDBExists queues an expectation that DBExists will be called.

func (*Client) ExpectDBUpdates

func (c *Client) ExpectDBUpdates() *ExpectedDBUpdates

ExpectDBUpdates queues an expectation that DBUpdates will be called.

func (*Client) ExpectDBsStats

func (c *Client) ExpectDBsStats() *ExpectedDBsStats

ExpectDBsStats queues an expectation that DBsStats will be called.

func (*Client) ExpectDeleteConfigKey

func (c *Client) ExpectDeleteConfigKey() *ExpectedDeleteConfigKey

ExpectDeleteConfigKey queues an expectation that DeleteConfigKey will be called.

func (*Client) ExpectDestroyDB

func (c *Client) ExpectDestroyDB() *ExpectedDestroyDB

ExpectDestroyDB queues an expectation that DestroyDB will be called.

func (*Client) ExpectGetReplications

func (c *Client) ExpectGetReplications() *ExpectedGetReplications

ExpectGetReplications queues an expectation that GetReplications will be called.

func (*Client) ExpectMembership

func (c *Client) ExpectMembership() *ExpectedMembership

ExpectMembership queues an expectation that Membership will be called.

func (*Client) ExpectPing

func (c *Client) ExpectPing() *ExpectedPing

ExpectPing queues an expectation that Ping will be called.

func (*Client) ExpectReplicate

func (c *Client) ExpectReplicate() *ExpectedReplicate

ExpectReplicate queues an expectation that Replicate will be called.

func (*Client) ExpectSession

func (c *Client) ExpectSession() *ExpectedSession

ExpectSession queues an expectation that Session will be called.

func (*Client) ExpectSetConfigValue

func (c *Client) ExpectSetConfigValue() *ExpectedSetConfigValue

ExpectSetConfigValue queues an expectation that SetConfigValue will be called.

func (*Client) ExpectVersion

func (c *Client) ExpectVersion() *ExpectedVersion

ExpectVersion queues an expectation that Version will be called.

func (*Client) ExpectationsWereMet

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) ExpectGetRev

func (db *DB) ExpectGetRev() *ExpectedGetRev

ExpectGetRev queues an expectation that DB.GetRev will be called.

func (*DB) ExpectLocalDocs

func (db *DB) ExpectLocalDocs() *ExpectedLocalDocs

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

func (*DB) ExpectOpenRevs

func (db *DB) ExpectOpenRevs() *ExpectedOpenRevs

ExpectOpenRevs queues an expectation that DB.OpenRevs will be called.

func (*DB) ExpectPartitionStats

func (db *DB) ExpectPartitionStats() *ExpectedPartitionStats

ExpectPartitionStats queues an expectation that DB.PartitionStats will be called.

func (*DB) ExpectPurge

func (db *DB) ExpectPurge() *ExpectedPurge

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

func (*DB) ExpectPut

func (db *DB) ExpectPut() *ExpectedPut

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

func (*DB) ExpectPutAttachment

func (db *DB) ExpectPutAttachment() *ExpectedPutAttachment

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

func (*DB) ExpectQuery

func (db *DB) ExpectQuery() *ExpectedQuery

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

func (*DB) ExpectRevsDiff

func (db *DB) ExpectRevsDiff() *ExpectedRevsDiff

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

func (*DB) ExpectSecurity

func (db *DB) ExpectSecurity() *ExpectedSecurity

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

func (*DB) ExpectSetSecurity

func (db *DB) ExpectSetSecurity() *ExpectedSetSecurity

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

func (*DB) ExpectStats

func (db *DB) ExpectStats() *ExpectedStats

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

func (*DB) ExpectViewCleanup

func (db *DB) ExpectViewCleanup() *ExpectedViewCleanup

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

type ExpectedAllDBs

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

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

func (*ExpectedAllDBs) String

func (e *ExpectedAllDBs) String() string

String satisfies the fmt.Stringer interface.

func (*ExpectedAllDBs) WillDelay

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

WillDelay causes the call to AllDBs() to delay.

func (*ExpectedAllDBs) WillExecute

func (e *ExpectedAllDBs) WillExecute(cb func(ctx context.Context, options driver.Options) ([]string, error)) *ExpectedAllDBs

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

func (*ExpectedAllDBs) WillReturn

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

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

func (*ExpectedAllDBs) WillReturnError

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

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

func (*ExpectedAllDBs) WithOptions

func (e *ExpectedAllDBs) WithOptions(options ...kivik.Option) *ExpectedAllDBs

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

type ExpectedAllDBsStats added in v4.1.0

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

ExpectedAllDBsStats represents an expectation for a call to AllDBsStats().

func (*ExpectedAllDBsStats) String added in v4.1.0

func (e *ExpectedAllDBsStats) String() string

func (*ExpectedAllDBsStats) WillDelay added in v4.1.0

WillDelay causes the call to AllDBsStats() to delay.

func (*ExpectedAllDBsStats) WillExecute added in v4.1.0

func (e *ExpectedAllDBsStats) WillExecute(cb func(ctx context.Context, options driver.Options) ([]*driver.DBStats, error)) *ExpectedAllDBsStats

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 (*ExpectedAllDBsStats) WillReturn added in v4.1.0

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

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

func (*ExpectedAllDBsStats) WillReturnError added in v4.1.0

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

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

func (*ExpectedAllDBsStats) WithOptions added in v4.1.0

func (e *ExpectedAllDBsStats) WithOptions(options ...kivik.Option) *ExpectedAllDBsStats

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

type ExpectedAllDocs

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

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

func (*ExpectedAllDocs) String

func (e *ExpectedAllDocs) String() string

func (*ExpectedAllDocs) WillDelay

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

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

func (*ExpectedAllDocs) WillExecute

func (e *ExpectedAllDocs) WillExecute(cb func(ctx context.Context, options driver.Options) (driver.Rows, error)) *ExpectedAllDocs

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

func (*ExpectedAllDocs) WillReturn

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

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

func (*ExpectedAllDocs) WillReturnError

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

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

func (*ExpectedAllDocs) WithOptions

func (e *ExpectedAllDocs) WithOptions(options ...kivik.Option) *ExpectedAllDocs

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

type ExpectedBulkDocs

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

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

func (*ExpectedBulkDocs) String

func (e *ExpectedBulkDocs) String() string

func (*ExpectedBulkDocs) WillDelay

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

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

func (*ExpectedBulkDocs) WillExecute

func (e *ExpectedBulkDocs) WillExecute(cb func(ctx context.Context, arg0 []interface{}, options driver.Options) ([]driver.BulkResult, error)) *ExpectedBulkDocs

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

func (*ExpectedBulkDocs) WillReturn

func (e *ExpectedBulkDocs) WillReturn(ret0 []driver.BulkResult) *ExpectedBulkDocs

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

func (*ExpectedBulkDocs) WillReturnError

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

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

func (*ExpectedBulkDocs) WithOptions

func (e *ExpectedBulkDocs) WithOptions(options ...kivik.Option) *ExpectedBulkDocs

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

type ExpectedBulkGet

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

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

func (*ExpectedBulkGet) String

func (e *ExpectedBulkGet) String() string

func (*ExpectedBulkGet) WillDelay

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

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

func (*ExpectedBulkGet) WillExecute

func (e *ExpectedBulkGet) WillExecute(cb func(ctx context.Context, arg0 []driver.BulkGetReference, options driver.Options) (driver.Rows, error)) *ExpectedBulkGet

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

func (*ExpectedBulkGet) WillReturn

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

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

func (*ExpectedBulkGet) WillReturnError

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

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

func (*ExpectedBulkGet) WithOptions

func (e *ExpectedBulkGet) WithOptions(options ...kivik.Option) *ExpectedBulkGet

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

type ExpectedChanges

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

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

func (*ExpectedChanges) String

func (e *ExpectedChanges) String() string

func (*ExpectedChanges) WillDelay

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

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

func (*ExpectedChanges) WillExecute

func (e *ExpectedChanges) WillExecute(cb func(ctx context.Context, options driver.Options) (driver.Changes, error)) *ExpectedChanges

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

func (*ExpectedChanges) WillReturn

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

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

func (*ExpectedChanges) WillReturnError

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

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

func (*ExpectedChanges) WithOptions

func (e *ExpectedChanges) WithOptions(options ...kivik.Option) *ExpectedChanges

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

type ExpectedClose

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

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

func (*ExpectedClose) String

func (e *ExpectedClose) String() string

func (*ExpectedClose) WillExecute

func (e *ExpectedClose) WillExecute(cb func() error) *ExpectedClose

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

func (*ExpectedClose) WillReturnError

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

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

type ExpectedClusterSetup

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

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

func (*ExpectedClusterSetup) String

func (e *ExpectedClusterSetup) String() string

func (*ExpectedClusterSetup) WillDelay

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 driver.Options) (string, error)) *ExpectedClusterStatus

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

func (*ExpectedClusterStatus) WillReturn

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

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

func (*ExpectedClusterStatus) WillReturnError

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

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

func (*ExpectedClusterStatus) WithOptions

func (e *ExpectedClusterStatus) WithOptions(options ...kivik.Option) *ExpectedClusterStatus

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

type ExpectedCompact

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

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

func (*ExpectedCompact) String

func (e *ExpectedCompact) String() string

func (*ExpectedCompact) WillDelay

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

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

func (*ExpectedCompact) WillExecute

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

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

func (*ExpectedCompact) WillReturnError

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

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

type ExpectedCompactView

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

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

func (*ExpectedCompactView) String

func (e *ExpectedCompactView) String() string

func (*ExpectedCompactView) WillDelay

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

func (*ExpectedCompactView) WillExecute

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

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

func (*ExpectedCompactView) WillReturnError

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

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

func (*ExpectedCompactView) WithDDoc

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

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

type ExpectedConfig

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

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

func (*ExpectedConfig) String

func (e *ExpectedConfig) String() string

func (*ExpectedConfig) WillDelay

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

WillDelay causes the call to Config() to delay.

func (*ExpectedConfig) WillExecute

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

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

func (*ExpectedConfig) WillReturn

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

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

func (*ExpectedConfig) WillReturnError

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

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

func (*ExpectedConfig) WithNode

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

WithNode sets the expected node.

type ExpectedConfigSection

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

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

func (*ExpectedConfigSection) String

func (e *ExpectedConfigSection) String() string

func (*ExpectedConfigSection) WillDelay

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

WithNode sets the expected node.

func (*ExpectedConfigSection) WithSection

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

WithSection sets the expected section.

type ExpectedConfigValue

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

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

func (*ExpectedConfigValue) String

func (e *ExpectedConfigValue) String() string

func (*ExpectedConfigValue) WillDelay

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

WithKey sets the expected key.

func (*ExpectedConfigValue) WithNode

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

WithNode sets the expected node.

func (*ExpectedConfigValue) WithSection

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

WithSection sets the expected section.

type ExpectedCopy

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

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

func (*ExpectedCopy) String

func (e *ExpectedCopy) String() string

func (*ExpectedCopy) WillDelay

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

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

func (*ExpectedCopy) WillExecute

func (e *ExpectedCopy) WillExecute(cb func(ctx context.Context, arg0 string, arg1 string, options driver.Options) (string, error)) *ExpectedCopy

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

func (*ExpectedCopy) WillReturn

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

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

func (*ExpectedCopy) WillReturnError

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

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

func (*ExpectedCopy) WithOptions

func (e *ExpectedCopy) WithOptions(options ...kivik.Option) *ExpectedCopy

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

func (*ExpectedCopy) WithSourceID

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

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

func (*ExpectedCopy) WithTargetID

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

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

type ExpectedCreateDB

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

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

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

func (*ExpectedCreateDB) String

func (e *ExpectedCreateDB) String() string

func (*ExpectedCreateDB) WillDelay

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

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

func (*ExpectedCreateDB) WillExecute

func (e *ExpectedCreateDB) WillExecute(cb func(ctx context.Context, arg0 string, options driver.Options) error) *ExpectedCreateDB

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

func (*ExpectedCreateDB) WillReturnError

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

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

func (*ExpectedCreateDB) WithName

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

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

func (*ExpectedCreateDB) WithOptions

func (e *ExpectedCreateDB) WithOptions(options ...kivik.Option) *ExpectedCreateDB

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

type ExpectedCreateDoc

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

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

func (*ExpectedCreateDoc) String

func (e *ExpectedCreateDoc) String() string

func (*ExpectedCreateDoc) WillDelay

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

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

func (*ExpectedCreateDoc) WillExecute

func (e *ExpectedCreateDoc) WillExecute(cb func(ctx context.Context, arg0 interface{}, options driver.Options) (string, string, error)) *ExpectedCreateDoc

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

func (*ExpectedCreateDoc) WillReturn

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

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

func (*ExpectedCreateDoc) WillReturnError

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

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

func (*ExpectedCreateDoc) WithDoc

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

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

func (*ExpectedCreateDoc) WithOptions

func (e *ExpectedCreateDoc) WithOptions(options ...kivik.Option) *ExpectedCreateDoc

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

type ExpectedCreateIndex

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

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

func (*ExpectedCreateIndex) String

func (e *ExpectedCreateIndex) String() string

func (*ExpectedCreateIndex) WillDelay

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

func (*ExpectedCreateIndex) WillExecute

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

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

func (*ExpectedCreateIndex) WillReturnError

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

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

func (*ExpectedCreateIndex) WithDDocID

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

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

func (*ExpectedCreateIndex) WithIndex

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

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

func (*ExpectedCreateIndex) WithName

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

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

func (*ExpectedCreateIndex) WithOptions

func (e *ExpectedCreateIndex) WithOptions(options ...kivik.Option) *ExpectedCreateIndex

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

type ExpectedDB

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

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

func (*ExpectedDB) String

func (e *ExpectedDB) String() string

func (*ExpectedDB) WillExecute

func (e *ExpectedDB) WillExecute(cb func(arg0 string, options driver.Options) (driver.DB, error)) *ExpectedDB

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

func (*ExpectedDB) WillReturn

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

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

func (*ExpectedDB) WillReturnError

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

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

func (*ExpectedDB) WithName

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

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

func (*ExpectedDB) WithOptions

func (e *ExpectedDB) WithOptions(options ...kivik.Option) *ExpectedDB

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

type ExpectedDBClose

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

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

func (*ExpectedDBClose) String

func (e *ExpectedDBClose) String() string

func (*ExpectedDBClose) WillExecute

func (e *ExpectedDBClose) WillExecute(cb func() error) *ExpectedDBClose

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

func (*ExpectedDBClose) WillReturnError

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

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

type ExpectedDBExists

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

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

func (*ExpectedDBExists) String

func (e *ExpectedDBExists) String() string

func (*ExpectedDBExists) WillDelay

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

WillDelay causes the call to DBExists() to delay.

func (*ExpectedDBExists) WillExecute

func (e *ExpectedDBExists) WillExecute(cb func(ctx context.Context, arg0 string, options driver.Options) (bool, error)) *ExpectedDBExists

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

func (*ExpectedDBExists) WillReturn

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

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

func (*ExpectedDBExists) WillReturnError

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

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

func (*ExpectedDBExists) WithName

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

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

func (*ExpectedDBExists) WithOptions

func (e *ExpectedDBExists) WithOptions(options ...kivik.Option) *ExpectedDBExists

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

type ExpectedDBUpdates

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

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

func (*ExpectedDBUpdates) String

func (e *ExpectedDBUpdates) String() string

func (*ExpectedDBUpdates) WillDelay

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

WillDelay causes the call to DBUpdates() to delay.

func (*ExpectedDBUpdates) WillExecute

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

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

func (*ExpectedDBUpdates) WillReturn

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

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

func (*ExpectedDBUpdates) WillReturnError

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

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

func (*ExpectedDBUpdates) WithOptions

func (e *ExpectedDBUpdates) WithOptions(options ...kivik.Option) *ExpectedDBUpdates

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

type ExpectedDBsStats

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

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

func (*ExpectedDBsStats) String

func (e *ExpectedDBsStats) String() string

func (*ExpectedDBsStats) WillDelay

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

WillDelay causes the call to DBsStats() to delay.

func (*ExpectedDBsStats) WillExecute

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

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

func (*ExpectedDBsStats) WillReturn

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

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

func (*ExpectedDBsStats) WillReturnError

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

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

func (*ExpectedDBsStats) WithNames

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

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

type ExpectedDelete

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

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

func (*ExpectedDelete) String

func (e *ExpectedDelete) String() string

func (*ExpectedDelete) WillDelay

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

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

func (*ExpectedDelete) WillExecute

func (e *ExpectedDelete) WillExecute(cb func(ctx context.Context, arg0 string, options driver.Options) (string, error)) *ExpectedDelete

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

func (*ExpectedDelete) WillReturn

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

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

func (*ExpectedDelete) WillReturnError

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

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

func (*ExpectedDelete) WithDocID

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

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

func (*ExpectedDelete) WithOptions

func (e *ExpectedDelete) WithOptions(options ...kivik.Option) *ExpectedDelete

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

type ExpectedDeleteAttachment

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

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

func (*ExpectedDeleteAttachment) String

func (e *ExpectedDeleteAttachment) String() string

func (*ExpectedDeleteAttachment) WillDelay

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

func (*ExpectedDeleteAttachment) WillExecute

func (e *ExpectedDeleteAttachment) WillExecute(cb func(ctx context.Context, arg0 string, arg1 string, options driver.Options) (string, error)) *ExpectedDeleteAttachment

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

func (*ExpectedDeleteAttachment) WillReturn

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 ...kivik.Option) *ExpectedDeleteAttachment

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

type ExpectedDeleteConfigKey

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

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

func (*ExpectedDeleteConfigKey) String

func (e *ExpectedDeleteConfigKey) String() string

func (*ExpectedDeleteConfigKey) WillDelay

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

WithKey sets the expected key.

func (*ExpectedDeleteConfigKey) WithNode

WithNode sets the expected node.

func (*ExpectedDeleteConfigKey) WithSection

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

WithSection sets the expected section.

type ExpectedDeleteIndex

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

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

func (*ExpectedDeleteIndex) String

func (e *ExpectedDeleteIndex) String() string

func (*ExpectedDeleteIndex) WillDelay

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

func (*ExpectedDeleteIndex) WillExecute

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

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

func (*ExpectedDeleteIndex) WillReturnError

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

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

func (*ExpectedDeleteIndex) WithDDoc

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

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

func (*ExpectedDeleteIndex) WithName

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

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

func (*ExpectedDeleteIndex) WithOptions

func (e *ExpectedDeleteIndex) WithOptions(options ...kivik.Option) *ExpectedDeleteIndex

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

type ExpectedDesignDocs

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

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

func (*ExpectedDesignDocs) String

func (e *ExpectedDesignDocs) String() string

func (*ExpectedDesignDocs) WillDelay

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

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

func (*ExpectedDesignDocs) WillExecute

func (e *ExpectedDesignDocs) WillExecute(cb func(ctx context.Context, options driver.Options) (driver.Rows, error)) *ExpectedDesignDocs

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

func (*ExpectedDesignDocs) WillReturn

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

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

func (*ExpectedDesignDocs) WillReturnError

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

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

func (*ExpectedDesignDocs) WithOptions

func (e *ExpectedDesignDocs) WithOptions(options ...kivik.Option) *ExpectedDesignDocs

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

type ExpectedDestroyDB

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

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

func (*ExpectedDestroyDB) String

func (e *ExpectedDestroyDB) String() string

func (*ExpectedDestroyDB) WillDelay

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

WillDelay causes the call to DestroyDB() to delay.

func (*ExpectedDestroyDB) WillExecute

func (e *ExpectedDestroyDB) WillExecute(cb func(ctx context.Context, arg0 string, options driver.Options) error) *ExpectedDestroyDB

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

func (*ExpectedDestroyDB) WillReturnError

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

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

func (*ExpectedDestroyDB) WithName

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

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

func (*ExpectedDestroyDB) WithOptions

func (e *ExpectedDestroyDB) WithOptions(options ...kivik.Option) *ExpectedDestroyDB

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

type ExpectedExplain

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

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

func (*ExpectedExplain) String

func (e *ExpectedExplain) String() string

func (*ExpectedExplain) WillDelay

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

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

func (*ExpectedExplain) WillExecute

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

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

func (*ExpectedExplain) WillReturn

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

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

func (*ExpectedExplain) WillReturnError

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

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

func (*ExpectedExplain) WithOptions

func (e *ExpectedExplain) WithOptions(options ...kivik.Option) *ExpectedExplain

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

func (*ExpectedExplain) WithQuery

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

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

type ExpectedFind

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

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

func (*ExpectedFind) String

func (e *ExpectedFind) String() string

func (*ExpectedFind) WillDelay

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

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

func (*ExpectedFind) WillExecute

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

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

func (*ExpectedFind) WillReturn

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

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

func (*ExpectedFind) WillReturnError

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

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

func (*ExpectedFind) WithOptions

func (e *ExpectedFind) WithOptions(options ...kivik.Option) *ExpectedFind

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

func (*ExpectedFind) WithQuery

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

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

type ExpectedFlush

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

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

func (*ExpectedFlush) String

func (e *ExpectedFlush) String() string

func (*ExpectedFlush) WillDelay

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

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

func (*ExpectedFlush) WillExecute

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

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

func (*ExpectedFlush) WillReturnError

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

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

type ExpectedGet

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

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

func (*ExpectedGet) String

func (e *ExpectedGet) String() string

func (*ExpectedGet) WillDelay

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

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

func (*ExpectedGet) WillExecute

func (e *ExpectedGet) WillExecute(cb func(ctx context.Context, arg0 string, options driver.Options) (*driver.Document, error)) *ExpectedGet

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

func (*ExpectedGet) WillReturn

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

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

func (*ExpectedGet) WillReturnError

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

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

func (*ExpectedGet) WithDocID

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

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

func (*ExpectedGet) WithOptions

func (e *ExpectedGet) WithOptions(options ...kivik.Option) *ExpectedGet

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

type ExpectedGetAttachment

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

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

func (*ExpectedGetAttachment) String

func (e *ExpectedGetAttachment) String() string

func (*ExpectedGetAttachment) WillDelay

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

func (*ExpectedGetAttachment) WillExecute

func (e *ExpectedGetAttachment) WillExecute(cb func(ctx context.Context, arg0 string, arg1 string, options driver.Options) (*driver.Attachment, error)) *ExpectedGetAttachment

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

func (*ExpectedGetAttachment) WillReturn

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

func (*ExpectedGetAttachment) WillReturnError

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

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

func (*ExpectedGetAttachment) WithDocID

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

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

func (*ExpectedGetAttachment) WithFilename

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

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

func (*ExpectedGetAttachment) WithOptions

func (e *ExpectedGetAttachment) WithOptions(options ...kivik.Option) *ExpectedGetAttachment

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

type ExpectedGetAttachmentMeta

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

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

func (*ExpectedGetAttachmentMeta) String

func (e *ExpectedGetAttachmentMeta) String() string

func (*ExpectedGetAttachmentMeta) WillDelay

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

func (*ExpectedGetAttachmentMeta) WillExecute

func (e *ExpectedGetAttachmentMeta) WillExecute(cb func(ctx context.Context, arg0 string, arg1 string, options driver.Options) (*driver.Attachment, error)) *ExpectedGetAttachmentMeta

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

func (*ExpectedGetAttachmentMeta) WillReturn

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

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

type ExpectedGetIndexes

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

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

func (*ExpectedGetIndexes) String

func (e *ExpectedGetIndexes) String() string

func (*ExpectedGetIndexes) WillDelay

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

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

func (*ExpectedGetIndexes) WillExecute

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

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

func (*ExpectedGetIndexes) WillReturn

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

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

func (*ExpectedGetIndexes) WillReturnError

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

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

func (*ExpectedGetIndexes) WithOptions

func (e *ExpectedGetIndexes) WithOptions(options ...kivik.Option) *ExpectedGetIndexes

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

type ExpectedGetReplications

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

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

func (*ExpectedGetReplications) String

func (e *ExpectedGetReplications) String() string

func (*ExpectedGetReplications) WillDelay

WillDelay causes the call to GetReplications() to delay.

func (*ExpectedGetReplications) WillExecute

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 ...kivik.Option) *ExpectedGetReplications

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

type ExpectedGetRev

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

ExpectedGetRev represents an expectation for a call to DB.GetRev().

func (*ExpectedGetRev) String

func (e *ExpectedGetRev) String() string

func (*ExpectedGetRev) WillDelay

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

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

func (*ExpectedGetRev) WillExecute

func (e *ExpectedGetRev) WillExecute(cb func(ctx context.Context, arg0 string, options driver.Options) (string, error)) *ExpectedGetRev

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

func (*ExpectedGetRev) WillReturn

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

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

func (*ExpectedGetRev) WillReturnError

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

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

func (*ExpectedGetRev) WithDocID

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

WithDocID sets the expectation for the docID passed to the DB.GetRev call.

func (*ExpectedGetRev) WithOptions

func (e *ExpectedGetRev) WithOptions(options ...kivik.Option) *ExpectedGetRev

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

type ExpectedLocalDocs

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

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

func (*ExpectedLocalDocs) String

func (e *ExpectedLocalDocs) String() string

func (*ExpectedLocalDocs) WillDelay

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

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

func (*ExpectedLocalDocs) WillExecute

func (e *ExpectedLocalDocs) WillExecute(cb func(ctx context.Context, options driver.Options) (driver.Rows, error)) *ExpectedLocalDocs

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

func (*ExpectedLocalDocs) WillReturn

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

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

func (*ExpectedLocalDocs) WillReturnError

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

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

func (*ExpectedLocalDocs) WithOptions

func (e *ExpectedLocalDocs) WithOptions(options ...kivik.Option) *ExpectedLocalDocs

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

type ExpectedMembership

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

ExpectedMembership represents an expectation for a call to Membership().

func (*ExpectedMembership) String

func (e *ExpectedMembership) String() string

func (*ExpectedMembership) WillDelay

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

WillDelay causes the call to Membership() to delay.

func (*ExpectedMembership) WillExecute

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

func (*ExpectedMembership) WillReturn

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

func (*ExpectedMembership) WillReturnError

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

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

type ExpectedOpenRevs

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

ExpectedOpenRevs represents an expectation for a call to DB.OpenRevs().

func (*ExpectedOpenRevs) String

func (e *ExpectedOpenRevs) String() string

func (*ExpectedOpenRevs) WillDelay

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

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

func (*ExpectedOpenRevs) WillExecute

func (e *ExpectedOpenRevs) WillExecute(cb func(ctx context.Context, arg0 string, arg1 []string, options driver.Options) (driver.Rows, error)) *ExpectedOpenRevs

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

func (*ExpectedOpenRevs) WillReturn

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

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

func (*ExpectedOpenRevs) WillReturnError

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

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

func (*ExpectedOpenRevs) WithDocID

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

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

func (*ExpectedOpenRevs) WithOptions

func (e *ExpectedOpenRevs) WithOptions(options ...kivik.Option) *ExpectedOpenRevs

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

func (*ExpectedOpenRevs) WithRevs

func (e *ExpectedOpenRevs) WithRevs(revs []string) *ExpectedOpenRevs

WithRevs sets the expected revs for the DB.OpenRevs() call.

type ExpectedPartitionStats

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

ExpectedPartitionStats represents an expectation for a call to DB.PartitionStats().

func (*ExpectedPartitionStats) String

func (e *ExpectedPartitionStats) String() string

func (*ExpectedPartitionStats) WillDelay

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

func (*ExpectedPartitionStats) WillExecute

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

func (*ExpectedPartitionStats) WillReturn

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

func (*ExpectedPartitionStats) WillReturnError

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

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

func (*ExpectedPartitionStats) WithName

WithName sets the expectation for the partition name passed to the DB.PartitionStats() call.

type ExpectedPing

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

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

func (*ExpectedPing) String

func (e *ExpectedPing) String() string

func (*ExpectedPing) WillDelay

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

WillDelay causes the call to Ping() to delay.

func (*ExpectedPing) WillExecute

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

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

func (*ExpectedPing) WillReturn

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

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

func (*ExpectedPing) WillReturnError

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

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

type ExpectedPurge

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

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

func (*ExpectedPurge) String

func (e *ExpectedPurge) String() string

func (*ExpectedPurge) WillDelay

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

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

func (*ExpectedPurge) WillExecute

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

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

func (*ExpectedPurge) WillReturn

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

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

func (*ExpectedPurge) WillReturnError

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

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

func (*ExpectedPurge) WithDocRevMap

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

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

type ExpectedPut

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

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

func (*ExpectedPut) String

func (e *ExpectedPut) String() string

func (*ExpectedPut) WillDelay

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

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

func (*ExpectedPut) WillExecute

func (e *ExpectedPut) WillExecute(cb func(ctx context.Context, arg0 string, arg1 interface{}, options driver.Options) (string, error)) *ExpectedPut

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

func (*ExpectedPut) WillReturn

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

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

func (*ExpectedPut) WillReturnError

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

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

func (*ExpectedPut) WithDoc

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

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

func (*ExpectedPut) WithDocID

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

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

func (*ExpectedPut) WithOptions

func (e *ExpectedPut) WithOptions(options ...kivik.Option) *ExpectedPut

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

type ExpectedPutAttachment

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

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

func (*ExpectedPutAttachment) String

func (e *ExpectedPutAttachment) String() string

func (*ExpectedPutAttachment) WillDelay

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

func (*ExpectedPutAttachment) WillExecute

func (e *ExpectedPutAttachment) WillExecute(cb func(ctx context.Context, arg0 string, arg1 *driver.Attachment, options driver.Options) (string, error)) *ExpectedPutAttachment

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

func (*ExpectedPutAttachment) WillReturn

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

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

func (*ExpectedPutAttachment) WillReturnError

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

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

func (*ExpectedPutAttachment) WithAttachment

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

func (*ExpectedPutAttachment) WithDocID

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

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

func (*ExpectedPutAttachment) WithOptions

func (e *ExpectedPutAttachment) WithOptions(options ...kivik.Option) *ExpectedPutAttachment

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

type ExpectedQuery

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

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

func (*ExpectedQuery) String

func (e *ExpectedQuery) String() string

func (*ExpectedQuery) WillDelay

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

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

func (*ExpectedQuery) WillExecute

func (e *ExpectedQuery) WillExecute(cb func(ctx context.Context, arg0 string, arg1 string, options driver.Options) (driver.Rows, error)) *ExpectedQuery

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

func (*ExpectedQuery) WillReturn

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

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

func (*ExpectedQuery) WillReturnError

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

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

func (*ExpectedQuery) WithDDocID

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

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

func (*ExpectedQuery) WithOptions

func (e *ExpectedQuery) WithOptions(options ...kivik.Option) *ExpectedQuery

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

func (*ExpectedQuery) WithView

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

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

type ExpectedReplicate

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

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

func (*ExpectedReplicate) String

func (e *ExpectedReplicate) String() string

func (*ExpectedReplicate) WillDelay

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

WillDelay causes the call to Replicate() to delay.

func (*ExpectedReplicate) WillExecute

func (e *ExpectedReplicate) WillExecute(cb func(ctx context.Context, arg0 string, arg1 string, options driver.Options) (driver.Replication, error)) *ExpectedReplicate

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

func (*ExpectedReplicate) WillReturn

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

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

func (*ExpectedReplicate) WillReturnError

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

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

func (*ExpectedReplicate) WithOptions

func (e *ExpectedReplicate) WithOptions(options ...kivik.Option) *ExpectedReplicate

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

func (*ExpectedReplicate) WithSource

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

WithSource sets the expected source.

func (*ExpectedReplicate) WithTarget

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

WithTarget sets the expected target.

type ExpectedRevsDiff

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

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

func (*ExpectedRevsDiff) String

func (e *ExpectedRevsDiff) String() string

func (*ExpectedRevsDiff) WillDelay

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

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

func (*ExpectedRevsDiff) WillExecute

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

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

func (*ExpectedRevsDiff) WillReturn

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

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

func (*ExpectedRevsDiff) WillReturnError

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

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

func (*ExpectedRevsDiff) WithRevLookup

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

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

type ExpectedSecurity

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

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

func (*ExpectedSecurity) String

func (e *ExpectedSecurity) String() string

func (*ExpectedSecurity) WillDelay

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

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

func (*ExpectedSecurity) WillExecute

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

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

func (*ExpectedSecurity) WillReturn

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

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

func (*ExpectedSecurity) WillReturnError

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

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

type ExpectedSession

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

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

func (*ExpectedSession) String

func (e *ExpectedSession) String() string

func (*ExpectedSession) WillDelay

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

WillDelay causes the call to Session() to delay.

func (*ExpectedSession) WillExecute

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

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

func (*ExpectedSession) WillReturn

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

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

func (*ExpectedSession) WillReturnError

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

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

type ExpectedSetConfigValue

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

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

func (*ExpectedSetConfigValue) String

func (e *ExpectedSetConfigValue) String() string

func (*ExpectedSetConfigValue) WillDelay

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

WithKey sets the expected key.

func (*ExpectedSetConfigValue) WithNode

WithNode sets the expected node.

func (*ExpectedSetConfigValue) WithSection

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

WithSection sets the expected section.

func (*ExpectedSetConfigValue) WithValue

WithValue sets the expected value.

type ExpectedSetSecurity

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

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

func (*ExpectedSetSecurity) String

func (e *ExpectedSetSecurity) String() string

func (*ExpectedSetSecurity) WillDelay

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 Replication

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

Replication is a replication instance.

func (*Replication) EndTime

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

EndTime sets the replication end time.

func (*Replication) Err

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

Err sets the replication error.

func (*Replication) ID

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

ID sets the replication ID.

func (*Replication) MarshalJSON

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

MarshalJSON satisfies the json.Marshaler interface.

func (*Replication) Source

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

Source sets the replication source.

func (*Replication) StartTime

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

StartTime sets the replication start time.

func (*Replication) State

State sets the replication state.

func (*Replication) Target

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

Target sets the replication target.

type Rows

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

Rows is a mocked collection of rows.

func NewRows

func NewRows() *Rows

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

func (*Rows) 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.

func (*Updates) LastSeq added in v4.2.0

func (u *Updates) LastSeq(lastSeq string) *Updates

LastSeq sets the LastSeq value to be returned by the DBUpdates iterator.

func (*Updates) LastSeqError added in v4.2.0

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

LastSeqError sets the error value to be returned when LastSeq is called.

Directories

Path Synopsis
Package main generates the bulk of the mockdb driver.
Package main generates the bulk of the mockdb driver.

Jump to

Keyboard shortcuts

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