couchdbedvprovider

package
v0.1.30 Latest Latest
Warning

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

Go to latest
Published: May 6, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMissingDatabaseURL = errors.New("couchDB database URL not set")

ErrMissingDatabaseURL is returned when an attempt is made to instantiate a new CouchDBEDVProvider with a blank URL.

Functions

This section is empty.

Types

type CouchDBEDVProvider

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

CouchDBEDVProvider represents a CouchDB provider with functionality needed for EDV data storage. It wraps an edge-core CouchDB provider with additional functionality that's needed for EDV operations.

func NewProvider

func NewProvider(databaseURL, dbPrefix string) (*CouchDBEDVProvider, error)

NewProvider instantiates Provider

func (*CouchDBEDVProvider) CreateStore

func (c *CouchDBEDVProvider) CreateStore(name string) error

CreateStore creates a new store with the given name.

func (*CouchDBEDVProvider) OpenStore

func (c *CouchDBEDVProvider) OpenStore(name string) (edvprovider.EDVStore, error)

OpenStore opens an existing store and returns it.

type CouchDBEDVStore

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

CouchDBEDVStore represents a CouchDB store with functionality needed for EDV data storage. It wraps an edge-core CouchDB store with additional functionality that's needed for EDV operations.

func (*CouchDBEDVStore) CreateEDVIndex

func (c *CouchDBEDVStore) CreateEDVIndex() error

CreateEDVIndex creates the index which will allow for encrypted indices to work.

func (*CouchDBEDVStore) Get

func (c *CouchDBEDVStore) Get(k string) ([]byte, error)

Get fetches the document associated with the given key.

func (*CouchDBEDVStore) Put

func (c *CouchDBEDVStore) Put(document models.EncryptedDocument) error

Put stores the given document. A mapping document is also created and stored in order to allow for encrypted indices to work.

func (*CouchDBEDVStore) Query

func (c *CouchDBEDVStore) Query(query *models.Query) ([]string, error)

Query does an EDV encrypted index query. We first get the "mapping document" and then use the ID we get from that to lookup the associated encrypted document. Then we check that encrypted document to see if the value matches what was specified in the query.

Jump to

Keyboard shortcuts

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