couchdb

package module
v0.0.0-...-14c4923 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package couchdb implements a storage interface for Aries (aries-framework-go).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PingCouchDB

func PingCouchDB(url string) error

PingCouchDB performs a readiness check on the CouchDB instance located at url.

Types

type Option

type Option func(opts *Provider)

Option represents an option for a CouchDB Provider.

func WithDBPrefix

func WithDBPrefix(dbPrefix string) Option

WithDBPrefix is an option for adding a prefix to all created DB names.

func WithLogger

func WithLogger(logger logger) Option

WithLogger is an option for specifying a custom logger. The standard Golang logger will be used if this option is not provided.

func WithMaxDocumentConflictRetries

func WithMaxDocumentConflictRetries(maxRetries int) Option

WithMaxDocumentConflictRetries is an option for specifying how many retries are allowed in the case when there's a document update conflict (i.e. the document was updated by someone else during a Put operation here).

type Provider

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

Provider represents a CouchDB implementation of the storage.Provider interface.

func NewProvider

func NewProvider(hostURL string, opts ...Option) (*Provider, error)

NewProvider instantiates a new CouchDB Provider. TODO (#48): Allow context to be passed in.

func (*Provider) Close

func (p *Provider) Close() error

Close closes the provider.

func (*Provider) GetOpenStores

func (p *Provider) GetOpenStores() []storage.Store

GetOpenStores returns all currently open stores.

func (*Provider) GetStoreConfig

func (p *Provider) GetStoreConfig(name string) (storage.StoreConfiguration, error)

GetStoreConfig gets the current store configuration.

func (*Provider) OpenStore

func (p *Provider) OpenStore(name string) (storage.Store, error)

OpenStore opens a store with the given name and returns a handle. If the store has never been opened before, then it is created.

func (*Provider) SetStoreConfig

func (p *Provider) SetStoreConfig(name string, config storage.StoreConfiguration) error

SetStoreConfig sets the configuration on a store. Indexes are created based on the tag names in config. This allows the store.Query method to operate faster. Existing tag names/indexes in the store that are not in the config passed in here will be removed. The store must be created prior to calling this method. If duplicate tags are provided, then CouchDB will ignore them.

Jump to

Keyboard shortcuts

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