pkg: istio.io/pkg/ledger Index | Files

package ledger

import "istio.io/pkg/ledger"

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

Package Files

ledger.go smt.go smt_tools.go trie_cache.go util.go

type Ledger Uses

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.

func Make Uses

func Make(retention time.Duration) Ledger

Make returns a Ledger which will retain previous nodes after they are deleted.

Package ledger imports 7 packages (graph) and is imported by 12 packages. Updated 2020-05-07. Refresh now. Tools for package owners.