Documentation
¶
Overview ¶
Package ledger implements a modified map with three unique characteristics: 1. every unique state of the map is given a unique hash 2. prior states of the map are retained for a fixed period of time 2. given a previous hash, we can retrieve a previous state from the map, if it is still retained.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ledger ¶
type Ledger interface { // Put adds or overwrites a key in the Ledger Put(key, value string) (string, error) // Delete removes a key from the Ledger, which may still be read using GetPreviousValue Delete(key string) error // Get returns a the value of the key from the Ledger's current state Get(key string) (string, error) // RootHash is the hash of all keys and values currently in the Ledger RootHash() string // GetPreviousValue executes a get against a previous version of the ledger, using that version's root hash. GetPreviousValue(previousRootHash, key string) (result string, err error) }
Ledger exposes a modified map with three unique characteristics: 1. every unique state of the map is given a unique hash 2. prior states of the map are retained for a fixed period of time 2. given a previous hash, we can retrieve a previous state from the map, if it is still retained.
Click to show internal directories.
Click to hide internal directories.