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

cache

package
v1.74.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: Apache-2.0 Imports: 31 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

	ListPackageCustomSchemas(ctx context.Context, schema, packageName string, sender func(*structpb.Struct) error) 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
}

type ValidationError added in v1.69.0

type ValidationError struct {
	Err error
}

ValidationError is returned by ListPackageCustomSchemas for invalid schema or packageName inputs.

func (*ValidationError) Error added in v1.69.0

func (e *ValidationError) Error() string

func (*ValidationError) Unwrap added in v1.69.0

func (e *ValidationError) Unwrap() error

Jump to

Keyboard shortcuts

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