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.
func DocumentT(t *testing.T, i interface{}) *driver.Document
DocumentT calls Document, and passes any error to t.Fatal.
Changes is a mocked collection of Changes results.
type Changes struct {
// contains filtered or unexported fields
}
func NewChanges() *Changes
NewChanges returns a new, empty changes set, which can be returned by the DB.Changes() expectation.
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 (r *Changes) AddChangeError(err error) *Changes
AddChangeError adds an error to be returned during iteration.
func (r *Changes) AddDelay(delay time.Duration) *Changes
AddDelay adds a delay before the next iteration will complete.
func (i *Changes) Close() error
func (r *Changes) CloseError(err error) *Changes
CloseError sets an error to be returned when the iterator is closed.
func (r *Changes) ETag(etag string) *Changes
ETag sets the etag value to be returned by the changes iterator.
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 (r *Changes) LastSeq(seq string) *Changes
LastSeq sets the last_seq value to be returned by the changes iterator.
func (r *Changes) Pending(pending int64) *Changes
Pending sets the pending value to be returned by the changes iterator.
Client allows configuring the mock kivik client.
type Client struct {
// contains filtered or unexported fields
}
func New() (*kivik.Client, *Client, error)
New creates a kivik client connection and a mock to manage expectations.
func NewT(t *testing.T) (*kivik.Client, *Client)
NewT works exactly as New, except that any error will be passed to t.Fatal.
func (c *Client) ExpectAllDBs() *ExpectedAllDBs
ExpectAllDBs queues an expectation that AllDBs will be called.
func (c *Client) ExpectAllDBsStats() *ExpectedAllDBsStats
ExpectAllDBsStats queues an expectation that AllDBsStats will be called.
func (c *Client) ExpectClose() *ExpectedClose
ExpectClose queues an expectation that Close will be called.
func (c *Client) ExpectClusterSetup() *ExpectedClusterSetup
ExpectClusterSetup queues an expectation that ClusterSetup will be called.
func (c *Client) ExpectClusterStatus() *ExpectedClusterStatus
ExpectClusterStatus queues an expectation that ClusterStatus will be called.
func (c *Client) ExpectConfig() *ExpectedConfig
ExpectConfig queues an expectation that Config will be called.
func (c *Client) ExpectConfigSection() *ExpectedConfigSection
ExpectConfigSection queues an expectation that ConfigSection will be called.
func (c *Client) ExpectConfigValue() *ExpectedConfigValue
ExpectConfigValue queues an expectation that ConfigValue will be called.
func (c *Client) ExpectCreateDB() *ExpectedCreateDB
ExpectCreateDB queues an expectation for a CreateDB() call.
func (c *Client) ExpectDB() *ExpectedDB
ExpectDB queues an expectation that DB will be called.
func (c *Client) ExpectDBExists() *ExpectedDBExists
ExpectDBExists queues an expectation that DBExists will be called.
func (c *Client) ExpectDBUpdates() *ExpectedDBUpdates
ExpectDBUpdates queues an expectation that DBUpdates will be called.
func (c *Client) ExpectDBsStats() *ExpectedDBsStats
ExpectDBsStats queues an expectation that DBsStats will be called.
func (c *Client) ExpectDeleteConfigKey() *ExpectedDeleteConfigKey
ExpectDeleteConfigKey queues an expectation that DeleteConfigKey will be called.
func (c *Client) ExpectDestroyDB() *ExpectedDestroyDB
ExpectDestroyDB queues an expectation that DestroyDB will be called.
func (c *Client) ExpectGetReplications() *ExpectedGetReplications
ExpectGetReplications queues an expectation that GetReplications will be called.
func (c *Client) ExpectMembership() *ExpectedMembership
ExpectMembership queues an expectation that Membership will be called.
func (c *Client) ExpectPing() *ExpectedPing
ExpectPing queues an expectation that Ping will be called.
func (c *Client) ExpectReplicate() *ExpectedReplicate
ExpectReplicate queues an expectation that Replicate will be called.
func (c *Client) ExpectSession() *ExpectedSession
ExpectSession queues an expectation that Session will be called.
func (c *Client) ExpectSetConfigValue() *ExpectedSetConfigValue
ExpectSetConfigValue queues an expectation that SetConfigValue will be called.
func (c *Client) ExpectVersion() *ExpectedVersion
ExpectVersion queues an expectation that Version will be called.
func (c *Client) ExpectationsWereMet() error
ExpectationsWereMet returns an error if any outstanding expectations were not met.
func (c *Client) MatchExpectationsInOrder(b bool)
MatchExpectationsInOrder sets whether expectations should occur in the precise order in which they were defined.
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 (c *Client) NewReplication() *Replication
NewReplication returns a new, empty Replication.
DB serves to create expectations for database actions to mock and test real database behavior.
type DB struct {
// contains filtered or unexported fields
}
func (db *DB) ExpectAllDocs() *ExpectedAllDocs
ExpectAllDocs queues an expectation that DB.AllDocs will be called.
func (db *DB) ExpectBulkDocs() *ExpectedBulkDocs
ExpectBulkDocs queues an expectation that DB.BulkDocs will be called.
func (db *DB) ExpectBulkGet() *ExpectedBulkGet
ExpectBulkGet queues an expectation that DB.BulkGet will be called.
func (db *DB) ExpectChanges() *ExpectedChanges
ExpectChanges queues an expectation that DB.Changes will be called.
func (db *DB) ExpectClose() *ExpectedDBClose
ExpectClose queues an expectation for DB.Close() to be called.
func (db *DB) ExpectCompact() *ExpectedCompact
ExpectCompact queues an expectation that DB.Compact will be called.
func (db *DB) ExpectCompactView() *ExpectedCompactView
ExpectCompactView queues an expectation that DB.CompactView will be called.
func (db *DB) ExpectCopy() *ExpectedCopy
ExpectCopy queues an expectation that DB.Copy will be called.
func (db *DB) ExpectCreateDoc() *ExpectedCreateDoc
ExpectCreateDoc queues an expectation that DB.CreateDoc will be called.
func (db *DB) ExpectCreateIndex() *ExpectedCreateIndex
ExpectCreateIndex queues an expectation that DB.CreateIndex will be called.
func (db *DB) ExpectDelete() *ExpectedDelete
ExpectDelete queues an expectation that DB.Delete will be called.
func (db *DB) ExpectDeleteAttachment() *ExpectedDeleteAttachment
ExpectDeleteAttachment queues an expectation that DB.DeleteAttachment will be called.
func (db *DB) ExpectDeleteIndex() *ExpectedDeleteIndex
ExpectDeleteIndex queues an expectation that DB.DeleteIndex will be called.
func (db *DB) ExpectDesignDocs() *ExpectedDesignDocs
ExpectDesignDocs queues an expectation that DB.DesignDocs will be called.
func (db *DB) ExpectExplain() *ExpectedExplain
ExpectExplain queues an expectation that DB.Explain will be called.
func (db *DB) ExpectFind() *ExpectedFind
ExpectFind queues an expectation that DB.Find will be called.
func (db *DB) ExpectFlush() *ExpectedFlush
ExpectFlush queues an expectation that DB.Flush will be called.
func (db *DB) ExpectGet() *ExpectedGet
ExpectGet queues an expectation that DB.Get will be called.
func (db *DB) ExpectGetAttachment() *ExpectedGetAttachment
ExpectGetAttachment queues an expectation that DB.GetAttachment will be called.
func (db *DB) ExpectGetAttachmentMeta() *ExpectedGetAttachmentMeta
ExpectGetAttachmentMeta queues an expectation that DB.GetAttachmentMeta will be called.
func (db *DB) ExpectGetIndexes() *ExpectedGetIndexes
ExpectGetIndexes queues an expectation that DB.GetIndexes will be called.
func (db *DB) ExpectGetRev() *ExpectedGetRev
ExpectGetRev queues an expectation that DB.GetRev will be called.
func (db *DB) ExpectLocalDocs() *ExpectedLocalDocs
ExpectLocalDocs queues an expectation that DB.LocalDocs will be called.
func (db *DB) ExpectOpenRevs() *ExpectedOpenRevs
ExpectOpenRevs queues an expectation that DB.OpenRevs will be called.
func (db *DB) ExpectPartitionStats() *ExpectedPartitionStats
ExpectPartitionStats queues an expectation that DB.PartitionStats will be called.
func (db *DB) ExpectPurge() *ExpectedPurge
ExpectPurge queues an expectation that DB.Purge will be called.
func (db *DB) ExpectPut() *ExpectedPut
ExpectPut queues an expectation that DB.Put will be called.
func (db *DB) ExpectPutAttachment() *ExpectedPutAttachment
ExpectPutAttachment queues an expectation that DB.PutAttachment will be called.
func (db *DB) ExpectQuery() *ExpectedQuery
ExpectQuery queues an expectation that DB.Query will be called.
func (db *DB) ExpectRevsDiff() *ExpectedRevsDiff
ExpectRevsDiff queues an expectation that DB.RevsDiff will be called.
func (db *DB) ExpectSecurity() *ExpectedSecurity
ExpectSecurity queues an expectation that DB.Security will be called.
func (db *DB) ExpectSetSecurity() *ExpectedSetSecurity
ExpectSetSecurity queues an expectation that DB.SetSecurity will be called.
func (db *DB) ExpectStats() *ExpectedStats
ExpectStats queues an expectation that DB.Stats will be called.
func (db *DB) ExpectViewCleanup() *ExpectedViewCleanup
ExpectViewCleanup queues an expectation that DB.ViewCleanup will be called.
ExpectedAllDBs represents an expectation for a call to AllDBs().
type ExpectedAllDBs struct {
// contains filtered or unexported fields
}
func (e *ExpectedAllDBs) String() string
String satisfies the fmt.Stringer interface.
func (e *ExpectedAllDBs) WillDelay(delay time.Duration) *ExpectedAllDBs
WillDelay causes the call to AllDBs() to delay.
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 (e *ExpectedAllDBs) WillReturn(ret0 []string) *ExpectedAllDBs
WillReturn sets the values that will be returned by the call to AllDBs().
func (e *ExpectedAllDBs) WillReturnError(err error) *ExpectedAllDBs
WillReturnError sets the error value that will be returned by the call to AllDBs().
func (e *ExpectedAllDBs) WithOptions(options ...kivik.Option) *ExpectedAllDBs
WithOptions sets the expected options for the call to AllDBs().
ExpectedAllDBsStats represents an expectation for a call to AllDBsStats().
type ExpectedAllDBsStats struct {
// contains filtered or unexported fields
}
func (e *ExpectedAllDBsStats) String() string
func (e *ExpectedAllDBsStats) WillDelay(delay time.Duration) *ExpectedAllDBsStats
WillDelay causes the call to AllDBsStats() to delay.
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 (e *ExpectedAllDBsStats) WillReturn(ret0 []*driver.DBStats) *ExpectedAllDBsStats
WillReturn sets the values that will be returned by the call to AllDBsStats().
func (e *ExpectedAllDBsStats) WillReturnError(err error) *ExpectedAllDBsStats
WillReturnError sets the error value that will be returned by the call to AllDBsStats().
func (e *ExpectedAllDBsStats) WithOptions(options ...kivik.Option) *ExpectedAllDBsStats
WithOptions sets the expected options for the call to AllDBsStats().
ExpectedAllDocs represents an expectation for a call to DB.AllDocs().
type ExpectedAllDocs struct {
// contains filtered or unexported fields
}
func (e *ExpectedAllDocs) String() string
func (e *ExpectedAllDocs) WillDelay(delay time.Duration) *ExpectedAllDocs
WillDelay causes the call to DB.AllDocs() to delay.
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 (e *ExpectedAllDocs) WillReturn(ret0 *Rows) *ExpectedAllDocs
WillReturn sets the values that will be returned by the call to DB.AllDocs().
func (e *ExpectedAllDocs) WillReturnError(err error) *ExpectedAllDocs
WillReturnError sets the error value that will be returned by the call to DB.AllDocs().
func (e *ExpectedAllDocs) WithOptions(options ...kivik.Option) *ExpectedAllDocs
WithOptions sets the expected options for the call to DB.AllDocs().
ExpectedBulkDocs represents an expectation for a call to DB.BulkDocs().
type ExpectedBulkDocs struct {
// contains filtered or unexported fields
}
func (e *ExpectedBulkDocs) String() string
func (e *ExpectedBulkDocs) WillDelay(delay time.Duration) *ExpectedBulkDocs
WillDelay causes the call to DB.BulkDocs() to delay.
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 (e *ExpectedBulkDocs) WillReturn(ret0 []driver.BulkResult) *ExpectedBulkDocs
WillReturn sets the values that will be returned by the call to DB.BulkDocs().
func (e *ExpectedBulkDocs) WillReturnError(err error) *ExpectedBulkDocs
WillReturnError sets the error value that will be returned by the call to DB.BulkDocs().
func (e *ExpectedBulkDocs) WithOptions(options ...kivik.Option) *ExpectedBulkDocs
WithOptions sets the expected options for the call to DB.BulkDocs().
ExpectedBulkGet represents an expectation for a call to DB.BulkGet().
type ExpectedBulkGet struct {
// contains filtered or unexported fields
}
func (e *ExpectedBulkGet) String() string
func (e *ExpectedBulkGet) WillDelay(delay time.Duration) *ExpectedBulkGet
WillDelay causes the call to DB.BulkGet() to delay.
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 (e *ExpectedBulkGet) WillReturn(ret0 *Rows) *ExpectedBulkGet
WillReturn sets the values that will be returned by the call to DB.BulkGet().
func (e *ExpectedBulkGet) WillReturnError(err error) *ExpectedBulkGet
WillReturnError sets the error value that will be returned by the call to DB.BulkGet().
func (e *ExpectedBulkGet) WithOptions(options ...kivik.Option) *ExpectedBulkGet
WithOptions sets the expected options for the call to DB.BulkGet().
ExpectedChanges represents an expectation for a call to DB.Changes().
type ExpectedChanges struct {
// contains filtered or unexported fields
}
func (e *ExpectedChanges) String() string
func (e *ExpectedChanges) WillDelay(delay time.Duration) *ExpectedChanges
WillDelay causes the call to DB.Changes() to delay.
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 (e *ExpectedChanges) WillReturn(ret0 *Changes) *ExpectedChanges
WillReturn sets the values that will be returned by the call to DB.Changes().
func (e *ExpectedChanges) WillReturnError(err error) *ExpectedChanges
WillReturnError sets the error value that will be returned by the call to DB.Changes().
func (e *ExpectedChanges) WithOptions(options ...kivik.Option) *ExpectedChanges
WithOptions sets the expected options for the call to DB.Changes().
ExpectedClose represents an expectation for a call to Close().
type ExpectedClose struct {
// contains filtered or unexported fields
}
func (e *ExpectedClose) String() string
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 (e *ExpectedClose) WillReturnError(err error) *ExpectedClose
WillReturnError sets the error value that will be returned by the call to Close().
ExpectedClusterSetup represents an expectation for a call to ClusterSetup().
type ExpectedClusterSetup struct {
// contains filtered or unexported fields
}
func (e *ExpectedClusterSetup) String() string
func (e *ExpectedClusterSetup) WillDelay(delay time.Duration) *ExpectedClusterSetup
WillDelay causes the call to ClusterSetup() to delay.
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 (e *ExpectedClusterSetup) WillReturnError(err error) *ExpectedClusterSetup
WillReturnError sets the error value that will be returned by the call to ClusterSetup().
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.
ExpectedClusterStatus represents an expectation for a call to ClusterStatus().
type ExpectedClusterStatus struct {
// contains filtered or unexported fields
}
func (e *ExpectedClusterStatus) String() string
String satisfies the fmt.Stringer interface
func (e *ExpectedClusterStatus) WillDelay(delay time.Duration) *ExpectedClusterStatus
WillDelay causes the call to ClusterStatus() to delay.
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 (e *ExpectedClusterStatus) WillReturn(ret0 string) *ExpectedClusterStatus
WillReturn sets the values that will be returned by the call to ClusterStatus().
func (e *ExpectedClusterStatus) WillReturnError(err error) *ExpectedClusterStatus
WillReturnError sets the error value that will be returned by the call to ClusterStatus().
func (e *ExpectedClusterStatus) WithOptions(options ...kivik.Option) *ExpectedClusterStatus
WithOptions sets the expected options for the call to ClusterStatus().
ExpectedCompact represents an expectation for a call to DB.Compact().
type ExpectedCompact struct {
// contains filtered or unexported fields
}
func (e *ExpectedCompact) String() string
func (e *ExpectedCompact) WillDelay(delay time.Duration) *ExpectedCompact
WillDelay causes the call to DB.Compact() to delay.
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 (e *ExpectedCompact) WillReturnError(err error) *ExpectedCompact
WillReturnError sets the error value that will be returned by the call to DB.Compact().
ExpectedCompactView represents an expectation for a call to DB.CompactView().
type ExpectedCompactView struct {
// contains filtered or unexported fields
}
func (e *ExpectedCompactView) String() string
func (e *ExpectedCompactView) WillDelay(delay time.Duration) *ExpectedCompactView
WillDelay causes the call to DB.CompactView() to delay.
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 (e *ExpectedCompactView) WillReturnError(err error) *ExpectedCompactView
WillReturnError sets the error value that will be returned by the call to DB.CompactView().
func (e *ExpectedCompactView) WithDDoc(ddocID string) *ExpectedCompactView
WithDDoc sets the expected design doc name for the call to DB.CompactView().
ExpectedConfig represents an expectation for a call to Config().
type ExpectedConfig struct {
// contains filtered or unexported fields
}
func (e *ExpectedConfig) String() string
func (e *ExpectedConfig) WillDelay(delay time.Duration) *ExpectedConfig
WillDelay causes the call to Config() to delay.
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 (e *ExpectedConfig) WillReturn(ret0 driver.Config) *ExpectedConfig
WillReturn sets the values that will be returned by the call to Config().
func (e *ExpectedConfig) WillReturnError(err error) *ExpectedConfig
WillReturnError sets the error value that will be returned by the call to Config().
func (e *ExpectedConfig) WithNode(node string) *ExpectedConfig
WithNode sets the expected node.
ExpectedConfigSection represents an expectation for a call to ConfigSection().
type ExpectedConfigSection struct {
// contains filtered or unexported fields
}
func (e *ExpectedConfigSection) String() string
func (e *ExpectedConfigSection) WillDelay(delay time.Duration) *ExpectedConfigSection
WillDelay causes the call to ConfigSection() to delay.
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 (e *ExpectedConfigSection) WillReturn(ret0 driver.ConfigSection) *ExpectedConfigSection
WillReturn sets the values that will be returned by the call to ConfigSection().
func (e *ExpectedConfigSection) WillReturnError(err error) *ExpectedConfigSection
WillReturnError sets the error value that will be returned by the call to ConfigSection().
func (e *ExpectedConfigSection) WithNode(node string) *ExpectedConfigSection
WithNode sets the expected node.
func (e *ExpectedConfigSection) WithSection(section string) *ExpectedConfigSection
WithSection sets the expected section.
ExpectedConfigValue represents an expectation for a call to ConfigValue().
type ExpectedConfigValue struct {
// contains filtered or unexported fields
}
func (e *ExpectedConfigValue) String() string
func (e *ExpectedConfigValue) WillDelay(delay time.Duration) *ExpectedConfigValue
WillDelay causes the call to ConfigValue() to delay.
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 (e *ExpectedConfigValue) WillReturn(ret0 string) *ExpectedConfigValue
WillReturn sets the values that will be returned by the call to ConfigValue().
func (e *ExpectedConfigValue) WillReturnError(err error) *ExpectedConfigValue
WillReturnError sets the error value that will be returned by the call to ConfigValue().
func (e *ExpectedConfigValue) WithKey(key string) *ExpectedConfigValue
WithKey sets the expected key.
func (e *ExpectedConfigValue) WithNode(node string) *ExpectedConfigValue
WithNode sets the expected node.
func (e *ExpectedConfigValue) WithSection(section string) *ExpectedConfigValue
WithSection sets the expected section.
ExpectedCopy represents an expectation for a call to DB.Copy().
type ExpectedCopy struct {
// contains filtered or unexported fields
}
func (e *ExpectedCopy) String() string
func (e *ExpectedCopy) WillDelay(delay time.Duration) *ExpectedCopy
WillDelay causes the call to DB.Copy() to delay.
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 (e *ExpectedCopy) WillReturn(ret0 string) *ExpectedCopy
WillReturn sets the values that will be returned by the call to DB.Copy().
func (e *ExpectedCopy) WillReturnError(err error) *ExpectedCopy
WillReturnError sets the error value that will be returned by the call to DB.Copy().
func (e *ExpectedCopy) WithOptions(options ...kivik.Option) *ExpectedCopy
WithOptions sets the expected options for the call to DB.Copy().
func (e *ExpectedCopy) WithSourceID(docID string) *ExpectedCopy
WithSourceID sets the expectation for the docID passed to the DB.Copy() call.
func (e *ExpectedCopy) WithTargetID(docID string) *ExpectedCopy
WithTargetID sets the expectation for the docID passed to the DB.Copy() call.
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.
type ExpectedCreateDB struct {
// contains filtered or unexported fields
}
func (e *ExpectedCreateDB) String() string
func (e *ExpectedCreateDB) WillDelay(delay time.Duration) *ExpectedCreateDB
WillDelay will cause execution of DB() to delay by duration d.
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 (e *ExpectedCreateDB) WillReturnError(err error) *ExpectedCreateDB
WillReturnError sets the return value for the DB() call.
func (e *ExpectedCreateDB) WithName(name string) *ExpectedCreateDB
WithName sets the expectation that DB() will be called with this name.
func (e *ExpectedCreateDB) WithOptions(options ...kivik.Option) *ExpectedCreateDB
WithOptions set the expectation that DB() will be called with these options.
ExpectedCreateDoc represents an expectation for a call to DB.CreateDoc().
type ExpectedCreateDoc struct {
// contains filtered or unexported fields
}
func (e *ExpectedCreateDoc) String() string
func (e *ExpectedCreateDoc) WillDelay(delay time.Duration) *ExpectedCreateDoc
WillDelay causes the call to DB.CreateDoc() to delay.
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 (e *ExpectedCreateDoc) WillReturn(ret0 string, ret1 string) *ExpectedCreateDoc
WillReturn sets the values that will be returned by the call to DB.CreateDoc().
func (e *ExpectedCreateDoc) WillReturnError(err error) *ExpectedCreateDoc
WillReturnError sets the error value that will be returned by the call to DB.CreateDoc().
func (e *ExpectedCreateDoc) WithDoc(doc interface{}) *ExpectedCreateDoc
WithDoc sets the expected doc for the call to CreateDoc().
func (e *ExpectedCreateDoc) WithOptions(options ...kivik.Option) *ExpectedCreateDoc
WithOptions sets the expected options for the call to DB.CreateDoc().
ExpectedCreateIndex represents an expectation for a call to DB.CreateIndex().
type ExpectedCreateIndex struct {
// contains filtered or unexported fields
}
func (e *ExpectedCreateIndex) String() string
func (e *ExpectedCreateIndex) WillDelay(delay time.Duration) *ExpectedCreateIndex
WillDelay causes the call to DB.CreateIndex() to delay.
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 (e *ExpectedCreateIndex) WillReturnError(err error) *ExpectedCreateIndex
WillReturnError sets the error value that will be returned by the call to DB.CreateIndex().
func (e *ExpectedCreateIndex) WithDDocID(ddocID string) *ExpectedCreateIndex
WithDDocID sets the expected ddocID value for the DB.CreateIndex() call.
func (e *ExpectedCreateIndex) WithIndex(index interface{}) *ExpectedCreateIndex
WithIndex sets the expected index value for the DB.CreateIndex() call.
func (e *ExpectedCreateIndex) WithName(name string) *ExpectedCreateIndex
WithName sets the expected name value for the DB.CreateIndex() call.
func (e *ExpectedCreateIndex) WithOptions(options ...kivik.Option) *ExpectedCreateIndex
WithOptions sets the expected options for the call to DB.CreateIndex().
ExpectedDB represents an expectation for a call to DB().
type ExpectedDB struct {
// contains filtered or unexported fields
}
func (e *ExpectedDB) String() string
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 (e *ExpectedDB) WillReturn(ret0 *DB) *ExpectedDB
WillReturn sets the values that will be returned by the call to DB().
func (e *ExpectedDB) WillReturnError(err error) *ExpectedDB
WillReturnError sets the error value that will be returned by the call to DB().
func (e *ExpectedDB) WithName(name string) *ExpectedDB
WithName sets the expectation that DB() will be called with this name.
func (e *ExpectedDB) WithOptions(options ...kivik.Option) *ExpectedDB
WithOptions sets the expected options for the call to DB().
ExpectedDBClose is used to manage *kivik.Client.Close expectation returned by Mock.ExpectClose.
type ExpectedDBClose struct {
// contains filtered or unexported fields
}
func (e *ExpectedDBClose) String() string
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 (e *ExpectedDBClose) WillReturnError(err error) *ExpectedDBClose
WillReturnError allows setting an error for *kivik.Client.Close action.
ExpectedDBExists represents an expectation for a call to DBExists().
type ExpectedDBExists struct {
// contains filtered or unexported fields
}
func (e *ExpectedDBExists) String() string
func (e *ExpectedDBExists) WillDelay(delay time.Duration) *ExpectedDBExists
WillDelay causes the call to DBExists() to delay.
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 (e *ExpectedDBExists) WillReturn(ret0 bool) *ExpectedDBExists
WillReturn sets the values that will be returned by the call to DBExists().
func (e *ExpectedDBExists) WillReturnError(err error) *ExpectedDBExists
WillReturnError sets the error value that will be returned by the call to DBExists().
func (e *ExpectedDBExists) WithName(name string) *ExpectedDBExists
WithName sets the expectation that DBExists will be called with the provided name.
func (e *ExpectedDBExists) WithOptions(options ...kivik.Option) *ExpectedDBExists
WithOptions sets the expected options for the call to DBExists().
ExpectedDBUpdates represents an expectation for a call to DBUpdates().
type ExpectedDBUpdates struct {
// contains filtered or unexported fields
}
func (e *ExpectedDBUpdates) String() string
func (e *ExpectedDBUpdates) WillDelay(delay time.Duration) *ExpectedDBUpdates
WillDelay causes the call to DBUpdates() to delay.
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 (e *ExpectedDBUpdates) WillReturn(ret0 *Updates) *ExpectedDBUpdates
WillReturn sets the values that will be returned by the call to DBUpdates().
func (e *ExpectedDBUpdates) WillReturnError(err error) *ExpectedDBUpdates
WillReturnError sets the error value that will be returned by the call to DBUpdates().
func (e *ExpectedDBUpdates) WithOptions(options ...kivik.Option) *ExpectedDBUpdates
WithOptions sets the expected options for the call to DBUpdates().
ExpectedDBsStats represents an expectation for a call to DBsStats().
type ExpectedDBsStats struct {
// contains filtered or unexported fields
}
func (e *ExpectedDBsStats) String() string
func (e *ExpectedDBsStats) WillDelay(delay time.Duration) *ExpectedDBsStats
WillDelay causes the call to DBsStats() to delay.
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 (e *ExpectedDBsStats) WillReturn(ret0 []*driver.DBStats) *ExpectedDBsStats
WillReturn sets the values that will be returned by the call to DBsStats().
func (e *ExpectedDBsStats) WillReturnError(err error) *ExpectedDBsStats
WillReturnError sets the error value that will be returned by the call to DBsStats().
func (e *ExpectedDBsStats) WithNames(names []string) *ExpectedDBsStats
WithNames sets the expectation that DBsStats will be called with these names.
ExpectedDelete represents an expectation for a call to DB.Delete().
type ExpectedDelete struct {
// contains filtered or unexported fields
}
func (e *ExpectedDelete) String() string
func (e *ExpectedDelete) WillDelay(delay time.Duration) *ExpectedDelete
WillDelay causes the call to DB.Delete() to delay.
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 (e *ExpectedDelete) WillReturn(ret0 string) *ExpectedDelete
WillReturn sets the values that will be returned by the call to DB.Delete().
func (e *ExpectedDelete) WillReturnError(err error) *ExpectedDelete
WillReturnError sets the error value that will be returned by the call to DB.Delete().
func (e *ExpectedDelete) WithDocID(docID string) *ExpectedDelete
WithDocID sets the expectation for the docID passed to the DB.Delete() call.
func (e *ExpectedDelete) WithOptions(options ...kivik.Option) *ExpectedDelete
WithOptions sets the expected options for the call to DB.Delete().
ExpectedDeleteAttachment represents an expectation for a call to DB.DeleteAttachment().
type ExpectedDeleteAttachment struct {
// contains filtered or unexported fields
}
func (e *ExpectedDeleteAttachment) String() string
func (e *ExpectedDeleteAttachment) WillDelay(delay time.Duration) *ExpectedDeleteAttachment
WillDelay causes the call to DB.DeleteAttachment() to delay.
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 (e *ExpectedDeleteAttachment) WillReturn(ret0 string) *ExpectedDeleteAttachment
WillReturn sets the values that will be returned by the call to DB.DeleteAttachment().
func (e *ExpectedDeleteAttachment) WillReturnError(err error) *ExpectedDeleteAttachment
WillReturnError sets the error value that will be returned by the call to DB.DeleteAttachment().
func (e *ExpectedDeleteAttachment) WithDocID(docID string) *ExpectedDeleteAttachment
WithDocID sets the expectation for the docID passed to the DB.DeleteAttachment() call.
func (e *ExpectedDeleteAttachment) WithFilename(filename string) *ExpectedDeleteAttachment
WithFilename sets the expectation for the filename passed to the DB.DeleteAttachment() call.
func (e *ExpectedDeleteAttachment) WithOptions(options ...kivik.Option) *ExpectedDeleteAttachment
WithOptions sets the expected options for the call to DB.DeleteAttachment().
ExpectedDeleteConfigKey represents an expectation for a call to DeleteConfigKey().
type ExpectedDeleteConfigKey struct {
// contains filtered or unexported fields
}
func (e *ExpectedDeleteConfigKey) String() string
func (e *ExpectedDeleteConfigKey) WillDelay(delay time.Duration) *ExpectedDeleteConfigKey
WillDelay causes the call to DeleteConfigKey() to delay.
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 (e *ExpectedDeleteConfigKey) WillReturn(ret0 string) *ExpectedDeleteConfigKey
WillReturn sets the values that will be returned by the call to DeleteConfigKey().
func (e *ExpectedDeleteConfigKey) WillReturnError(err error) *ExpectedDeleteConfigKey
WillReturnError sets the error value that will be returned by the call to DeleteConfigKey().
func (e *ExpectedDeleteConfigKey) WithKey(key string) *ExpectedDeleteConfigKey
WithKey sets the expected key.
func (e *ExpectedDeleteConfigKey) WithNode(node string) *ExpectedDeleteConfigKey
WithNode sets the expected node.
func (e *ExpectedDeleteConfigKey) WithSection(section string) *ExpectedDeleteConfigKey
WithSection sets the expected section.
ExpectedDeleteIndex represents an expectation for a call to DB.DeleteIndex().
type ExpectedDeleteIndex struct {
// contains filtered or unexported fields
}
func (e *ExpectedDeleteIndex) String() string
func (e *ExpectedDeleteIndex) WillDelay(delay time.Duration) *ExpectedDeleteIndex
WillDelay causes the call to DB.DeleteIndex() to delay.
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 (e *ExpectedDeleteIndex) WillReturnError(err error) *ExpectedDeleteIndex
WillReturnError sets the error value that will be returned by the call to DB.DeleteIndex().
func (e *ExpectedDeleteIndex) WithDDoc(ddoc string) *ExpectedDeleteIndex
WithDDoc sets the expected ddoc to be passed to the DB.DeleteIndex() call.
func (e *ExpectedDeleteIndex) WithName(name string) *ExpectedDeleteIndex
WithName sets the expected name to be passed to the DB.DeleteIndex() call.
func (e *ExpectedDeleteIndex) WithOptions(options ...kivik.Option) *ExpectedDeleteIndex
WithOptions sets the expected options for the call to DB.DeleteIndex().
ExpectedDesignDocs represents an expectation for a call to DB.DesignDocs().
type ExpectedDesignDocs struct {
// contains filtered or unexported fields
}
func (e *ExpectedDesignDocs) String() string
func (e *ExpectedDesignDocs) WillDelay(delay time.Duration) *ExpectedDesignDocs
WillDelay causes the call to DB.DesignDocs() to delay.
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 (e *ExpectedDesignDocs) WillReturn(ret0 *Rows) *ExpectedDesignDocs
WillReturn sets the values that will be returned by the call to DB.DesignDocs().
func (e *ExpectedDesignDocs) WillReturnError(err error) *ExpectedDesignDocs
WillReturnError sets the error value that will be returned by the call to DB.DesignDocs().
func (e *ExpectedDesignDocs) WithOptions(options ...kivik.Option) *ExpectedDesignDocs
WithOptions sets the expected options for the call to DB.DesignDocs().
ExpectedDestroyDB represents an expectation for a call to DestroyDB().
type ExpectedDestroyDB struct {
// contains filtered or unexported fields
}
func (e *ExpectedDestroyDB) String() string
func (e *ExpectedDestroyDB) WillDelay(delay time.Duration) *ExpectedDestroyDB
WillDelay causes the call to DestroyDB() to delay.
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 (e *ExpectedDestroyDB) WillReturnError(err error) *ExpectedDestroyDB
WillReturnError sets the error value that will be returned by the call to DestroyDB().
func (e *ExpectedDestroyDB) WithName(name string) *ExpectedDestroyDB
WithName sets the expectation that DestroyDB will be called with this name.
func (e *ExpectedDestroyDB) WithOptions(options ...kivik.Option) *ExpectedDestroyDB
WithOptions sets the expected options for the call to DestroyDB().
ExpectedExplain represents an expectation for a call to DB.Explain().
type ExpectedExplain struct {
// contains filtered or unexported fields
}
func (e *ExpectedExplain) String() string
func (e *ExpectedExplain) WillDelay(delay time.Duration) *ExpectedExplain
WillDelay causes the call to DB.Explain() to delay.
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 (e *ExpectedExplain) WillReturn(ret0 *driver.QueryPlan) *ExpectedExplain
WillReturn sets the values that will be returned by the call to DB.Explain().
func (e *ExpectedExplain) WillReturnError(err error) *ExpectedExplain
WillReturnError sets the error value that will be returned by the call to DB.Explain().
func (e *ExpectedExplain) WithOptions(options ...kivik.Option) *ExpectedExplain
WithOptions sets the expected options for the call to DB.Explain().
func (e *ExpectedExplain) WithQuery(query interface{}) *ExpectedExplain
WithQuery sets the expected query for the Explain() call.
ExpectedFind represents an expectation for a call to DB.Find().
type ExpectedFind struct {
// contains filtered or unexported fields
}
func (e *ExpectedFind) String() string
func (e *ExpectedFind) WillDelay(delay time.Duration) *ExpectedFind
WillDelay causes the call to DB.Find() to delay.
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 (e *ExpectedFind) WillReturn(ret0 *Rows) *ExpectedFind
WillReturn sets the values that will be returned by the call to DB.Find().
func (e *ExpectedFind) WillReturnError(err error) *ExpectedFind
WillReturnError sets the error value that will be returned by the call to DB.Find().
func (e *ExpectedFind) WithOptions(options ...kivik.Option) *ExpectedFind
WithOptions sets the expected options for the call to DB.Find().
func (e *ExpectedFind) WithQuery(query interface{}) *ExpectedFind
WithQuery sets the expected query for the Find() call.
ExpectedFlush represents an expectation for a call to DB.Flush().
type ExpectedFlush struct {
// contains filtered or unexported fields
}
func (e *ExpectedFlush) String() string
func (e *ExpectedFlush) WillDelay(delay time.Duration) *ExpectedFlush
WillDelay causes the call to DB.Flush() to delay.
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 (e *ExpectedFlush) WillReturnError(err error) *ExpectedFlush
WillReturnError sets the error value that will be returned by the call to DB.Flush().
ExpectedGet represents an expectation for a call to DB.Get().
type ExpectedGet struct {
// contains filtered or unexported fields
}
func (e *ExpectedGet) String() string
func (e *ExpectedGet) WillDelay(delay time.Duration) *ExpectedGet
WillDelay causes the call to DB.Get() to delay.
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 (e *ExpectedGet) WillReturn(ret0 *driver.Document) *ExpectedGet
WillReturn sets the values that will be returned by the call to DB.Get().
func (e *ExpectedGet) WillReturnError(err error) *ExpectedGet
WillReturnError sets the error value that will be returned by the call to DB.Get().
func (e *ExpectedGet) WithDocID(docID string) *ExpectedGet
WithDocID sets the expected docID for the DB.Get() call.
func (e *ExpectedGet) WithOptions(options ...kivik.Option) *ExpectedGet
WithOptions sets the expected options for the call to DB.Get().
ExpectedGetAttachment represents an expectation for a call to DB.GetAttachment().
type ExpectedGetAttachment struct {
// contains filtered or unexported fields
}
func (e *ExpectedGetAttachment) String() string
func (e *ExpectedGetAttachment) WillDelay(delay time.Duration) *ExpectedGetAttachment
WillDelay causes the call to DB.GetAttachment() to delay.
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 (e *ExpectedGetAttachment) WillReturn(ret0 *driver.Attachment) *ExpectedGetAttachment
WillReturn sets the values that will be returned by the call to DB.GetAttachment().
func (e *ExpectedGetAttachment) WillReturnError(err error) *ExpectedGetAttachment
WillReturnError sets the error value that will be returned by the call to DB.GetAttachment().
func (e *ExpectedGetAttachment) WithDocID(docID string) *ExpectedGetAttachment
WithDocID sets the expectation for the docID passed to the DB.GetAttachment() call.
func (e *ExpectedGetAttachment) WithFilename(docID string) *ExpectedGetAttachment
WithFilename sets the expectation for the filename passed to the DB.GetAttachment() call.
func (e *ExpectedGetAttachment) WithOptions(options ...kivik.Option) *ExpectedGetAttachment
WithOptions sets the expected options for the call to DB.GetAttachment().
ExpectedGetAttachmentMeta represents an expectation for a call to DB.GetAttachmentMeta().
type ExpectedGetAttachmentMeta struct {
// contains filtered or unexported fields
}
func (e *ExpectedGetAttachmentMeta) String() string
func (e *ExpectedGetAttachmentMeta) WillDelay(delay time.Duration) *ExpectedGetAttachmentMeta
WillDelay causes the call to DB.GetAttachmentMeta() to delay.
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 (e *ExpectedGetAttachmentMeta) WillReturn(ret0 *driver.Attachment) *ExpectedGetAttachmentMeta
WillReturn sets the values that will be returned by the call to DB.GetAttachmentMeta().
func (e *ExpectedGetAttachmentMeta) WillReturnError(err error) *ExpectedGetAttachmentMeta
WillReturnError sets the error value that will be returned by the call to DB.GetAttachmentMeta().
func (e *ExpectedGetAttachmentMeta) WithDocID(docID string) *ExpectedGetAttachmentMeta
WithDocID sets the expectation for the docID passed to the DB.GetAttachmentMeta() call.
func (e *ExpectedGetAttachmentMeta) WithFilename(filename string) *ExpectedGetAttachmentMeta
WithFilename sets the expectation for the doc passed to the DB.GetAttachmentMeta() call.
func (e *ExpectedGetAttachmentMeta) WithOptions(options ...kivik.Option) *ExpectedGetAttachmentMeta
WithOptions sets the expected options for the call to DB.GetAttachmentMeta().
ExpectedGetIndexes represents an expectation for a call to DB.GetIndexes().
type ExpectedGetIndexes struct {
// contains filtered or unexported fields
}
func (e *ExpectedGetIndexes) String() string
func (e *ExpectedGetIndexes) WillDelay(delay time.Duration) *ExpectedGetIndexes
WillDelay causes the call to DB.GetIndexes() to delay.
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 (e *ExpectedGetIndexes) WillReturn(ret0 []driver.Index) *ExpectedGetIndexes
WillReturn sets the values that will be returned by the call to DB.GetIndexes().
func (e *ExpectedGetIndexes) WillReturnError(err error) *ExpectedGetIndexes
WillReturnError sets the error value that will be returned by the call to DB.GetIndexes().
func (e *ExpectedGetIndexes) WithOptions(options ...kivik.Option) *ExpectedGetIndexes
WithOptions sets the expected options for the call to DB.GetIndexes().
ExpectedGetReplications represents an expectation for a call to GetReplications().
type ExpectedGetReplications struct {
// contains filtered or unexported fields
}
func (e *ExpectedGetReplications) String() string
func (e *ExpectedGetReplications) WillDelay(delay time.Duration) *ExpectedGetReplications
WillDelay causes the call to GetReplications() to delay.
func (e *ExpectedGetReplications) WillExecute(cb func(ctx context.Context, options driver.Options) ([]driver.Replication, error)) *ExpectedGetReplications
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (e *ExpectedGetReplications) WillReturn(ret0 []*Replication) *ExpectedGetReplications
WillReturn sets the values that will be returned by the call to GetReplications().
func (e *ExpectedGetReplications) WillReturnError(err error) *ExpectedGetReplications
WillReturnError sets the error value that will be returned by the call to GetReplications().
func (e *ExpectedGetReplications) WithOptions(options ...kivik.Option) *ExpectedGetReplications
WithOptions sets the expected options for the call to GetReplications().
ExpectedGetRev represents an expectation for a call to DB.GetRev().
type ExpectedGetRev struct {
// contains filtered or unexported fields
}
func (e *ExpectedGetRev) String() string
func (e *ExpectedGetRev) WillDelay(delay time.Duration) *ExpectedGetRev
WillDelay causes the call to DB.GetRev() to delay.
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 (e *ExpectedGetRev) WillReturn(ret0 string) *ExpectedGetRev
WillReturn sets the values that will be returned by the call to DB.GetRev().
func (e *ExpectedGetRev) WillReturnError(err error) *ExpectedGetRev
WillReturnError sets the error value that will be returned by the call to DB.GetRev().
func (e *ExpectedGetRev) WithDocID(docID string) *ExpectedGetRev
WithDocID sets the expectation for the docID passed to the DB.GetRev call.
func (e *ExpectedGetRev) WithOptions(options ...kivik.Option) *ExpectedGetRev
WithOptions sets the expected options for the call to DB.GetRev().
ExpectedLocalDocs represents an expectation for a call to DB.LocalDocs().
type ExpectedLocalDocs struct {
// contains filtered or unexported fields
}
func (e *ExpectedLocalDocs) String() string
func (e *ExpectedLocalDocs) WillDelay(delay time.Duration) *ExpectedLocalDocs
WillDelay causes the call to DB.LocalDocs() to delay.
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 (e *ExpectedLocalDocs) WillReturn(ret0 *Rows) *ExpectedLocalDocs
WillReturn sets the values that will be returned by the call to DB.LocalDocs().
func (e *ExpectedLocalDocs) WillReturnError(err error) *ExpectedLocalDocs
WillReturnError sets the error value that will be returned by the call to DB.LocalDocs().
func (e *ExpectedLocalDocs) WithOptions(options ...kivik.Option) *ExpectedLocalDocs
WithOptions sets the expected options for the call to DB.LocalDocs().
ExpectedMembership represents an expectation for a call to Membership().
type ExpectedMembership struct {
// contains filtered or unexported fields
}
func (e *ExpectedMembership) String() string
func (e *ExpectedMembership) WillDelay(delay time.Duration) *ExpectedMembership
WillDelay causes the call to Membership() to delay.
func (e *ExpectedMembership) WillExecute(cb func(ctx context.Context) (*driver.ClusterMembership, error)) *ExpectedMembership
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (e *ExpectedMembership) WillReturn(ret0 *driver.ClusterMembership) *ExpectedMembership
WillReturn sets the values that will be returned by the call to Membership().
func (e *ExpectedMembership) WillReturnError(err error) *ExpectedMembership
WillReturnError sets the error value that will be returned by the call to Membership().
ExpectedOpenRevs represents an expectation for a call to DB.OpenRevs().
type ExpectedOpenRevs struct {
// contains filtered or unexported fields
}
func (e *ExpectedOpenRevs) String() string
func (e *ExpectedOpenRevs) WillDelay(delay time.Duration) *ExpectedOpenRevs
WillDelay causes the call to DB.OpenRevs() to delay.
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 (e *ExpectedOpenRevs) WillReturn(ret0 *Rows) *ExpectedOpenRevs
WillReturn sets the values that will be returned by the call to DB.OpenRevs().
func (e *ExpectedOpenRevs) WillReturnError(err error) *ExpectedOpenRevs
WillReturnError sets the error value that will be returned by the call to DB.OpenRevs().
func (e *ExpectedOpenRevs) WithDocID(docID string) *ExpectedOpenRevs
WithDocID sets the expected docID for the DB.OpenRevs() call.
func (e *ExpectedOpenRevs) WithOptions(options ...kivik.Option) *ExpectedOpenRevs
WithOptions sets the expected options for the call to DB.OpenRevs().
func (e *ExpectedOpenRevs) WithRevs(revs []string) *ExpectedOpenRevs
WithRevs sets the expected revs for the DB.OpenRevs() call.
ExpectedPartitionStats represents an expectation for a call to DB.PartitionStats().
type ExpectedPartitionStats struct {
// contains filtered or unexported fields
}
func (e *ExpectedPartitionStats) String() string
func (e *ExpectedPartitionStats) WillDelay(delay time.Duration) *ExpectedPartitionStats
WillDelay causes the call to DB.PartitionStats() to delay.
func (e *ExpectedPartitionStats) WillExecute(cb func(ctx context.Context, arg0 string) (*driver.PartitionStats, error)) *ExpectedPartitionStats
WillExecute sets a callback function to be called with any inputs to the original function. Any values returned by the callback will be returned as if generated by the driver.
func (e *ExpectedPartitionStats) WillReturn(ret0 *driver.PartitionStats) *ExpectedPartitionStats
WillReturn sets the values that will be returned by the call to DB.PartitionStats().
func (e *ExpectedPartitionStats) WillReturnError(err error) *ExpectedPartitionStats
WillReturnError sets the error value that will be returned by the call to DB.PartitionStats().
func (e *ExpectedPartitionStats) WithName(name string) *ExpectedPartitionStats
WithName sets the expectation for the partition name passed to the DB.PartitionStats() call.
ExpectedPing represents an expectation for a call to Ping().
type ExpectedPing struct {
// contains filtered or unexported fields
}
func (e *ExpectedPing) String() string
func (e *ExpectedPing) WillDelay(delay time.Duration) *ExpectedPing
WillDelay causes the call to Ping() to delay.
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 (e *ExpectedPing) WillReturn(ret0 bool) *ExpectedPing
WillReturn sets the values that will be returned by the call to Ping().
func (e *ExpectedPing) WillReturnError(err error) *ExpectedPing
WillReturnError sets the error value that will be returned by the call to Ping().
ExpectedPurge represents an expectation for a call to DB.Purge().
type ExpectedPurge struct {
// contains filtered or unexported fields
}
func (e *ExpectedPurge) String() string
func (e *ExpectedPurge) WillDelay(delay time.Duration) *ExpectedPurge
WillDelay causes the call to DB.Purge() to delay.
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 (e *ExpectedPurge) WillReturn(ret0 *driver.PurgeResult) *ExpectedPurge
WillReturn sets the values that will be returned by the call to DB.Purge().
func (e *ExpectedPurge) WillReturnError(err error) *ExpectedPurge
WillReturnError sets the error value that will be returned by the call to DB.Purge().
func (e *ExpectedPurge) WithDocRevMap(docRevMap map[string][]string) *ExpectedPurge
WithDocRevMap sets the expected docRevMap for the call to DB.Purge().
ExpectedPut represents an expectation for a call to DB.Put().
type ExpectedPut struct {
// contains filtered or unexported fields
}
func (e *ExpectedPut) String() string
func (e *ExpectedPut) WillDelay(delay time.Duration) *ExpectedPut
WillDelay causes the call to DB.Put() to delay.
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 (e *ExpectedPut) WillReturn(ret0 string) *ExpectedPut
WillReturn sets the values that will be returned by the call to DB.Put().
func (e *ExpectedPut) WillReturnError(err error) *ExpectedPut
WillReturnError sets the error value that will be returned by the call to DB.Put().
func (e *ExpectedPut) WithDoc(doc interface{}) *ExpectedPut
WithDoc sets the expectation for the doc passed to the DB.Put() call.
func (e *ExpectedPut) WithDocID(docID string) *ExpectedPut
WithDocID sets the expectation for the docID passed to the DB.Put() call.
func (e *ExpectedPut) WithOptions(options ...kivik.Option) *ExpectedPut
WithOptions sets the expected options for the call to DB.Put().
ExpectedPutAttachment represents an expectation for a call to DB.PutAttachment().
type ExpectedPutAttachment struct {
// contains filtered or unexported fields
}
func (e *ExpectedPutAttachment) String() string
func (e *ExpectedPutAttachment) WillDelay(delay time.Duration) *ExpectedPutAttachment
WillDelay causes the call to DB.PutAttachment() to delay.
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 (e *ExpectedPutAttachment) WillReturn(ret0 string) *ExpectedPutAttachment
WillReturn sets the values that will be returned by the call to DB.PutAttachment().
func (e *ExpectedPutAttachment) WillReturnError(err error) *ExpectedPutAttachment
WillReturnError sets the error value that will be returned by the call to DB.PutAttachment().
func (e *ExpectedPutAttachment) WithAttachment(att *driver.Attachment) *ExpectedPutAttachment
WithAttachment sets the expectation for the rev passed to the DB.PutAttachment() call.
func (e *ExpectedPutAttachment) WithDocID(docID string) *ExpectedPutAttachment
WithDocID sets the expectation for the docID passed to the DB.PutAttachment() call.
func (e *ExpectedPutAttachment) WithOptions(options ...kivik.Option) *ExpectedPutAttachment
WithOptions sets the expected options for the call to DB.PutAttachment().
ExpectedQuery represents an expectation for a call to DB.Query().
type ExpectedQuery struct {
// contains filtered or unexported fields
}
func (e *ExpectedQuery) String() string
func (e *ExpectedQuery) WillDelay(delay time.Duration) *ExpectedQuery
WillDelay causes the call to DB.Query() to delay.
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 (e *ExpectedQuery) WillReturn(ret0 *Rows) *ExpectedQuery
WillReturn sets the values that will be returned by the call to DB.Query().
func (e *ExpectedQuery) WillReturnError(err error) *ExpectedQuery
WillReturnError sets the error value that will be returned by the call to DB.Query().
func (e *ExpectedQuery) WithDDocID(ddocID string) *ExpectedQuery
WithDDocID sets the expected ddocID value for the DB.Query() call.
func (e *ExpectedQuery) WithOptions(options ...kivik.Option) *ExpectedQuery
WithOptions sets the expected options for the call to DB.Query().
func (e *ExpectedQuery) WithView(view string) *ExpectedQuery
WithView sets the expected view value for the DB.Query() call.
ExpectedReplicate represents an expectation for a call to Replicate().
type ExpectedReplicate struct {
// contains filtered or unexported fields
}
func (e *ExpectedReplicate) String() string
func (e *ExpectedReplicate) WillDelay(delay time.Duration) *ExpectedReplicate
WillDelay causes the call to Replicate() to delay.
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 (e *ExpectedReplicate) WillReturn(ret0 *Replication) *ExpectedReplicate
WillReturn sets the values that will be returned by the call to Replicate().
func (e *ExpectedReplicate) WillReturnError(err error) *ExpectedReplicate
WillReturnError sets the error value that will be returned by the call to Replicate().
func (e *ExpectedReplicate) WithOptions(options ...kivik.Option) *ExpectedReplicate
WithOptions sets the expected options for the call to Replicate().
func (e *ExpectedReplicate) WithSource(source string) *ExpectedReplicate
WithSource sets the expected source.
func (e *ExpectedReplicate) WithTarget(target string) *ExpectedReplicate
WithTarget sets the expected target.
ExpectedRevsDiff represents an expectation for a call to DB.RevsDiff().
type ExpectedRevsDiff struct {
// contains filtered or unexported fields
}
func (e *ExpectedRevsDiff) String() string
func (e *ExpectedRevsDiff) WillDelay(delay time.Duration) *ExpectedRevsDiff
WillDelay causes the call to DB.RevsDiff() to delay.
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 (e *ExpectedRevsDiff) WillReturn(ret0 *Rows) *ExpectedRevsDiff
WillReturn sets the values that will be returned by the call to DB.RevsDiff().
func (e *ExpectedRevsDiff) WillReturnError(err error) *ExpectedRevsDiff
WillReturnError sets the error value that will be returned by the call to DB.RevsDiff().
func (e *ExpectedRevsDiff) WithRevLookup(revLookup interface{}) *ExpectedRevsDiff
WithRevLookup sets the expectation for the rev lookup passed to the DB.RevsDiff() call.
ExpectedSecurity represents an expectation for a call to DB.Security().
type ExpectedSecurity struct {
// contains filtered or unexported fields
}
func (e *ExpectedSecurity) String() string
func (e *ExpectedSecurity) WillDelay(delay time.Duration) *ExpectedSecurity
WillDelay causes the call to DB.Security() to delay.
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 (e *ExpectedSecurity) WillReturn(ret0 *driver.Security) *ExpectedSecurity
WillReturn sets the values that will be returned by the call to DB.Security().
func (e *ExpectedSecurity) WillReturnError(err error) *ExpectedSecurity
WillReturnError sets the error value that will be returned by the call to DB.Security().
ExpectedSession represents an expectation for a call to Session().
type ExpectedSession struct {
// contains filtered or unexported fields
}
func (e *ExpectedSession) String() string
func (e *ExpectedSession) WillDelay(delay time.Duration) *ExpectedSession
WillDelay causes the call to Session() to delay.
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 (e *ExpectedSession) WillReturn(ret0 *driver.Session) *ExpectedSession
WillReturn sets the values that will be returned by the call to Session().
func (e *ExpectedSession) WillReturnError(err error) *ExpectedSession
WillReturnError sets the error value that will be returned by the call to Session().
ExpectedSetConfigValue represents an expectation for a call to SetConfigValue().
type ExpectedSetConfigValue struct {
// contains filtered or unexported fields
}
func (e *ExpectedSetConfigValue) String() string
func (e *ExpectedSetConfigValue) WillDelay(delay time.Duration) *ExpectedSetConfigValue
WillDelay causes the call to SetConfigValue() to delay.
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 (e *ExpectedSetConfigValue) WillReturn(ret0 string) *ExpectedSetConfigValue
WillReturn sets the values that will be returned by the call to SetConfigValue().
func (e *ExpectedSetConfigValue) WillReturnError(err error) *ExpectedSetConfigValue
WillReturnError sets the error value that will be returned by the call to SetConfigValue().
func (e *ExpectedSetConfigValue) WithKey(key string) *ExpectedSetConfigValue
WithKey sets the expected key.
func (e *ExpectedSetConfigValue) WithNode(node string) *ExpectedSetConfigValue
WithNode sets the expected node.
func (e *ExpectedSetConfigValue) WithSection(section string) *ExpectedSetConfigValue
WithSection sets the expected section.
func (e *ExpectedSetConfigValue) WithValue(value string) *ExpectedSetConfigValue
WithValue sets the expected value.
ExpectedSetSecurity represents an expectation for a call to DB.SetSecurity().
type ExpectedSetSecurity struct {
// contains filtered or unexported fields
}
func (e *ExpectedSetSecurity) String() string
func (e *ExpectedSetSecurity) WillDelay(delay time.Duration) *ExpectedSetSecurity
WillDelay causes the call to DB.SetSecurity() to delay.
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 (e *ExpectedSetSecurity) WillReturnError(err error) *ExpectedSetSecurity
WillReturnError sets the error value that will be returned by the call to DB.SetSecurity().
func (e *ExpectedSetSecurity) WithSecurity(sec *driver.Security) *ExpectedSetSecurity
WithSecurity sets the expected security object for the DB.SetSecurity() call.
ExpectedStats represents an expectation for a call to DB.Stats().
type ExpectedStats struct {
// contains filtered or unexported fields
}
func (e *ExpectedStats) String() string
func (e *ExpectedStats) WillDelay(delay time.Duration) *ExpectedStats
WillDelay causes the call to DB.Stats() to delay.
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 (e *ExpectedStats) WillReturn(ret0 *driver.DBStats) *ExpectedStats
WillReturn sets the values that will be returned by the call to DB.Stats().
func (e *ExpectedStats) WillReturnError(err error) *ExpectedStats
WillReturnError sets the error value that will be returned by the call to DB.Stats().
ExpectedVersion represents an expectation for a call to Version().
type ExpectedVersion struct {
// contains filtered or unexported fields
}
func (e *ExpectedVersion) String() string
func (e *ExpectedVersion) WillDelay(delay time.Duration) *ExpectedVersion
WillDelay causes the call to Version() to delay.
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 (e *ExpectedVersion) WillReturn(ret0 *driver.Version) *ExpectedVersion
WillReturn sets the values that will be returned by the call to Version().
func (e *ExpectedVersion) WillReturnError(err error) *ExpectedVersion
WillReturnError sets the error value that will be returned by the call to Version().
ExpectedViewCleanup represents an expectation for a call to DB.ViewCleanup().
type ExpectedViewCleanup struct {
// contains filtered or unexported fields
}
func (e *ExpectedViewCleanup) String() string
func (e *ExpectedViewCleanup) WillDelay(delay time.Duration) *ExpectedViewCleanup
WillDelay causes the call to DB.ViewCleanup() to delay.
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 (e *ExpectedViewCleanup) WillReturnError(err error) *ExpectedViewCleanup
WillReturnError sets the error value that will be returned by the call to DB.ViewCleanup().
Replication is a replication instance.
type Replication struct {
// contains filtered or unexported fields
}
func (r *Replication) EndTime(t time.Time) *Replication
EndTime sets the replication end time.
func (r *Replication) Err(e error) *Replication
Err sets the replication error.
func (r *Replication) ID(id string) *Replication
ID sets the replication ID.
func (r *Replication) MarshalJSON() ([]byte, error)
MarshalJSON satisfies the json.Marshaler interface.
func (r *Replication) Source(s string) *Replication
Source sets the replication source.
func (r *Replication) StartTime(t time.Time) *Replication
StartTime sets the replication start time.
func (r *Replication) State(s kivik.ReplicationState) *Replication
State sets the replication state.
func (r *Replication) Target(t string) *Replication
Target sets the replication target.
Rows is a mocked collection of rows.
type Rows struct {
// contains filtered or unexported fields
}
func NewRows() *Rows
NewRows returns a new, empty set of rows, which can be returned by any of the row-returning expectations.
func (r *Rows) AddDelay(delay time.Duration) *Rows
AddDelay adds a delay before the next iteration will complete.
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 (r *Rows) AddRowError(err error) *Rows
AddRowError adds an error to be returned during row iteration.
func (i *Rows) Close() error
func (r *Rows) CloseError(err error) *Rows
CloseError sets an error to be returned when the rows iterator is closed.
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 (r *Rows) Offset(offset int64) *Rows
Offset sets the offset value to be returned by the rows iterator.
func (r *Rows) TotalRows(totalRows int64) *Rows
TotalRows sets the total rows value to be returned by the rows iterator.
func (r *Rows) UpdateSeq(seq string) *Rows
UpdateSeq sets the update sequence value to be returned by the rows iterator.
func (r *Rows) Warning(warning string) *Rows
Warning sets the warning value to be returned by the rows iterator.
Updates is a mocked collection of database updates.
type Updates struct {
// contains filtered or unexported fields
}
func NewDBUpdates() *Updates
NewDBUpdates returns a new, empty update set, which can be returned by the DBUpdates() expectation.
func (u *Updates) AddDelay(delay time.Duration) *Updates
AddDelay adds a delay before the next iteration will complete.
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 (u *Updates) AddUpdateError(err error) *Updates
AddUpdateError adds an error to be returned during update iteration.
func (i *Updates) Close() error
func (u *Updates) CloseError(err error) *Updates
CloseError sets an error to be returned when the updates iterator is closed.
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 (u *Updates) LastSeq(lastSeq string) *Updates
LastSeq sets the LastSeq value to be returned by the DBUpdates iterator.
func (u *Updates) LastSeqError(err error) *Updates
LastSeqError sets the error value to be returned when LastSeq is called.