Skip to main content

Module duration

Module duration 

Source
Expand description

A human-readable duration type for the pipeline configuration.

Every duration-shaped field in the pipeline configuration uses ConfigDuration, so that one format covers seconds, milliseconds, microseconds, and days instead of a different unit baked into each field name.

The syntax is the one Go’s time.ParseDuration documents, which many tools accept and users already know. Feldera extends it with a d (day) unit, because configuration values such as checkpoint retention are naturally expressed in days, and narrows it by rejecting a negative duration, which no configuration setting accepts.

Structs§

ConfigDuration
A duration written as a number and a unit, such as 500ms, 30s, 1h30m or 30d.

Enums§

LegacyUnit
The unit in which a setting’s superseded numeric spelling was written.
ParseError
Errors returned when parsing a ConfigDuration from a string.

Functions§

duration_from_legacy_number
Warns, once per setting per process, that a value arrived as a bare number, and returns the duration that number stands for.
duration_or_legacy_number
Deserializes a duration setting that also accepts the bare number its earlier spelling took.
duration_or_legacy_struct
Deserializes a duration setting whose earlier spelling was a Duration, which serde writes as a {secs, nanos} object.