Documentation ¶
Overview ¶
Package couchdb implements a storage interface for Aries (aries-framework-go).
Index ¶
- func ReadinessCheck(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) Ping() error
- func (p *Provider) SetStoreConfig(name string, config storage.StoreConfiguration) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadinessCheck ¶
ReadinessCheck 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 when there's a document update conflict. This can happen if there are multiple CouchDB providers trying to insert data into a store or set store configs are the same time. maxRetries must be > 0. If not set (or set to an invalid value), it will default to 3 in the NewProvider function.
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) Ping ¶
Ping verifies whether the CouchDB client can successfully connect to the deployment specified by the host URL string used in the NewProvider call.
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 with large datasets. If you want to do queries with sorts, then you must ensure the tag you're sorting on is indexed, otherwise the query will fail. 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.