Documentation ¶
Overview ¶
Package store provides an interface to database storage for the TRISA directory service.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrCorruptedSequence = errors.New("primary key sequence is invalid") ErrCorruptedIndex = errors.New("search indices are invalid") ErrIncompleteRecord = errors.New("vasp record is missing required fields") ErrEntityNotFound = errors.New("entity not found") ErrDuplicateEntity = errors.New("entity unique constraints violated") )
Errors that may occur during LevelDB operations
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store interface { Close() error Create(v pb.VASP) (uint64, error) Retrieve(id uint64) (pb.VASP, error) Update(v pb.VASP) error Destroy(id uint64) error Search(query map[string]interface{}) ([]pb.VASP, error) }
Store provides an interface for directory storage services to abstract the underlying database provider. The storage methods correspond to directory service requests, which are currently implemented with a simple CRUD and search interface for VASP records. The underlying database can be a simple embedded store or a distributed SQL server, so long as it can interact with VASP identity records.
func Open ¶
Open a directory storage provider with the specified URI. Database URLs should either specify protocol+transport://user:pass@host/dbname?opt1=a&opt2=b for servers or protocol:/path/to/file for embedded databases.
func OpenLevelDB ¶
OpenLevelDB directory Store at the specified path. This is the default storage provider.