package cache
import "github.com/moby/buildkit/cache"
Index ¶
- Constants
- Variables
- func CachePolicyDefault(m *cacheMetadata) error
- func CachePolicyRetain(m *cacheMetadata) error
- func IsNotFound(err error) bool
- func MigrateV2(ctx context.Context, from, to string, cs content.Store, s snapshot.Snapshotter, lm leases.Manager) error
- type Accessor
- type Controller
- type DescHandler
- type DescHandlerKey
- type DescHandlers
- type ExternalRefChecker
- type ExternalRefCheckerFunc
- type ImmutableRef
- type Manager
- type ManagerOpt
- type MetadataStore
- type Mountable
- type MutableRef
- type NeedsRemoteProviderError
- type Ref
- type RefList
- type RefMetadata
- type RefOption
- func WithCreationTime(tm time.Time) RefOption
- func WithDescription(descr string) RefOption
- func WithImageRef(imageRef string) RefOption
- func WithRecordType(t client.UsageRecordType) RefOption
- type Unlazier
- type Unlazy
Constants ¶
const ( BaseLayer refKind = iota Layer Merge Diff )
Variables ¶
var NoUpdateLastUsed noUpdateLastUsed
Functions ¶
func CachePolicyDefault ¶
func CachePolicyDefault(m *cacheMetadata) error
func CachePolicyRetain ¶
func CachePolicyRetain(m *cacheMetadata) error
func IsNotFound ¶
func MigrateV2 ¶
func MigrateV2(ctx context.Context, from, to string, cs content.Store, s snapshot.Snapshotter, lm leases.Manager) error
Types ¶
type Accessor ¶
type Accessor interface {
MetadataStore
GetByBlob(ctx context.Context, desc ocispecs.Descriptor, parent ImmutableRef, opts ...RefOption) (ImmutableRef, error)
Get(ctx context.Context, id string, pg progress.Controller, opts ...RefOption) (ImmutableRef, error)
New(ctx context.Context, parent ImmutableRef, s session.Group, opts ...RefOption) (MutableRef, error)
GetMutable(ctx context.Context, id string, opts ...RefOption) (MutableRef, error) // Rebase?
IdentityMapping() *idtools.IdentityMapping
Merge(ctx context.Context, parents []ImmutableRef, pg progress.Controller, opts ...RefOption) (ImmutableRef, error)
Diff(ctx context.Context, lower, upper ImmutableRef, pg progress.Controller, opts ...RefOption) (ImmutableRef, error)
}
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 DescHandler ¶
type DescHandler struct {
Provider func(session.Group) content.Provider
Progress progress.Controller
SnapshotLabels map[string]string
Annotations map[string]string
Ref string // string representation of desc origin, can be used as a sync key
}
type DescHandlerKey ¶
type DescHandlers ¶
type DescHandlers map[digest.Digest]*DescHandler
type ExternalRefChecker ¶
type ExternalRefCheckerFunc ¶
type ExternalRefCheckerFunc func() (ExternalRefChecker, error)
type ImmutableRef ¶
type ImmutableRef interface {
Ref
Clone() ImmutableRef
// Finalize commits the snapshot to the driver if it's not already.
// This means the snapshot can no longer be mounted as mutable.
Finalize(context.Context) error
Extract(ctx context.Context, s session.Group) error // +progress
GetRemotes(ctx context.Context, createIfNeeded bool, cfg config.RefConfig, all bool, s session.Group) ([]*solver.Remote, error)
LayerChain() RefList
FileList(ctx context.Context, s session.Group) ([]string, error)
}
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
ContentStore content.Store
LeaseManager leases.Manager
PruneRefChecker ExternalRefCheckerFunc
GarbageCollect func(ctx context.Context) (gc.Stats, error)
Applier diff.Applier
Differ diff.Comparer
MetadataStore *metadata.Store
MountPoolRoot string
}
type MetadataStore ¶
type MetadataStore interface {
Search(context.Context, string) ([]RefMetadata, error)
}
type Mountable ¶
type Mountable interface {
Mount(ctx context.Context, readonly bool, s session.Group) (snapshot.Mountable, error)
}
type MutableRef ¶
type MutableRef interface {
Ref
Commit(context.Context) (ImmutableRef, error)
}
type NeedsRemoteProviderError ¶
func (NeedsRemoteProviderError) Error ¶
func (m NeedsRemoteProviderError) Error() string
type Ref ¶
type Ref interface {
Mountable
RefMetadata
Release(context.Context) error
IdentityMapping() *idtools.IdentityMapping
DescHandler(digest.Digest) *DescHandler
}
Ref is a reference to cacheable objects.
type RefList ¶
type RefList []ImmutableRef
func (RefList) Release ¶
type RefMetadata ¶
type RefMetadata interface {
ID() string
GetDescription() string
SetDescription(string) error
GetCreatedAt() time.Time
SetCreatedAt(time.Time) error
HasCachePolicyDefault() bool
SetCachePolicyDefault() error
HasCachePolicyRetain() bool
SetCachePolicyRetain() error
GetLayerType() string
SetLayerType(string) error
GetRecordType() client.UsageRecordType
SetRecordType(client.UsageRecordType) error
GetEqualMutable() (RefMetadata, bool)
// generic getters/setters for external packages
GetString(string) string
SetString(key, val, index string) error
GetExternal(string) ([]byte, error)
SetExternal(string, []byte) error
ClearValueAndIndex(string, string) error
}
type RefOption ¶
type RefOption interface{}
func WithCreationTime ¶
func WithDescription ¶
func WithImageRef ¶
WithImageRef appends the given imageRef to the cache ref's metadata
func WithRecordType ¶
func WithRecordType(t client.UsageRecordType) RefOption
type Unlazier ¶
type Unlazy ¶
Source Files ¶
blobs.go blobs_linux.go filelist.go manager.go metadata.go migrate_v2.go opts.go refs.go remote.go
Directories ¶
- Version
- v0.13.0-beta3
- Published
- Jan 31, 2024
- Platform
- linux/amd64
- Imports
- 58 packages
- Last checked
- 2 minutes ago –
Tools for package owners.