MCPcopy Create free account
hub / github.com/kopia/kopia / applyPolicyBoolPtr

Function applyPolicyBoolPtr

cli/command_policy_set.go:285–314  ·  view source on GitHub ↗
(ctx context.Context, desc string, val **policy.OptionalBool, str string, changeCount *int)

Source from the content-addressed store, hash-verified

283}
284
285func applyPolicyBoolPtr(ctx context.Context, desc string, val **policy.OptionalBool, str string, changeCount *int) error {
286 if str == "" {
287 // not changed
288 return nil
289 }
290
291 if str == inheritPolicyString || str == defaultPolicyString {
292 *changeCount++
293
294 log(ctx).Infof(" - resetting %q to a default value inherited from parent.", desc)
295
296 *val = nil
297
298 return nil
299 }
300
301 v, err := strconv.ParseBool(str)
302 if err != nil {
303 return errors.Wrapf(err, "can't parse the %q %q", desc, str)
304 }
305
306 *changeCount++
307
308 log(ctx).Infof(" - setting %q to %v.", desc, v)
309
310 ov := policy.OptionalBool(v)
311 *val = &ov
312
313 return nil
314}
315
316func supportedCompressionAlgorithms() []string {
317 var res []string

Calls 1

OptionalBoolTypeAlias · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…