Documentation
¶
Overview ¶
Package memory provides a thread-safe in-memory implementation of storage.Repository.
Index ¶
- type Repository
- func (r *Repository) Batch(vaultID string, fn func(tx storage.BatchTx) error) error
- func (r *Repository) Delete(vaultID, recordType, recordID string) error
- func (r *Repository) DeleteVault(vaultID string) error
- func (r *Repository) Get(vaultID, recordType, recordID string) (*storage.Envelope, error)
- func (r *Repository) List(vaultID, recordType string) ([]string, error)
- func (r *Repository) ListVaults() ([]string, error)
- func (r *Repository) Put(vaultID, recordType, recordID string, envelope *storage.Envelope) error
- func (r *Repository) PutCAS(vaultID, recordType, recordID string, expectedVersion uint64, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository is a thread-safe in-memory implementation of storage.Repository. Suitable for testing, demos, and single-process use cases.
func NewRepository ¶
func NewRepository() *Repository
NewRepository creates a new empty in-memory Repository.
func (*Repository) Batch ¶
Batch executes fn within a batch transaction. On error, all writes are rolled back.
func (*Repository) Delete ¶
func (r *Repository) Delete(vaultID, recordType, recordID string) error
func (*Repository) DeleteVault ¶
func (r *Repository) DeleteVault(vaultID string) error
func (*Repository) Get ¶
func (r *Repository) Get(vaultID, recordType, recordID string) (*storage.Envelope, error)
func (*Repository) ListVaults ¶
func (r *Repository) ListVaults() ([]string, error)
Click to show internal directories.
Click to hide internal directories.