kv

package
v3.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2022 License: MIT Imports: 1 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Constructor

type Constructor interface {
	// KvFromConfig provides Storage based on the config key
	KvFromConfig(key string) (Storage, error)
}

Constructor provides storage based on the config

type Storage

type Storage interface {
	// Has checks if value exists.
	Has(keys ...string) (map[string]bool, error)

	// Get loads value content into a byte slice.
	Get(key string) ([]byte, error)

	// MGet loads content of multiple values
	// Returns the map with existing keys and associated values
	MGet(keys ...string) (map[string][]byte, error)

	// Set used to upload item to KV with TTL
	// 0 value in TTL means no TTL
	Set(items ...*kvv1.Item) error

	// MExpire sets the TTL for multiply keys
	MExpire(items ...*kvv1.Item) error

	// TTL return the rest time to live for provided keys
	// Not supported for the memcached
	TTL(keys ...string) (map[string]string, error)

	// Clear clean the entire storage
	Clear() error

	// Delete one or multiple keys.
	Delete(keys ...string) error

	// Stop the storage driver
	Stop()
}

Storage represents single abstract storage.

Jump to

Keyboard shortcuts

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