cache

package
v1.49.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 27 Imported by: 1

Documentation

Index

Constants

View Source
const FormatJSON = "json"
View Source
const (
	FormatPogrebV1 = "pogreb.v1"
)

Variables

This section is empty.

Functions

func LoadOrRebuild

func LoadOrRebuild(ctx context.Context, c Cache, fbc fs.FS) error

Types

type Cache

type Cache interface {
	registry.GRPCQuery

	CheckIntegrity(ctx context.Context, fbc fs.FS) error
	Build(ctx context.Context, fbc fs.FS) error
	Load(ctc context.Context) error
	Close() error
}

func New

func New(cacheDir string, cacheOpts ...CacheOption) (Cache, error)

New creates a new Cache. It chooses a cache implementation based on the files it finds in the cache directory, with a preference for the latest iteration of the cache implementation. If the cache directory is non-empty and a supported cache format is not found, an error is returned.

type CacheOption added in v1.41.0

type CacheOption func(*CacheOptions)

func WithFormat added in v1.47.0

func WithFormat(format string) CacheOption

func WithLog added in v1.41.0

func WithLog(log *logrus.Entry) CacheOption

type CacheOptions added in v1.41.0

type CacheOptions struct {
	Log    *logrus.Entry
	Format string
}

Jump to

Keyboard shortcuts

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