Documentation
¶
Index ¶
- Constants
- Variables
- func New() (*cli.Command, error)
- func RecordMigrationBatchSize(ctx context.Context, migrationType string, size int64)
- func RecordMigrationDuration(ctx context.Context, migrationType, operation string, duration float64)
- func RecordMigrationObject(ctx context.Context, migrationType, operation, result string)
- type ChunkWalker
- type NarInfoWalker
- type NarWalker
Constants ¶
const ( // Migration result constants for metrics. MigrationResultSuccess = "success" MigrationResultFailure = "failure" MigrationResultSkipped = "skipped" // Migration operation constants for metrics. MigrationOperationMigrate = "migrate" MigrationOperationDelete = "delete" // Migration type constants for metrics. MigrationTypeNarInfoToDB = "narinfo-to-db" MigrationTypeNarToChunks = "nar-to-chunks" )
Variables ¶
var ( // ErrXZBinAbsPath is returned when the xz binary path is not an absolute // path. ErrXZBinAbsPath = errors.New("the path to xz binary must be an absolute path") // ErrXZBinEmptyPath is returned when the xz binary path is empty. ErrXZBinEmptyPath = errors.New("--xz-binary-path cannot be empty") // Version defines the version of the binary, and is meant to be set with ldflags at build time. // //nolint:gochecknoglobals Version = "dev" )
var ( // ErrCacheMaxSizeRequired is returned if --cache-lru-schedule was given but not --cache-max-size. ErrCacheMaxSizeRequired = errors.New("--cache-max-size is required when --cache-lru-schedule is specified") // ErrStorageConfigRequired is returned if neither local nor S3 storage is configured. ErrStorageConfigRequired = errors.New("either --cache-storage-local or --cache-storage-s3-bucket is required") ErrS3ConfigIncomplete = errors.New( "S3 requires --cache-storage-s3-endpoint, --cache-storage-s3-access-key-id, and --cache-storage-s3-secret-access-key", ) // ErrStorageConflict is returned if both local and S3 storage are configured. ErrStorageConflict = errors.New("cannot use both --cache-storage-local and --cache-storage-s3-bucket") // ErrUpstreamCacheRequired is returned if no upstream cache is configured. ErrUpstreamCacheRequired = errors.New("at least one --cache-upstream-url is required") // ErrRedisAddrsRequired is returned when Redis backend is selected but no addresses are provided. ErrRedisAddrsRequired = errors.New("--cache-lock-backend=redis requires --cache-redis-addrs to be set") // ErrUnknownLockBackend is returned when an unknown lock backend is specified. ErrUnknownLockBackend = errors.New("unknown lock backend") )
var ErrFsckIssuesFound = errors.New("consistency issues found")
ErrFsckIssuesFound is returned when fsck finds consistency issues.
var ErrMigrationFailed = errors.New("narinfos failed to migrate")
ErrMigrationFailed is returned when one or more NarInfos fail to migrate.
var ErrStorageIterationNotSupported = errors.New("storage backend does not support iteration")
ErrStorageIterationNotSupported is returned when the storage backend does not support iteration.
var ErrUnmigratedNarinfosFound = errors.New("unmigrated narinfos found")
ErrUnmigratedNarinfosFound is returned when there are unmigrated narinfos.
Functions ¶
func RecordMigrationBatchSize ¶ added in v0.8.0
RecordMigrationBatchSize records the size of a migration batch. migrationType should be one of MigrationType* constants.
func RecordMigrationDuration ¶ added in v0.8.0
func RecordMigrationDuration(ctx context.Context, migrationType, operation string, duration float64)
RecordMigrationDuration records the duration of a migration operation. migrationType should be one of MigrationType* constants. operation should be one of MigrationOperation* constants. duration should be in seconds.
func RecordMigrationObject ¶ added in v0.8.1
RecordMigrationObject records an object migration operation. migrationType should be one of MigrationType* constants. operation should be one of MigrationOperation* constants. result should be one of MigrationResult* constants.
Types ¶
type ChunkWalker ¶ added in v0.9.2
ChunkWalker is implemented by chunk stores that support walking chunk files.