cache

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package cache allows to

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

Cache management

func NewCache

func NewCache() *Cache

NewCache creates a new cache instance

func (*Cache) CleanupByPrefix

func (c *Cache) CleanupByPrefix(prefix string) int

CleanupByPrefix deletes all cache values with a given key prefix

func (*Cache) CleanupEverything

func (c *Cache) CleanupEverything()

CleanupEverything resets the cache

func (*Cache) Delete

func (c *Cache) Delete(key string)

Delete deletes a cache value

func (*Cache) Get

func (c *Cache) Get(key string) (interface{}, bool)

Get gets a value from the cache

func (*Cache) GetValue

func (c *Cache) GetValue(key string) interface{}

GetValue gets a value without specifying if it existed in the cache

func (*Cache) Set

func (c *Cache) Set(key string, value interface{})

Set sets a value in the cache

Jump to

Keyboard shortcuts

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