store

package
v3.1.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheManager

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

func NewCacheManager

func NewCacheManager(name, cacheFile string, dumpInterval time.Duration, maxCacheSize int, enableDump bool) (*CacheManager, error)

NewCacheManager creates a new CacheManager instance. It initializes the cache manager with the provided parameters and starts a routine for cache dumping.

func (*CacheManager) Delete

func (cm *CacheManager) Delete(key string)

Delete removes the value associated with the given key from the cache.

func (*CacheManager) Get

func (cm *CacheManager) Get(key string) (interface{}, bool)

Get retrieves the value associated with the given key from the cache.

func (*CacheManager) GetAll

func (cm *CacheManager) GetAll() map[string]interface{}

GetAll returns all the key-value pairs in the cache.

func (*CacheManager) Set

func (cm *CacheManager) Set(key string, value interface{})

Set sets the value associated with the given key in the cache.

func (*CacheManager) StopDump

func (cm *CacheManager) StopDump()

type Item

type Item struct {
	Key   string
	Value interface{}
}

Jump to

Keyboard shortcuts

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