typing

package
v1.5.9 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: MIT Imports: 1 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config added in v1.1.5

type Config struct {
	Engine string
	Config interface{}
}

Config is the configuration used to create a new KV.

type KV

type KV interface {
	// Set sets the value for the given key.
	Set(key string, value any, maxAge ...time.Duration) error
	// Get returns the value for the given key.
	Get(key string, value any) error
	// Delete deletes the value for the given key.
	Delete(key string) error
	// Has returns true if the given key exists in the kv.
	Has(key string) bool
	// Keys returns the keys of the kv.
	Keys() []string
	// Size returns the number of entries in the kv.
	Size() int
	// Clear clears the kv.
	Clear() error
	// ForEach iterates over the map and calls the given function for each entry.
	ForEach(func(key string, value any))
}

KV is a Key-Value Store

Jump to

Keyboard shortcuts

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