storage

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2024 License: Apache-2.0 Imports: 1 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 {
	// Close shuts down the storage.
	Close()

	// Get gets the value for the given key. If key does not exist, nil is returned.
	Get(key []byte) ([]byte, error)

	// Set stores the given value for the given key along with an expiration value, 0 means no expiration.
	Set(key []byte, val []byte, exp time.Duration) error

	// Delete deletes the value for the given key. No error is raised if key does not exist.
	Delete(key []byte) error

	// Reset deletes all the keys stored in the storage.
	Reset() error
}

Storage interface for communicating with different database/key-value providers

Jump to

Keyboard shortcuts

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