cache

package
v0.0.0-...-c447edc Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

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
}
var Instance *Cache

func NewCache

func NewCache() *Cache

func (*Cache) Get

func (c *Cache) Get(id string) *CacheItem

func (*Cache) GetState

func (c *Cache) GetState() *CacheState

func (*Cache) Set

func (c *Cache) Set(id string, value float64)

func (*Cache) Start

func (c *Cache) Start()

type CacheItem

type CacheItem struct {
	Value           float64
	LastAccessDTSec int64
	TimeToLiveSec   int64
}

type CacheState

type CacheState struct {
	CountOfItems   int
	LastClearDTStr string
	ClearCount     int
	GetCount       int
	SetCount       int
	RemoveCount    int
}

Jump to

Keyboard shortcuts

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