cache

package
v0.0.325 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const VerifyCacheWrites = false

Variables

This section is empty.

Functions

func DigestBytes

func DigestBytes(contents []byte) (schema.Digest, error)

func IsDisabled added in v0.0.92

func IsDisabled(cache Cache) bool

func Prune

func Prune(ctx context.Context) error

Types

type Cache

type Cache interface {
	Bytes(context.Context, schema.Digest) ([]byte, error)
	Blob(schema.Digest) (ReaderAtCloser, error) // XXX No context is required here to make it simpler for Compressed() to call Blob().
	Stat(context.Context, schema.Digest) (CacheInfo, error)

	WriteBlob(context.Context, schema.Digest, io.ReadCloser) error
	WriteBytes(context.Context, schema.Digest, []byte) error

	LoadEntry(context.Context, schema.Digest) (CachedOutput, bool, error)
	StoreEntry(context.Context, []schema.Digest, CachedOutput) error
}
var NoCache Cache = noCache{}

func Local

func Local() (Cache, error)

type CacheInfo added in v0.0.81

type CacheInfo interface {
	Size() int64
}

type CachedOutput

type CachedOutput struct {
	Digest       schema.Digest
	Timestamp    time.Time
	CacheVersion int
	InputDigests map[string]string

	Debug struct {
		PackagePath, Typename string
	}
}

type ReaderAtCloser added in v0.0.108

type ReaderAtCloser interface {
	io.ReaderAt
	io.ReadCloser
}

Jump to

Keyboard shortcuts

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