MCPcopy Index your code
hub / github.com/coder/coder / Duration

TypeAlias Duration

coderd/httpapi/json.go:17–17  ·  view source on GitHub ↗

Duration wraps time.Duration and provides better JSON marshaling and unmarshalling. The default time.Duration marshals as an integer and only accepts integers when unmarshalling, which is not very user friendly as users cannot write durations like "1h30m". This type marshals as a string like "1h30m

Source from the content-addressed store, hash-verified

15// This type marshals as a string like "1h30m", and unmarshals from either a
16// string or an integer.
17type Duration time.Duration
18
19var (
20 _ json.Marshaler = Duration(0)

Callers 15

TestDurationFunction · 0.92
Test_ResultsFunction · 0.92
ResultMethod · 0.92
ResultsMethod · 0.92
Test_ConfigFunction · 0.92
Test_RunnerFunction · 0.92
Test_ConfigFunction · 0.92
config.goFile · 0.92
Test_RunnerFunction · 0.92
Test_ConfigFunction · 0.92
Test_RunnerFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected