Module duration

Source
Expand description

GEP-2257-compliant Duration type for Gateway API

gateway_api::Duration is a duration type where parsing and formatting obey GEP-2257. It is based on std::time::Duration and uses kube::core::Duration for the heavy lifting of parsing.

GEP-2257 defines a duration format for the Gateway API that is based on Go’s time.ParseDuration, with additional restrictions: negative durations, units smaller than millisecond, and floating point are not allowed, and durations are limited to four components of no more than five digits each. See https://gateway-api.sigs.k8s.io/geps/gep-2257 for the complete specification.

Structs§

Duration
GEP-2257-compliant Duration type for Gateway API

Functions§

is_valid
Checks if a duration is valid according to GEP-2257. If it’s not, return an error result explaining why the duration is not valid.