storage

package
v0.0.0-...-8beb243 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

type Storage interface {
	// Init configures the storage.
	Init() error

	// Get returns the value for the given key.
	Get(key []byte) ([]byte, error)

	// Set sets the value for the given key.
	Set(key []byte, value []byte) error

	// Delete deletes the value for the given key.
	Delete(key []byte) error

	// Exists returns true if the given key exists.
	Exists(key []byte) (bool, error)

	// Len returns the number of keys in the storage.
	Len() (int, error)

	// PhysicalSnapshot writes snapshot of the storage data to
	// the given writer.
	PhysicalSnapshot(w io.Writer) error

	// Close closes the storage.
	Close() error
}

func New

func New(t StorageType, path string, config config.Config) (Storage, error)

New returns a new Storage instance.

type StorageType

type StorageType string
const (
	StupidStorageType StorageType = "stupid"
)

Directories

Path Synopsis
errors package is a collection of errors that are used in the storage package.
errors package is a collection of errors that are used in the storage package.

Jump to

Keyboard shortcuts

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