Help us shape the future of Go! Take the 2026 Go Developer Survey

cache

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package cache is a bounded TTL cache for verification outcomes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	AddImage(trustPolicy string, imageRef string, result types.Image) error

	GetImage(trustPolicy string, imageRef string) (*types.Image, bool)

	AddAttestation(trustPolicy string, imageRef string, attestationType string, conditions []kyvernov1.AnyAllConditions) error

	GetAttestation(trustPolicy string, imageRef string, attestationType string, conditions []kyvernov1.AnyAllConditions) bool

	Clear()

	// Close stops the background goroutines of the cache.
	Close()
}

func New

func New(options ...Option) (Cache, error)

type Option

type Option = func(*cache) error

func WithCacheEnabled

func WithCacheEnabled(b bool) Option

func WithLogger

func WithLogger(l *zap.SugaredLogger) Option

func WithMaxSize

func WithMaxSize(s int64) Option

func WithTTLDuration

func WithTTLDuration(t time.Duration) Option

Jump to

Keyboard shortcuts

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