crud

package
v0.7.1-beta1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const MongoClaimsCollection = "cnab_claims"

MongoClaimsCollection is the name of the claims collection.

Variables

View Source
var ErrRecordDoesNotExist = errors.New("File does not exist")

ErrRecordDoesNotExist represents when file path is not found on file system

Functions

This section is empty.

Types

type Store

type Store interface {
	List() ([]string, error)
	Store(name string, data []byte) error
	Read(name string) ([]byte, error)
	Delete(name string) error
}

Store is a simplified interface to a key-blob store supporting CRUD operations.

func NewFileSystemStore

func NewFileSystemStore(baseDirectory string, fileExtension string) Store

NewFileSystemStore creates a Store backed by a file system directory. Each key is represented by a file in that directory.

func NewMongoDBStore

func NewMongoDBStore(url string) (Store, error)

NewMongoDBStore creates a new storage engine that uses MongoDB

The URL provided must point to a MongoDB server and database.

Jump to

Keyboard shortcuts

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