cache

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TtlOnce

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

TtlOnce is a cache where new insertions do not overwrite the old insertion.

func NewTtlOnce

func NewTtlOnce(ttl time.Duration, clock clock.Clock) *TtlOnce

func (*TtlOnce) Add

func (cache *TtlOnce) Add(key string, value any)

func (*TtlOnce) Get

func (cache *TtlOnce) Get(key string) (any, bool)

func (*TtlOnce) RunCleanupLoop

func (cache *TtlOnce) RunCleanupLoop(ctx context.Context, logger logrus.FieldLogger)

func (*TtlOnce) Size

func (cache *TtlOnce) Size() int

Jump to

Keyboard shortcuts

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