MCPcopy
hub / github.com/smallstep/cli / ParseTimeDuration

Function ParseTimeDuration

flags/flags.go:585–596  ·  view source on GitHub ↗

ParseTimeDuration parses the not-before and not-after flags as a timeDuration

(ctx *cli.Context)

Source from the content-addressed store, hash-verified

583
584// ParseTimeDuration parses the not-before and not-after flags as a timeDuration
585func ParseTimeDuration(ctx *cli.Context) (notBefore, notAfter api.TimeDuration, err error) {
586 var zero api.TimeDuration
587 notBefore, err = api.ParseTimeDuration(ctx.String("not-before"))
588 if err != nil {
589 return zero, zero, errs.InvalidFlagValue(ctx, "not-before", ctx.String("not-before"), "")
590 }
591 notAfter, err = api.ParseTimeDuration(ctx.String("not-after"))
592 if err != nil {
593 return zero, zero, errs.InvalidFlagValue(ctx, "not-after", ctx.String("not-after"), "")
594 }
595 return
596}
597
598// ParseTemplateData parses the set and set-file flags and returns a json
599// message to be used in certificate templates.

Callers 5

SignMethod · 0.92
createNewOrderRequestFunction · 0.92
GetCertificateMethod · 0.92
loginActionFunction · 0.92
certificateActionFunction · 0.92

Calls 1

StringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…