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

Function applyPolicyNumber64

cli/command_policy_set.go:256–283  ·  view source on GitHub ↗
(ctx context.Context, desc string, val *int64, str string, changeCount *int)

Source from the content-addressed store, hash-verified

254}
255
256func applyPolicyNumber64(ctx context.Context, desc string, val *int64, str string, changeCount *int) error {
257 if str == "" {
258 // not changed
259 return nil
260 }
261
262 if str == inheritPolicyString || str == defaultPolicyString {
263 *changeCount++
264
265 log(ctx).Infof(" - resetting %q to a default value inherited from parent.", desc)
266
267 *val = 0
268
269 return nil
270 }
271
272 v, err := strconv.ParseInt(str, 10, 64)
273 if err != nil {
274 return errors.Wrapf(err, "can't parse the %q %q", desc, str)
275 }
276
277 *changeCount++
278
279 log(ctx).Infof(" - setting %q to %v.", desc, v)
280 *val = v
281
282 return nil
283}
284
285func applyPolicyBoolPtr(ctx context.Context, desc string, val **policy.OptionalBool, str string, changeCount *int) error {
286 if str == "" {

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…