cache

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2020 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrLocked = errors.New("locked")
)
View Source
var NoUpdateLastUsed noUpdateLastUsed

Functions

func CachePolicyDefault added in v0.6.4

func CachePolicyDefault(m withMetadata) error

func CachePolicyRetain

func CachePolicyRetain(m withMetadata) error

func GetCreatedAt

func GetCreatedAt(si *metadata.StorageItem) time.Time

func GetDescription

func GetDescription(si *metadata.StorageItem) string

func GetLayerType

func GetLayerType(m withMetadata) string

func GetRecordType

func GetRecordType(m withMetadata) client.UsageRecordType

func HasCachePolicyRetain

func HasCachePolicyRetain(m withMetadata) bool

func IsLocked

func IsLocked(err error) bool

func IsNotFound

func IsNotFound(err error) bool

func MigrateV2 added in v0.6.4

func MigrateV2(ctx context.Context, from, to string, cs content.Store, s snapshot.Snapshotter, lm leases.Manager) error

func SetLayerType

func SetLayerType(m withMetadata, value string) error

func SetRecordType

func SetRecordType(m withMetadata, value client.UsageRecordType) error

Types

type Accessor

type Accessor interface {
	GetByBlob(ctx context.Context, desc ocispec.Descriptor, parent ImmutableRef, opts ...RefOption) (ImmutableRef, error)
	Get(ctx context.Context, id string, opts ...RefOption) (ImmutableRef, error)

	New(ctx context.Context, parent ImmutableRef, opts ...RefOption) (MutableRef, error)
	GetMutable(ctx context.Context, id string) (MutableRef, error) // Rebase?
	IdentityMapping() *idtools.IdentityMapping
	Metadata(string) *metadata.StorageItem
}

type Controller

type Controller interface {
	DiskUsage(ctx context.Context, info client.DiskUsageInfo) ([]*client.UsageInfo, error)
	Prune(ctx context.Context, ch chan client.UsageInfo, info ...client.PruneInfo) error
}

type ExternalRefChecker

type ExternalRefChecker interface {
	Exists(string, []digest.Digest) bool
}

type ExternalRefCheckerFunc

type ExternalRefCheckerFunc func() (ExternalRefChecker, error)

type ImmutableRef

type ImmutableRef interface {
	Ref
	Parent() ImmutableRef
	Finalize(ctx context.Context, commit bool) error // Make sure reference is flushed to driver
	Clone() ImmutableRef

	Info() RefInfo
	SetBlob(ctx context.Context, desc ocispec.Descriptor) error
	Extract(ctx context.Context) error // +progress
}

type Manager

type Manager interface {
	Accessor
	Controller
	Close() error
}

func NewManager

func NewManager(opt ManagerOpt) (Manager, error)

type ManagerOpt

type ManagerOpt struct {
	Snapshotter     snapshot.Snapshotter
	MetadataStore   *metadata.Store
	ContentStore    content.Store
	LeaseManager    leases.Manager
	PruneRefChecker ExternalRefCheckerFunc
	GarbageCollect  func(ctx context.Context) (gc.Stats, error)
	Applier         diff.Applier
}

type Mountable

type Mountable interface {
	Mount(ctx context.Context, readonly bool) (snapshot.Mountable, error)
}

type MutableRef

type MutableRef interface {
	Ref
	Commit(context.Context) (ImmutableRef, error)
}

type Ref

type Ref interface {
	Mountable
	ID() string
	Release(context.Context) error
	Size(ctx context.Context) (int64, error)
	Metadata() *metadata.StorageItem
	IdentityMapping() *idtools.IdentityMapping
}

Ref is a reference to cacheable objects.

type RefInfo added in v0.6.4

type RefInfo struct {
	SnapshotID  string
	ChainID     digest.Digest
	BlobChainID digest.Digest
	DiffID      digest.Digest
	Blob        digest.Digest
	MediaType   string
	Extracted   bool
}

type RefOption

type RefOption interface{}

func WithCreationTime

func WithCreationTime(tm time.Time) RefOption

func WithDescription

func WithDescription(descr string) RefOption

func WithRecordType

func WithRecordType(t client.UsageRecordType) RefOption

Directories

Path Synopsis
v1

Jump to

Keyboard shortcuts

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