hashtable

package
v0.0.0-...-2cfabc9 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package hashtable provides functionality for storing and retrieving key-value pairs associated with a specific revision.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Map

type Map interface {
	// Read retrieves the key-value pair from the data storage.
	// It returns the key, the revision and if everything has gone ok.
	Read(string) (string, lib.Revision, bool)
	// Store puts the key-value pair in the data storage.
	// it returns if the change has been committed.
	Store(string, string, lib.Revision) bool
	// Keys returns a slice of keys stored in the key-value storage.
	Keys() []string
}

Map stores key-value pairs associated with a revision. If an entry should be overriden, the map checks if the updated entry has a newer revision. If yes, it will copy the data, else it will discard the change.

func New

func New() Map

New initializes a new hash table.

Jump to

Keyboard shortcuts

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