CEL duration type. Stores duration as microseconds internally. Supports Go-style duration string parsing and arithmetic.
Summary
Functions
Add two durations. Returns {:ok, duration} | {:error, msg}.
Creates a duration from seconds and optional nanos.
Create duration from total nanoseconds.
Get a component of the duration.
Check if duration is within valid range.
Negate a duration.
Creates a duration from microseconds.
Parses a Go-style duration string. Supports: h, m, s, ms, us, ns suffixes. Optional negative prefix. Examples: "3600s", "1h30m", "500ms", "-1.5s", "1h2m3s4ms5us6ns"
Subtract two durations. Returns {:ok, duration} | {:error, msg}.
Convert to proto representation {seconds, nanos}.
Convert to canonical string (seconds with optional fractional nanos).
Convert duration to total nanoseconds.
Types
Functions
Add two durations. Returns {:ok, duration} | {:error, msg}.
Creates a duration from seconds and optional nanos.
Create duration from total nanoseconds.
Get a component of the duration.
Check if duration is within valid range.
Negate a duration.
Creates a duration from microseconds.
Parses a Go-style duration string. Supports: h, m, s, ms, us, ns suffixes. Optional negative prefix. Examples: "3600s", "1h30m", "500ms", "-1.5s", "1h2m3s4ms5us6ns"
Subtract two durations. Returns {:ok, duration} | {:error, msg}.
Convert to proto representation {seconds, nanos}.
Convert to canonical string (seconds with optional fractional nanos).
Convert duration to total nanoseconds.