cache

package
v3.67.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: AGPL-3.0 Imports: 0 Imported by: 0

Documentation

Overview

Package cache provides an interface which can be implemented by different cache types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	// Set stores the given key/value pair.
	Set(string, any)
	// Get returns the value for the given key and a boolean indicating if the key was found.
	Get(string) (any, bool)
	// Exists returns true if the given key exists in the cache.
	Exists(string) bool
	// Delete the given key from the cache.
	Delete(string)
	// Clear all key/value pairs from the cache.
	Clear()
	// Count the number of key/value pairs in the cache.
	Count() int
	// Keys returns all keys in the cache.
	Keys() []string
	// Values returns all values in the cache.
	Values() []any
	// Contents returns all keys in the cache encoded as a string.
	Contents() string
}

Cache is used to store key/value pairs.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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