NilOption is a nil option.
const NilOption nilOption = false
AttachmentMetaGetter mocks a driver.DB and driver.AttachmentMetaGetter
type AttachmentMetaGetter struct { *DB GetAttachmentMetaFunc func(ctx context.Context, docID, filename string, options driver.Options) (*driver.Attachment, error) }
func (db *AttachmentMetaGetter) GetAttachmentMeta(ctx context.Context, docID, filename string, options driver.Options) (*driver.Attachment, error)
GetAttachmentMeta calls db.GetAttachmentMetaFunc
Attachments mocks driver.Attachments
type Attachments struct { // ID identifies a specific Attachments instance ID string NextFunc func(*driver.Attachment) error CloseFunc func() error }
func (a *Attachments) Close() error
Close calls a.CloseFunc
func (a *Attachments) Next(att *driver.Attachment) error
Next calls a.NextFunc
Bookmarker wraps driver.Bookmarker
type Bookmarker struct { *Rows BookmarkFunc func() string }
func (r *Bookmarker) Bookmark() string
Bookmark calls r.BookmarkFunc
BulkDocer mocks a driver.DB and driver.BulkDocer
type BulkDocer struct { *DB BulkDocsFunc func(ctx context.Context, docs []interface{}, options driver.Options) ([]driver.BulkResult, error) }
func (db *BulkDocer) BulkDocs(ctx context.Context, docs []interface{}, options driver.Options) ([]driver.BulkResult, error)
BulkDocs calls db.BulkDocsFunc
BulkGetter mocks a driver.DB and driver.BulkGetter
type BulkGetter struct { *DB BulkGetFunc func(context.Context, []driver.BulkGetReference, driver.Options) (driver.Rows, error) }
func (db *BulkGetter) BulkGet(ctx context.Context, docs []driver.BulkGetReference, opts driver.Options) (driver.Rows, error)
BulkGet calls db.BulkGetFunc
Changes mocks driver.Changes
type Changes struct { NextFunc func(*driver.Change) error CloseFunc func() error LastSeqFunc func() string PendingFunc func() int64 ETagFunc func() string }
func (c *Changes) Close() error
Close calls c.CloseFunc
func (c *Changes) ETag() string
ETag calls c.ETagFunc
func (c *Changes) LastSeq() string
LastSeq calls c.LastSeqFunc
func (c *Changes) Next(change *driver.Change) error
Next calls c.NextFunc
func (c *Changes) Pending() int64
Pending calls c.PendingFunc
Client mocks driver.Client
type Client struct { // ID identifies a specific Client instance ID string AllDBsFunc func(context.Context, driver.Options) ([]string, error) CreateDBFunc func(context.Context, string, driver.Options) error DBFunc func(string, driver.Options) (driver.DB, error) DBExistsFunc func(context.Context, string, driver.Options) (bool, error) DestroyDBFunc func(context.Context, string, driver.Options) error VersionFunc func(context.Context) (*driver.Version, error) }
func (c *Client) AllDBs(ctx context.Context, opts driver.Options) ([]string, error)
AllDBs calls c.AllDBsFunc
func (c *Client) CreateDB(ctx context.Context, dbname string, opts driver.Options) error
CreateDB calls c.CreateDBFunc
func (c *Client) DB(dbname string, opts driver.Options) (driver.DB, error)
DB calls c.DBFunc
func (c *Client) DBExists(ctx context.Context, dbname string, opts driver.Options) (bool, error)
DBExists calls c.DBExistsFunc
func (c *Client) DestroyDB(ctx context.Context, dbname string, opts driver.Options) error
DestroyDB calls c.DestroyDBFunc
func (c *Client) Version(ctx context.Context) (*driver.Version, error)
Version calls c.VersionFunc
ClientCloser mocks driver.Client and driver.ClientCloser
type ClientCloser struct { *Client CloseFunc func() error }
func (c *ClientCloser) Close() error
Close calls c.CloseFunc
ClientReplicator mocks driver.Client and driver.ClientReplicator
type ClientReplicator struct { *Client GetReplicationsFunc func(context.Context, driver.Options) ([]driver.Replication, error) ReplicateFunc func(context.Context, string, string, driver.Options) (driver.Replication, error) }
func (c *ClientReplicator) GetReplications(ctx context.Context, opts driver.Options) ([]driver.Replication, error)
GetReplications calls c.GetReplicationsFunc
func (c *ClientReplicator) Replicate(ctx context.Context, target, source string, opts driver.Options) (driver.Replication, error)
Replicate calls c.ReplicateFunc
Cluster mocks driver.Client and driver.Cluster
type Cluster struct { *Client ClusterStatusFunc func(context.Context, driver.Options) (string, error) ClusterSetupFunc func(context.Context, interface{}) error MembershipFunc func(context.Context) (*driver.ClusterMembership, error) }
func (c *Cluster) ClusterSetup(ctx context.Context, action interface{}) error
ClusterSetup calls c.ClusterSetupFunc
func (c *Cluster) ClusterStatus(ctx context.Context, options driver.Options) (string, error)
ClusterStatus calls c.ClusterStatusFunc
func (c *Cluster) Membership(ctx context.Context) (*driver.ClusterMembership, error)
Membership calls c.MembershipFunc
Configer mocks driver.Client and driver.Configer
type Configer struct { *Client ConfigFunc func(context.Context, string) (driver.Config, error) ConfigSectionFunc func(context.Context, string, string) (driver.ConfigSection, error) ConfigValueFunc func(context.Context, string, string, string) (string, error) SetConfigValueFunc func(context.Context, string, string, string, string) (string, error) DeleteConfigKeyFunc func(context.Context, string, string, string) (string, error) }
func (c *Configer) Config(ctx context.Context, node string) (driver.Config, error)
Config calls c.ConfigFunc
func (c *Configer) ConfigSection(ctx context.Context, node, section string) (driver.ConfigSection, error)
ConfigSection calls c.ConfSectionFunc
func (c *Configer) ConfigValue(ctx context.Context, node, section, key string) (string, error)
ConfigValue calls c.ConfigValueFunc
func (c *Configer) DeleteConfigKey(ctx context.Context, node, section, key string) (string, error)
DeleteConfigKey calls c.DeleteConfigKeyFunc
func (c *Configer) SetConfigValue(ctx context.Context, node, section, key, value string) (string, error)
SetConfigValue calls c.SetConfigValueFunc
Copier mocks a driver.DB and driver.Copier.
type Copier struct { *DB CopyFunc func(context.Context, string, string, driver.Options) (string, error) }
func (db *Copier) Copy(ctx context.Context, target, source string, options driver.Options) (string, error)
Copy calls db.CopyFunc
DB mocks a driver.DB
type DB struct { // ID is a unique identifier for the DB instance. ID string AllDocsFunc func(ctx context.Context, options driver.Options) (driver.Rows, error) GetFunc func(ctx context.Context, docID string, options driver.Options) (*driver.Document, error) PutFunc func(ctx context.Context, docID string, doc interface{}, options driver.Options) (rev string, err error) DeleteFunc func(ctx context.Context, docID string, options driver.Options) (newRev string, err error) StatsFunc func(ctx context.Context) (*driver.DBStats, error) CompactFunc func(ctx context.Context) error CompactViewFunc func(ctx context.Context, ddocID string) error ViewCleanupFunc func(ctx context.Context) error ChangesFunc func(ctx context.Context, options driver.Options) (driver.Changes, error) PutAttachmentFunc func(ctx context.Context, docID string, att *driver.Attachment, options driver.Options) (newRev string, err error) GetAttachmentFunc func(ctx context.Context, docID, filename string, options driver.Options) (*driver.Attachment, error) DeleteAttachmentFunc func(ctx context.Context, docID, filename string, options driver.Options) (newRev string, err error) QueryFunc func(context.Context, string, string, driver.Options) (driver.Rows, error) CloseFunc func() error }
func (db *DB) AllDocs(ctx context.Context, options driver.Options) (driver.Rows, error)
AllDocs calls db.AllDocsFunc
func (db *DB) Changes(ctx context.Context, opts driver.Options) (driver.Changes, error)
Changes calls db.ChangesFunc
func (db *DB) Close() error
Close calls db.CloseFunc
func (db *DB) Compact(ctx context.Context) error
Compact calls db.CompactFunc
func (db *DB) CompactView(ctx context.Context, docID string) error
CompactView calls db.CompactViewFunc
func (db *DB) Delete(ctx context.Context, docID string, opts driver.Options) (string, error)
Delete calls db.DeleteFunc
func (db *DB) DeleteAttachment(ctx context.Context, docID, filename string, opts driver.Options) (string, error)
DeleteAttachment calls db.DeleteAttachmentFunc
func (db *DB) Get(ctx context.Context, docID string, opts driver.Options) (*driver.Document, error)
Get calls db.GetFunc
func (db *DB) GetAttachment(ctx context.Context, docID, filename string, opts driver.Options) (*driver.Attachment, error)
GetAttachment calls db.GetAttachmentFunc
func (db *DB) Put(ctx context.Context, docID string, doc interface{}, opts driver.Options) (string, error)
Put calls db.PutFunc
func (db *DB) PutAttachment(ctx context.Context, docID string, att *driver.Attachment, opts driver.Options) (string, error)
PutAttachment calls db.PutAttachmentFunc
func (db *DB) Query(ctx context.Context, ddoc, view string, opts driver.Options) (driver.Rows, error)
Query calls db.QueryFunc.
func (db *DB) Stats(ctx context.Context) (*driver.DBStats, error)
Stats calls db.StatsFunc
func (db *DB) ViewCleanup(ctx context.Context) error
ViewCleanup calls db.ViewCleanupFunc
DBUpdater mocks driver.Client and driver.DBUpdater
type DBUpdater struct { *Client DBUpdatesFunc func(context.Context, driver.Options) (driver.DBUpdates, error) }
func (c *DBUpdater) DBUpdates(ctx context.Context, options driver.Options) (driver.DBUpdates, error)
DBUpdates calls c.DBUpdatesFunc
DBUpdates mocks driver.DBUpdates
type DBUpdates struct { // ID identifies a specific DBUpdates instance. ID string NextFunc func(*driver.DBUpdate) error CloseFunc func() error }
func (u *DBUpdates) Close() error
Close calls u.CloseFunc
func (u *DBUpdates) Next(dbupdate *driver.DBUpdate) error
Next calls u.NextFunc
DBsStatser mocks driver.Client and driver.DBsStatser
type DBsStatser struct { *Client DBsStatsFunc func(context.Context, []string) ([]*driver.DBStats, error) }
func (c *DBsStatser) DBsStats(ctx context.Context, dbnames []string) ([]*driver.DBStats, error)
DBsStats calls c.DBsStatsFunc
DesignDocer mocks a driver.DB and driver.DesignDocer
type DesignDocer struct { *DB DesignDocsFunc func(context.Context, driver.Options) (driver.Rows, error) }
func (db *DesignDocer) DesignDocs(ctx context.Context, options driver.Options) (driver.Rows, error)
DesignDocs calls db.DesignDocsFunc
DocCreator is a stub for a github.com/go-kivik/v4/driver.DocCreator.
type DocCreator struct { DB CreateDocFunc func(ctx context.Context, doc interface{}, options driver.Options) (docID, rev string, err error) }
func (db *DocCreator) CreateDoc(ctx context.Context, doc interface{}, opts driver.Options) (string, string, error)
CreateDoc calls db.CreateDocFunc
Driver mocks a Kivik Driver.
type Driver struct { NewClientFunc func(name string, options driver.Options) (driver.Client, error) }
func (d *Driver) NewClient(name string, options driver.Options) (driver.Client, error)
NewClient calls d.NewClientFunc
Finder mocks a driver.DB and driver.Finder
type Finder struct { *DB CreateIndexFunc func(context.Context, string, string, interface{}, driver.Options) error DeleteIndexFunc func(context.Context, string, string, driver.Options) error FindFunc func(context.Context, interface{}, driver.Options) (driver.Rows, error) GetIndexesFunc func(context.Context, driver.Options) ([]driver.Index, error) ExplainFunc func(context.Context, interface{}, driver.Options) (*driver.QueryPlan, error) }
func (db *Finder) CreateIndex(ctx context.Context, ddoc, name string, index interface{}, options driver.Options) error
CreateIndex calls db.CreateIndexFunc
func (db *Finder) DeleteIndex(ctx context.Context, ddoc, name string, opts driver.Options) error
DeleteIndex calls db.DeleteIndexFunc
func (db *Finder) Explain(ctx context.Context, query interface{}, opts driver.Options) (*driver.QueryPlan, error)
Explain calls db.ExplainFunc
func (db *Finder) Find(ctx context.Context, query interface{}, opts driver.Options) (driver.Rows, error)
Find calls db.FindFunc
func (db *Finder) GetIndexes(ctx context.Context, opts driver.Options) ([]driver.Index, error)
GetIndexes calls db.GetIndexesFunc
Flusher mocks a driver.DB and driver.Flusher
type Flusher struct { *DB FlushFunc func(context.Context) error }
func (db *Flusher) Flush(ctx context.Context) error
Flush calls db.FlushFunc
LastSeqer mocks driver.DBUpdates and driver.LastSeqer.
type LastSeqer struct { *DBUpdates LastSeqFunc func() (string, error) }
func (l *LastSeqer) LastSeq() (string, error)
LastSeq calls l.LastSeqFunc.
LocalDocer mocks a driver.DB and driver.DesignDocer
type LocalDocer struct { *DB LocalDocsFunc func(context.Context, driver.Options) (driver.Rows, error) }
func (db *LocalDocer) LocalDocs(ctx context.Context, options driver.Options) (driver.Rows, error)
LocalDocs calls db.LocalDocsFunc
OpenRever mocks a driver.DB and driver.OpenRever.
type OpenRever struct { *DB OpenRevsFunc func(context.Context, string, []string, driver.Options) (driver.Rows, error) }
func (db *OpenRever) OpenRevs(ctx context.Context, docID string, revs []string, options driver.Options) (driver.Rows, error)
OpenRevs calls db.OpenRevsFunc.
PartitionedDB mocks a driver.DB and a driver.PartitionedDB.
type PartitionedDB struct { *DB PartitionStatsFunc func(context.Context, string) (*driver.PartitionStats, error) }
func (db *PartitionedDB) PartitionStats(ctx context.Context, name string) (*driver.PartitionStats, error)
PartitionStats calls db.PartitionStatsFunc.
Pinger mocks driver.Client and driver.Pinger
type Pinger struct { *Client PingFunc func(context.Context) (bool, error) }
func (c *Pinger) Ping(ctx context.Context) (bool, error)
Ping calls c.PingFunc
Purger mocks a driver.DB and driver.Purger
type Purger struct { *DB PurgeFunc func(context.Context, map[string][]string) (*driver.PurgeResult, error) }
func (db *Purger) Purge(ctx context.Context, docMap map[string][]string) (*driver.PurgeResult, error)
Purge calls db.PurgeFunc
Replication mocks driver.Replication
type Replication struct { // ID identifies a specific Replication instance ID string DeleteFunc func(context.Context) error StartTimeFunc func() time.Time EndTimeFunc func() time.Time ErrFunc func() error ReplicationIDFunc func() string SourceFunc func() string TargetFunc func() string StateFunc func() string UpdateFunc func(context.Context, *driver.ReplicationInfo) error }
func (r *Replication) Delete(ctx context.Context) error
Delete calls r.DeleteFunc
func (r *Replication) EndTime() time.Time
EndTime calls r.EndTimeFunc
func (r *Replication) Err() error
Err calls r.ErrFunc
func (r *Replication) ReplicationID() string
ReplicationID calls r.ReplicationIDFunc
func (r *Replication) Source() string
Source calls r.SourceFunc or returns a default value if SourceFunc is nil
func (r *Replication) StartTime() time.Time
StartTime calls r.StartTimeFunc
func (r *Replication) State() string
State calls r.StateFunc
func (r *Replication) Target() string
Target calls r.TargetFunc or returns a default if TargetFunc is nil
func (r *Replication) Update(ctx context.Context, rep *driver.ReplicationInfo) error
Update calls r.UpdateFunc
RevGetter mocks a driver.DB and driver.RevGetter
type RevGetter struct { *DB GetRevFunc func(context.Context, string, driver.Options) (string, error) }
func (db *RevGetter) GetRev(ctx context.Context, docID string, opts driver.Options) (string, error)
GetRev calls db.GetRevFunc
RevsDiffer mocks a driver.DB and driver.RevsDiffer.
type RevsDiffer struct { *BulkDocer RevsDiffFunc func(context.Context, interface{}) (driver.Rows, error) }
func (db *RevsDiffer) RevsDiff(ctx context.Context, revMap interface{}) (driver.Rows, error)
RevsDiff calls db.RevsDiffFunc
Rows mocks driver.Rows
type Rows struct { // ID identifies a specific Rows instance. ID string CloseFunc func() error NextFunc func(*driver.Row) error OffsetFunc func() int64 TotalRowsFunc func() int64 UpdateSeqFunc func() string }
func (r *Rows) Close() error
Close calls r.CloseFunc
func (r *Rows) Next(row *driver.Row) error
Next calls r.NextFunc
func (r *Rows) Offset() int64
Offset calls r.OffsetFunc
func (r *Rows) TotalRows() int64
TotalRows calls r.TotalRowsFunc
func (r *Rows) UpdateSeq() string
UpdateSeq calls r.UpdateSeqFunc
RowsWarner wraps driver.RowsWarner
type RowsWarner struct { *Rows WarningFunc func() string }
func (r *RowsWarner) Warning() string
Warning calls r.WarningFunc
SecurityDB is a stub for a driver.SecurityDB.
type SecurityDB struct { DB SecurityFunc func(ctx context.Context) (*driver.Security, error) SetSecurityFunc func(ctx context.Context, security *driver.Security) error }
func (db *SecurityDB) Security(ctx context.Context) (*driver.Security, error)
Security calls db.SecurityFunc
func (db *SecurityDB) SetSecurity(ctx context.Context, security *driver.Security) error
SetSecurity calls db.SetSecurityFunc
Sessioner mocks driver.Client and driver.Sessioner
type Sessioner struct { *Client SessionFunc func(context.Context) (*driver.Session, error) }
func (s *Sessioner) Session(ctx context.Context) (*driver.Session, error)
Session calls s.SessionFunc