MCPcopy Create free account
hub / github.com/conforma/cli / ParseEffectiveTime

Function ParseEffectiveTime

internal/validate/vsa/validator.go:250–257  ·  view source on GitHub ↗

ParseEffectiveTime parses the effective time string

(effectiveTime string)

Source from the content-addressed store, hash-verified

248
249// ParseEffectiveTime parses the effective time string
250func ParseEffectiveTime(effectiveTime string) (time.Time, error) {
251 switch effectiveTime {
252 case "now":
253 return time.Now().UTC(), nil
254 default:
255 return time.Parse(time.RFC3339, effectiveTime)
256 }
257}
258
259// ExtractImageDigest extracts image digest from identifier
260func ExtractImageDigest(identifier string) string {

Callers 4

TestParseEffectiveTimeFunction · 0.92
TestParseEffectiveTimeFunction · 0.85

Calls 1

ParseMethod · 0.80

Tested by 3

TestParseEffectiveTimeFunction · 0.74
TestParseEffectiveTimeFunction · 0.68