store

package
v0.0.0-...-e1c9297 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store interface {
	// GetRing retrieves the key ring of the store
	GetRing() ([]byte, error)
	// StoreRing stores the key ring of the store
	StoreRing(raw []byte) error

	// GetPublicRing receives the public key ring of the store
	GetPublicRing() ([]byte, error)
	// StorePublicRing stores the public key ring of the store
	StorePublicRing(raw []byte) error

	// ChangeLogs retrieves the change logs of all nodes
	ChangeLogs() ([]model.ChangeLog, error)

	// GetIndex retrieves the index block of a node
	GetIndex(nodeID string) ([]byte, error)
	// StoreIndex stores the index block of a node
	StoreIndex(nodeID string, indexBlock []byte) error

	// AddBlock adds a block (of encrypted data) to the store and
	// return its id
	AddBlock(block []byte) (string, error)
	// GetBlock retrieves a block by its id
	GetBlock(blockID string) ([]byte, error)

	// Commit changes made to the store (i.e. write them the the change log)
	Commit(nodeID string, changes []model.Change) error
}

Store is the common interface for a backend store. Secrets are stored in encrypted blocks, its the Store's responsibility to do the necessary I/O stuff.

func NewStore

func NewStore(storeURLStr string, logger logging.Logger) (Store, error)

NewStore creates a new backend store from a URL.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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