keyvaluestore

package
v0.0.0-...-7b2b905 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicFile

type BasicFile struct {
	// contains filtered or unexported fields
}

BasicFile is a naive implementation of file based storage

func NewBasicFile

func NewBasicFile() (BasicFile, error)

NewBasicFile creates the db file if it doesn't exist or opens the existing db file

func (BasicFile) Get

func (bf BasicFile) Get(key string) (string, error)

Get does

func (BasicFile) Set

func (bf BasicFile) Set(key, value string) error

Set does

type BasicMemory

type BasicMemory map[string]string

BasicMemory is the simplest possible in memory database utilizing just a regular map to store keys and values.

func (BasicMemory) Get

func (s BasicMemory) Get(key string) (string, error)

Get the value of the key

func (BasicMemory) Set

func (s BasicMemory) Set(key, value string) error

Set the key to the value

type Bitcask

type Bitcask struct {
	// contains filtered or unexported fields
}

Bitcask is

func NewBitcask

func NewBitcask(uniqueDB bool) (Bitcask, error)

NewBitcask creates

func (Bitcask) Get

func (b Bitcask) Get(key string) (string, error)

Get does

func (Bitcask) Set

func (b Bitcask) Set(key, value string) error

Set does

type KeyValueStore

type KeyValueStore interface {
	Get(string) (string, error)
	Set(string, string) error
}

KeyValueStore defines what our service will provide. Right now it is the bare minimum of a key-value store.

Jump to

Keyboard shortcuts

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