Documentation
¶
Index ¶
- Variables
- func EnsureLease(ctx context.Context) (context.Context, error)
- func HasLazyLease(ctx context.Context) bool
- func IsNotFound(err error) bool
- func MakeTemporary(l *leases.Lease) error
- func WithLazyLease(ctx context.Context, lm leases.Manager, opts ...leases.Opt) (context.Context, func(context.Context) error, error)
- func WithLease(ctx context.Context, ls leases.Manager, opts ...leases.Opt) (context.Context, func(context.Context) error, error)
- func WithoutLazyLease(ctx context.Context) context.Context
- type Accessor
- type Diff
- type ExportChain
- type ExportLayer
- type ImmutableRef
- type ImportImageOpts
- type ImportedImage
- type ImportedLayerBlobKey
- type ImportedLayerBlobRow
- type ImportedLayerDiffKey
- type ImportedLayerDiffRow
- type LeaseManager
- func (l *LeaseManager) AddResource(ctx context.Context, lease leases.Lease, resource leases.Resource) error
- func (l *LeaseManager) Create(ctx context.Context, opts ...leases.Opt) (leases.Lease, error)
- func (l *LeaseManager) Delete(ctx context.Context, lease leases.Lease, opts ...leases.DeleteOpt) error
- func (l *LeaseManager) DeleteResource(ctx context.Context, lease leases.Lease, resource leases.Resource) error
- func (l *LeaseManager) List(ctx context.Context, filters ...string) ([]leases.Lease, error)
- func (l *LeaseManager) ListResources(ctx context.Context, lease leases.Lease) ([]leases.Resource, error)
- func (l *LeaseManager) Namespace() string
- func (l *LeaseManager) WithNamespace(ns string) *LeaseManager
- type LeaseRef
- type LocalMounterOpt
- type MergeSnapshotter
- type MetadataStore
- type Mountable
- type MountableRef
- type Mounter
- type MutableRef
- type PersistentMetadataRows
- type Ref
- type RefMetadata
- type RefOption
- type SnapshotContentRow
- type SnapshotManager
- type SnapshotManagerOpt
- type SnapshotRecordMetadata
- type Snapshotter
- type Value
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrLocked = errors.New("locked")
)
View Source
var ErrNoBlobs = errors.Errorf("no blobs for snapshot")
View Source
var NoUpdateLastUsed noUpdateLastUsed
Functions ¶
func HasLazyLease ¶
func IsNotFound ¶
func MakeTemporary ¶
func WithLazyLease ¶
Types ¶
type Accessor ¶
type Accessor interface {
MetadataStore
Get(ctx context.Context, id string, opts ...RefOption) (ImmutableRef, error)
GetBySnapshotID(ctx context.Context, snapshotID string, opts ...RefOption) (ImmutableRef, error)
New(ctx context.Context, parent ImmutableRef, opts ...RefOption) (MutableRef, error)
GetMutable(ctx context.Context, id string, opts ...RefOption) (MutableRef, error) // Rebase?
GetMutableBySnapshotID(ctx context.Context, snapshotID string, opts ...RefOption) (MutableRef, error)
ImportImage(ctx context.Context, img *ImportedImage, opts ImportImageOpts) (ImmutableRef, error)
ApplySnapshotDiff(ctx context.Context, lower, upper ImmutableRef, opts ...RefOption) (ImmutableRef, error)
Merge(ctx context.Context, parents []ImmutableRef, opts ...RefOption) (ImmutableRef, error)
}
type ExportChain ¶
type ExportChain struct {
Layers []ExportLayer
Provider content.InfoReaderProvider
}
type ExportLayer ¶
type ExportLayer struct {
Descriptor ocispecs.Descriptor
Description string
CreatedAt *time.Time
}
type ImmutableRef ¶
type ImportImageOpts ¶
type ImportImageOpts struct {
ImageRef string
RecordType client.UsageRecordType
}
type ImportedImage ¶
type ImportedImage struct {
Ref string
ManifestDesc ocispecs.Descriptor
ConfigDesc ocispecs.Descriptor
Layers []ocispecs.Descriptor
Nonlayers []ocispecs.Descriptor
}
type ImportedLayerBlobKey ¶
type ImportedLayerBlobRow ¶
type ImportedLayerDiffKey ¶
type ImportedLayerDiffRow ¶
type LeaseManager ¶
type LeaseManager struct {
// contains filtered or unexported fields
}
func NewLeaseManager ¶
func NewLeaseManager(lm leases.Manager, ns string) *LeaseManager
func (*LeaseManager) AddResource ¶
func (*LeaseManager) DeleteResource ¶
func (*LeaseManager) ListResources ¶
func (*LeaseManager) Namespace ¶
func (l *LeaseManager) Namespace() string
func (*LeaseManager) WithNamespace ¶
func (l *LeaseManager) WithNamespace(ns string) *LeaseManager
type LocalMounterOpt ¶
type LocalMounterOpt func(*localMounter)
func ForceRemount ¶
func ForceRemount() LocalMounterOpt
type MergeSnapshotter ¶
type MergeSnapshotter interface {
Snapshotter
Merge(ctx context.Context, key string, diffs []Diff, opts ...snapshots.Opt) error
}
func NewMergeSnapshotter ¶
func NewMergeSnapshotter(ctx context.Context, sn Snapshotter, lm leases.Manager) MergeSnapshotter
type MetadataStore ¶
type Mountable ¶
type Mountable interface {
Mount(ctx context.Context, readonly bool) (MountableRef, error)
}
type MountableRef ¶
type MountableRef = executor.MountableRef
type Mounter ¶
func LocalMounter ¶
func LocalMounter(mountable MountableRef, opts ...LocalMounterOpt) Mounter
func LocalMounterWithMounts ¶
func LocalMounterWithMounts(mounts []mount.Mount, opts ...LocalMounterOpt) Mounter
type MutableRef ¶
type PersistentMetadataRows ¶
type PersistentMetadataRows struct {
SnapshotContent []SnapshotContentRow
ImportedByBlob []ImportedLayerBlobRow
ImportedByDiff []ImportedLayerDiffRow
}
type Ref ¶
type Ref interface {
Mountable
ID() string
SnapshotID() string
Release(context.Context) error
Size(context.Context) (int64, error)
}
Ref is a reference to cacheable objects.
type RefMetadata ¶
type RefMetadata interface {
ID() string
SnapshotID() string
GetDescription() string
SetDescription(string) error
GetCreatedAt() time.Time
SetCreatedAt(time.Time) error
GetLayerType() string
SetLayerType(string) error
GetRecordType() client.UsageRecordType
SetRecordType(client.UsageRecordType) error
// generic getters/setters for external packages
GetString(string) string
Get(string) *Value
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 SnapshotContentRow ¶
type SnapshotManager ¶
type SnapshotManager interface {
Accessor
SnapshotSize(ctx context.Context, snapshotID string) (int64, error)
SnapshotRecordMetadata(ctx context.Context, snapshotID string) (SnapshotRecordMetadata, bool, error)
AttachLease(ctx context.Context, leaseID, snapshotID string) error
RemoveLease(ctx context.Context, leaseID string) error
LoadPersistentMetadata(rows PersistentMetadataRows) error
PersistentMetadataRows() PersistentMetadataRows
DeleteStaleDaggerOwnerLeases(ctx context.Context, keep map[string]struct{}) error
Close() error
}
func NewSnapshotManager ¶
func NewSnapshotManager(opt SnapshotManagerOpt) (SnapshotManager, error)
type SnapshotManagerOpt ¶
type SnapshotRecordMetadata ¶
type SnapshotRecordMetadata struct {
RecordType client.UsageRecordType
Description string
}
type Snapshotter ¶
type Snapshotter interface {
Name() string
Mounts(ctx context.Context, key string) (MountableRef, error)
Prepare(ctx context.Context, key, parent string, opts ...snapshots.Opt) error
View(ctx context.Context, key, parent string, opts ...snapshots.Opt) (MountableRef, error)
Stat(ctx context.Context, key string) (snapshots.Info, error)
Update(ctx context.Context, info snapshots.Info, fieldpaths ...string) (snapshots.Info, error)
Usage(ctx context.Context, key string) (snapshots.Usage, error)
Commit(ctx context.Context, name, key string, opts ...snapshots.Opt) error
Remove(ctx context.Context, key string) error
Walk(ctx context.Context, fn snapshots.WalkFunc, filters ...string) error
Close() error
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.