Versions in this module Expand all Collapse all v0 v0.21.0 May 22, 2026 Changes in this version + var ErrLocked = errors.New("locked") + var ErrNoBlobs = errors.Errorf("no blobs for snapshot") + var NoUpdateLastUsed noUpdateLastUsed + 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 interface + ApplySnapshotDiff func(ctx context.Context, lower, upper ImmutableRef, opts ...RefOption) (ImmutableRef, error) + Get func(ctx context.Context, id string, opts ...RefOption) (ImmutableRef, error) + GetBySnapshotID func(ctx context.Context, snapshotID string, opts ...RefOption) (ImmutableRef, error) + GetMutable func(ctx context.Context, id string, opts ...RefOption) (MutableRef, error) + GetMutableBySnapshotID func(ctx context.Context, snapshotID string, opts ...RefOption) (MutableRef, error) + ImportImage func(ctx context.Context, img *ImportedImage, opts ImportImageOpts) (ImmutableRef, error) + Merge func(ctx context.Context, parents []ImmutableRef, opts ...RefOption) (ImmutableRef, error) + New func(ctx context.Context, parent ImmutableRef, opts ...RefOption) (MutableRef, error) + type Diff struct + Comparison fsdiff.Comparison + Lower string + Upper string + type ExportChain struct + Layers []ExportLayer + Provider content.InfoReaderProvider + type ExportLayer struct + CreatedAt *time.Time + Description string + Descriptor ocispecs.Descriptor + type ImmutableRef interface + ExportChain func(ctx context.Context, cfg config.RefConfig) (*ExportChain, error) + type ImportImageOpts struct + ImageRef string + RecordType client.UsageRecordType + type ImportedImage struct + ConfigDesc ocispecs.Descriptor + Layers []ocispecs.Descriptor + ManifestDesc ocispecs.Descriptor + Nonlayers []ocispecs.Descriptor + Ref string + type ImportedLayerBlobKey struct + BlobDigest digest.Digest + ParentSnapshotID string + type ImportedLayerBlobRow struct + BlobDigest digest.Digest + ParentSnapshotID string + SnapshotID string + type ImportedLayerDiffKey struct + DiffID digest.Digest + ParentSnapshotID string + type ImportedLayerDiffRow struct + DiffID digest.Digest + ParentSnapshotID string + SnapshotID string + type LeaseManager struct + func NewLeaseManager(lm leases.Manager, ns string) *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 struct + func NewLease(ctx context.Context, lm leases.Manager, opts ...leases.Opt) (*LeaseRef, context.Context, error) + func (l *LeaseRef) Adopt(ctx context.Context) error + func (l *LeaseRef) Discard() error + type LocalMounterOpt func(*localMounter) + func ForceRemount() LocalMounterOpt + type MergeSnapshotter interface + Merge func(ctx context.Context, key string, diffs []Diff, opts ...snapshots.Opt) error + func NewMergeSnapshotter(ctx context.Context, sn Snapshotter, lm leases.Manager) MergeSnapshotter + type MetadataStore interface + Search func(context.Context, string, bool) ([]RefMetadata, error) + type Mountable interface + Mount func(ctx context.Context, readonly bool) (MountableRef, error) + type MountableRef = executor.MountableRef + type Mounter interface + Mount func() (string, error) + Unmount func() error + func LocalMounter(mountable MountableRef, opts ...LocalMounterOpt) Mounter + func LocalMounterWithMounts(mounts []mount.Mount, opts ...LocalMounterOpt) Mounter + type MutableRef interface + Commit func(context.Context) (ImmutableRef, error) + InvalidateSize func(context.Context) error + type PersistentMetadataRows struct + ImportedByBlob []ImportedLayerBlobRow + ImportedByDiff []ImportedLayerDiffRow + SnapshotContent []SnapshotContentRow + type Ref interface + ID func() string + Release func(context.Context) error + Size func(context.Context) (int64, error) + SnapshotID func() string + type RefMetadata interface + ClearValueAndIndex func(string, string) error + Get func(string) *Value + GetCreatedAt func() time.Time + GetDescription func() string + GetExternal func(string) ([]byte, error) + GetLayerType func() string + GetRecordType func() client.UsageRecordType + GetString func(string) string + ID func() string + SetCreatedAt func(time.Time) error + SetDescription func(string) error + SetExternal func(string, []byte) error + SetLayerType func(string) error + SetRecordType func(client.UsageRecordType) error + SetString func(key, val, index string) error + SnapshotID func() string + type RefOption interface + func WithCreationTime(tm time.Time) RefOption + func WithDescription(descr string) RefOption + func WithImageRef(imageRef string) RefOption + func WithRecordType(t client.UsageRecordType) RefOption + type SnapshotContentRow struct + Digest digest.Digest + SnapshotID string + type SnapshotManager interface + AttachLease func(ctx context.Context, leaseID, snapshotID string) error + Close func() error + DeleteStaleDaggerOwnerLeases func(ctx context.Context, keep map[string]struct{}) error + LoadPersistentMetadata func(rows PersistentMetadataRows) error + PersistentMetadataRows func() PersistentMetadataRows + RemoveLease func(ctx context.Context, leaseID string) error + SnapshotRecordMetadata func(ctx context.Context, snapshotID string) (SnapshotRecordMetadata, bool, error) + SnapshotSize func(ctx context.Context, snapshotID string) (int64, error) + func NewSnapshotManager(opt SnapshotManagerOpt) (SnapshotManager, error) + type SnapshotManagerOpt struct + Applier diff.Applier + ContentStore content.Store + Differ diff.Comparer + LeaseManager leases.Manager + MountPoolRoot string + Snapshotter Snapshotter + type SnapshotRecordMetadata struct + Description string + RecordType client.UsageRecordType + type Snapshotter interface + Close func() error + Commit func(ctx context.Context, name, key string, opts ...snapshots.Opt) error + Mounts func(ctx context.Context, key string) (MountableRef, error) + Name func() string + Prepare func(ctx context.Context, key, parent string, opts ...snapshots.Opt) error + Remove func(ctx context.Context, key string) error + Stat func(ctx context.Context, key string) (snapshots.Info, error) + Update func(ctx context.Context, info snapshots.Info, fieldpaths ...string) (snapshots.Info, error) + Usage func(ctx context.Context, key string) (snapshots.Usage, error) + View func(ctx context.Context, key, parent string, opts ...snapshots.Opt) (MountableRef, error) + Walk func(ctx context.Context, fn snapshots.WalkFunc, filters ...string) error + type Value struct + Index string + Value json.RawMessage + func NewValue(v interface{}) (*Value, error) + func (v *Value) Unmarshal(target interface{}) error