cache

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2025 License: Apache-2.0 Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetCacheSize

func SetCacheSize(size int) error

set Cache size called from cache component to set parameter before first use

Types

type CacheInterface

type CacheInterface interface {
	Get(key []byte) ([]byte, bool)
	Add(key []byte, value []byte)
}

func NewCacheParition

func NewCacheParition() (CacheInterface, error)

create a new cache partition initializes the cache if not already happened

type CacheNoop

type CacheNoop struct {
	CacheInterface
}

cache doing nothing

func (*CacheNoop) Add

func (c *CacheNoop) Add(key []byte, value []byte)

func (*CacheNoop) Get

func (c *CacheNoop) Get(key []byte) ([]byte, bool)

type CachePartition

type CachePartition struct {
	CacheInterface
	// contains filtered or unexported fields
}

cache using the fastcache instance

func (*CachePartition) Add

func (c *CachePartition) Add(key []byte, value []byte)

func (*CachePartition) Get

func (c *CachePartition) Get(key []byte) ([]byte, bool)

type Stats

type Stats struct {
	*fastcache.Stats

	// Number of handles
	NumHandles uint64
}

func GetStats

func GetStats() *Stats

get fastcache statistics

Jump to

Keyboard shortcuts

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