cache

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ZeroizeString

func ZeroizeString(s *string)

Best-effort zeroize when replacing strings (Go GC caveats apply).

Types

type Cache

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

func New

func New(ttl time.Duration) *Cache

func (*Cache) CleanupExpired

func (c *Cache) CleanupExpired() int

CleanupExpired removes expired entries from the cache

func (*Cache) Clear

func (c *Cache) Clear() int

Clear removes all entries from the cache with secure zeroization

func (*Cache) DecInFlight

func (c *Cache) DecInFlight()

func (*Cache) Get

func (c *Cache) Get(key string) (string, bool, time.Time, time.Time)

func (*Cache) IncHit

func (c *Cache) IncHit()

func (*Cache) IncInFlight

func (c *Cache) IncInFlight()

func (*Cache) IncMiss

func (c *Cache) IncMiss()

func (*Cache) Set

func (c *Cache) Set(key, val string)

func (*Cache) Stats

func (c *Cache) Stats() (size int, hits, misses int64, inflight int)

func (*Cache) TTL

func (c *Cache) TTL() time.Duration

Jump to

Keyboard shortcuts

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