Versions in this module Expand all Collapse all v0 v0.3.0 Aug 3, 2026 v0.2.0 Aug 3, 2026 Changes in this version type Model + Deleted bool + func (m *Model) GetDeleted() bool v0.1.0 Jul 8, 2026 Changes in this version + const DefaultSeparator + var ErrAlreadyExists = errors.New("already exists") + var ErrNotFound = errors.New("not found") + func Delete(ctx context.Context, db *kivik.DB, m Persistable) error + func Fetch(ctx context.Context, db *kivik.DB, d Persistable) error + func FetchModel(ctx context.Context, db *kivik.DB, m Persistable) error + func RevAfter(a, b string) bool + func Store(ctx context.Context, db *kivik.DB, m Persistable) error + func StoreModel(ctx context.Context, db *kivik.DB, m Persistable) error + type Client struct + func New(conf *Config, opts ...kivik.Option) (*Client, error) + func (c *Client) Create(ctx context.Context, db *kivik.DB, opts ...kivik.Option) error + func (c *Client) DB(name string) *kivik.DB + func (c *Client) Ping(ctx context.Context) error + func (c *Client) SyncDesigns(ctx context.Context, db *kivik.DB, designs []*Design) error + type Config struct + Host string + Password string + Port string + Prefix string + Scheme string + Separator string + Username string + func NewConfig(prefix string) *Config + type Design struct + Filters map[string]string + Language string + Options map[string]any + Views map[string]*View + func NewDesign(name string) *Design + func (d *Design) Checksum() string + func (d *Design) SetFilter(name string, filter string) + func (d *Design) SetView(name string, view *View) + func (d *Design) Sync(ctx context.Context, db *kivik.DB) error + type Document struct + ID string + Rev string + func (d *Document) GetID() string + func (d *Document) GetRev() string + func (d *Document) Persisted() bool + func (d *Document) SetID(id string) + func (d *Document) SetRev(rev string) + func (d *Document) UpdateTimestamps() + type Model struct + Attachments kivik.Attachments + CreatedAt at.Timestamp + ID string + Rev string + UpdatedAt at.Timestamp + func (m *Model) GetCreatedAt() at.Timestamp + func (m *Model) GetID() string + func (m *Model) GetRev() string + func (m *Model) GetUpdatedAt() at.Timestamp + func (m *Model) Persisted() bool + func (m *Model) Reset() + func (m *Model) SetID(id string) + func (m *Model) SetRev(rev string) + func (m *Model) UpdateTimestamps() + type Persistable interface + GetID func() string + GetRev func() string + SetID func(string) + SetRev func(string) + UpdateTimestamps func() + type ShardByYear struct + func NewShardByYear(name string, start int) *ShardByYear + func NewShardByYearWithStatic(name string, start int, static string) *ShardByYear + func (s *ShardByYear) Key(v any) (string, error) + func (s *ShardByYear) List() []string + func (s *ShardByYear) Template() string + type ShardRules interface + Key func(v interface{}) (string, error) + List func() []string + Template func() string + type Shardable interface + ShardValue func() interface{} + type Shards struct + func NewShards(client *Client, rules ShardRules) *Shards + func (s *Shards) For(m Shardable) (*kivik.DB, error) + func (s *Shards) Get(name string) *kivik.DB + func (s *Shards) List() []*kivik.DB + func (s *Shards) Map() map[string]*kivik.DB + func (s *Shards) Names() []string + type View struct + Map string + Reduce string