cache

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

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