Documentation ¶
Overview ¶
Package couchdb implements a storage interface for Aries (aries-framework-go).
Index ¶
- func PingCouchDB(url string) error
- type Option
- type Provider
- func (p *Provider) Close() error
- func (p *Provider) GetOpenStores() []storage.Store
- func (p *Provider) GetStoreConfig(name string) (storage.StoreConfiguration, error)
- func (p *Provider) OpenStore(name string) (storage.Store, error)
- func (p *Provider) SetStoreConfig(name string, config storage.StoreConfiguration) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PingCouchDB ¶
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 ¶
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 ¶
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 ¶
NewProvider instantiates a new CouchDB Provider. TODO (#48): Allow context to be passed in.
func (*Provider) GetOpenStores ¶
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 ¶
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.