MCPcopy
hub / github.com/kopia/kopia / setup

Method setup

cli/command_repository_set_parameters.go:41–68  ·  view source on GitHub ↗
(svc appServices, parent commandParent)

Source from the content-addressed store, hash-verified

39}
40
41func (c *commandRepositorySetParameters) setup(svc appServices, parent commandParent) {
42 cmd := parent.Command("set-parameters", "Set repository parameters.").Alias("set-params")
43
44 cmd.Flag("max-pack-size-mb", "Set max pack file size").PlaceHolder("MB").IntVar(&c.maxPackSizeMB)
45 cmd.Flag("index-version", "Set version of index format used for writing").IntVar(&c.indexFormatVersion)
46 cmd.Flag("retention-mode", "Set the blob retention-mode for supported storage backends.").EnumVar(&c.retentionMode, "none", blob.Governance.String(), blob.Compliance.String())
47 cmd.Flag("retention-period", "Set the blob retention-period for supported storage backends.").DurationVar(&c.retentionPeriod)
48
49 cmd.Flag("upgrade", "Upgrade repository to the latest stable format").BoolVar(&c.upgradeRepositoryFormat)
50
51 cmd.Flag("epoch-refresh-frequency", "Epoch refresh frequency").DurationVar(&c.epochRefreshFrequency)
52 cmd.Flag("epoch-min-duration", "Minimal duration of a single epoch").DurationVar(&c.epochMinDuration)
53 cmd.Flag("epoch-cleanup-safety-margin", "Epoch cleanup safety margin").DurationVar(&c.epochCleanupSafetyMargin)
54 cmd.Flag("epoch-advance-on-count", "Advance epoch if the number of indexes exceeds given threshold").IntVar(&c.epochAdvanceOnCount)
55 cmd.Flag("epoch-advance-on-size-mb", "Advance epoch if the total size of indexes exceeds given threshold").Int64Var(&c.epochAdvanceOnSizeMB)
56 cmd.Flag("epoch-delete-parallelism", "Epoch delete parallelism").IntVar(&c.epochDeleteParallelism)
57 cmd.Flag("epoch-checkpoint-frequency", "Epoch range-compaction period").PlaceHolder("number-of-epochs").IntVar(&c.epochCheckpointFrequency)
58
59 if svc.enableTestOnlyFlags() {
60 cmd.Flag("add-required-feature", "Add required feature which must be present to open the repository").Hidden().StringVar(&c.addRequiredFeature)
61 cmd.Flag("remove-required-feature", "Remove required feature").Hidden().StringVar(&c.removeRequiredFeature)
62 cmd.Flag("warn-on-missing-required-feature", "Only warn (instead of failing) when the required feature is missing").Hidden().BoolVar(&c.warnOnMissingRequiredFeature)
63 }
64
65 cmd.Action(svc.directRepositoryWriteAction(c.run))
66
67 c.svc = svc
68}
69
70func setSizeMBParameter[I ~int | ~int32 | ~int64 | ~uint | ~uint32 | ~uint64](ctx context.Context, v I, desc string, dst *I, anyChange *bool) {
71 if v == 0 {

Callers

nothing calls this directly

Calls 4

CommandMethod · 0.80
enableTestOnlyFlagsMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected