MCPcopy
hub / github.com/kopia/kopia / appendRetentionPolicyRows

Function appendRetentionPolicyRows

cli/command_policy_show.go:142–153  ·  view source on GitHub ↗
(rows []policyTableRow, p *policy.Policy, def *policy.Definition)

Source from the content-addressed store, hash-verified

140}
141
142func appendRetentionPolicyRows(rows []policyTableRow, p *policy.Policy, def *policy.Definition) []policyTableRow {
143 return append(rows,
144 policyTableRow{"Retention:", "", ""},
145 policyTableRow{" Annual snapshots:", valueOrNotSet(p.RetentionPolicy.KeepAnnual), definitionPointToString(p.Target(), def.RetentionPolicy.KeepAnnual)},
146 policyTableRow{" Monthly snapshots:", valueOrNotSet(p.RetentionPolicy.KeepMonthly), definitionPointToString(p.Target(), def.RetentionPolicy.KeepMonthly)},
147 policyTableRow{" Weekly snapshots:", valueOrNotSet(p.RetentionPolicy.KeepWeekly), definitionPointToString(p.Target(), def.RetentionPolicy.KeepWeekly)},
148 policyTableRow{" Daily snapshots:", valueOrNotSet(p.RetentionPolicy.KeepDaily), definitionPointToString(p.Target(), def.RetentionPolicy.KeepDaily)},
149 policyTableRow{" Hourly snapshots:", valueOrNotSet(p.RetentionPolicy.KeepHourly), definitionPointToString(p.Target(), def.RetentionPolicy.KeepHourly)},
150 policyTableRow{" Latest snapshots:", valueOrNotSet(p.RetentionPolicy.KeepLatest), definitionPointToString(p.Target(), def.RetentionPolicy.KeepLatest)},
151 policyTableRow{" Ignore identical snapshots:", boolToString(p.RetentionPolicy.IgnoreIdenticalSnapshots.OrDefault(false)), definitionPointToString(p.Target(), def.RetentionPolicy.IgnoreIdenticalSnapshots)},
152 )
153}
154
155func boolToString(v bool) string {
156 if v {

Callers 2

printPolicyFunction · 0.85
populateRepositoryMethod · 0.85

Calls 5

valueOrNotSetFunction · 0.85
definitionPointToStringFunction · 0.85
boolToStringFunction · 0.85
TargetMethod · 0.80
OrDefaultMethod · 0.45

Tested by

no test coverage detected