cache

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2025 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CachedPublication

type CachedPublication struct {
	*pub.Publication
	Remote bool
}

CachedPublication implements Evictable

func EncapsulatePublication

func EncapsulatePublication(pub *pub.Publication, remote bool) *CachedPublication

func (*CachedPublication) OnEvict

func (cp *CachedPublication) OnEvict()

type Evictable

type Evictable interface {
	OnEvict()
}

type LocalCache

type LocalCache interface {
	Set(key string, data Evictable)
	Get(key string) (Evictable, bool)
	Del(key string)
}

type TinyLFU

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

func NewTinyLFU

func NewTinyLFU(size int, ttl time.Duration) *TinyLFU

func (*TinyLFU) Del

func (c *TinyLFU) Del(key string)

func (*TinyLFU) Get

func (c *TinyLFU) Get(key string) (Evictable, bool)

func (*TinyLFU) Set

func (c *TinyLFU) Set(key string, b Evictable)

func (*TinyLFU) UseRandomizedTTL

func (c *TinyLFU) UseRandomizedTTL(offset time.Duration)

Jump to

Keyboard shortcuts

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