cache

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultTTL is the default TTL for cache items.
	// It matches the default TTL of docker.io registry.
	DefaultTTL = 6 * time.Hour
)

Functions

func Get

func Get(key string) (any, bool)

func Set

func Set(key string, value any, opts ...Option)

Types

type Cache

type Cache interface {
	Set(key string, value any, opts ...Option)
	Get(key string) (any, bool)
	Close() error
}

func New

func New() Cache

type Option

type Option func(*item)

func WithTTL

func WithTTL(d time.Duration) Option

Jump to

Keyboard shortcuts

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