Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrSnapshotAlreadyExists indicates that the snapshot already exists. ErrSnapshotAlreadyExists = errors.New("snapshot already exists") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// GC is the garbage collection configuration for the snapshotter.
GC GC
// RootDir is the root directory for the snapshotter.
RootDir string
// Metadata is the metadata configuration for the snapshotter.
Metadata Metadata
// Content is the content configuration for the snapshotter.
Content dragonfly.ContentProvider
// Dragonfly is the Dragonfly configuration for the snapshotter.
Dragonfly dragonfly.Dragonfly
// SnapshotConcurrency is the maximum number of concurrent snapshots.
SnapshotConcurrency *int
// RestoreConcurrency is the maximum number of concurrent restores.
RestoreConcurrency *int
}
Config defines the configuration for the snapshotter.
type File ¶
type File struct {
// RelativePath is the relative path of the file.
RelativePath string
// ReadOnly indicates whether the file is read-only.
ReadOnly bool
}
File defines the file information for snapshotting and restoring.
type GC ¶
type GC struct {
// Interval is the interval at which garbage collection is performed.
Interval *time.Duration
// DiskHighThresholdPercent is the percentage of disk space that triggers garbage collection.
DiskHighThresholdPercent *float64
// DiskLowThresholdPercent is the percentage of disk space that triggers garbage collection.
DiskLowThresholdPercent *float64
// BatchSize is the number of snapshots to process in each batch.
BatchSize *int
// MinRetentionPeriod is the minimum retention period for snapshots.
MinRetentionPeriod *time.Duration
}
GC defines the garbage collection configuration for the snapshotter.
type Metadata ¶
type Metadata struct {
// Registry is the OCI registry configuration for the snapshotter.
Registry oci.Registry
}
Metadata defines the metadata configuration for the snapshotter.
type Option ¶
type Option func(*Config)
Option is a function that configures the snapshotter.
func WithContent ¶
func WithContent(content dragonfly.ContentProvider) Option
WithContent configures the snapshotter with content.
func WithMetadata ¶
WithMetadata configures the snapshotter with metadata.
type RestoreRequest ¶
type RestoreRequest struct {
// Name is the name of the snapshot.
Name string
// Version is the version of the snapshot.
Version string
// OutputDir is the directory where the files will be restored.
OutputDir string
}
RestoreRequest defines the request parameters for restoring files from a snapshot.
type SnapshotRequest ¶
type SnapshotRequest struct {
// Name is the name of the snapshot.
Name string
// Version is the version of the snapshot.
Version string
// BaseDir is the base directory of the snapshot.
BaseDir string
// Files is the list of files to be included in the snapshot.
Files []File
}
SnapshotRequest defines the request parameters for creating a snapshot.
type Snapshotter ¶
type Snapshotter interface {
// Snapshot creates a snapshot of the specified files.
Snapshot(ctx context.Context, req *SnapshotRequest, opts ...Option) error
// Restore restores the specified files from the snapshot.
Restore(ctx context.Context, req *RestoreRequest, opts ...Option) error
}
Snapshotter is an interface that defines the methods for snapshotting and restoring files.
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
gc
* Copyright 2025 The Dragonfly Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
|
* Copyright 2025 The Dragonfly Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. |
|
metadata
* Copyright 2025 The Dragonfly Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
|
* Copyright 2025 The Dragonfly Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. |
|
mocks
|
|
|
pkg
|
|
|
dragonfly
* Copyright 2025 The Dragonfly Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
|
* Copyright 2025 The Dragonfly Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. |
|
fs
* Copyright 2025 The Dragonfly Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
|
* Copyright 2025 The Dragonfly Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. |
|
oci
* Copyright 2025 The Dragonfly Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
|
* Copyright 2025 The Dragonfly Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. |