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

Method Time3339Nano

coderd/httpapi/queryparams.go:247–252  ·  view source on GitHub ↗

Time uses the default time format of RFC3339Nano and always returns a UTC time.

(vals url.Values, def time.Time, queryParam string)

Source from the content-addressed store, hash-verified

245
246// Time uses the default time format of RFC3339Nano and always returns a UTC time.
247func (p *QueryParamParser) Time3339Nano(vals url.Values, def time.Time, queryParam string) time.Time {
248 layout := time.RFC3339Nano
249 // All search queries are forced to lowercase. But the RFC format requires
250 // upper case letters. So just uppercase the term.
251 return p.timeWithMutate(vals, def, queryParam, layout, strings.ToUpper)
252}
253
254func (p *QueryParamParser) timeWithMutate(vals url.Values, def time.Time, queryParam, layout string, mutate func(term string) string) time.Time {
255 v, err := parseQueryParam(p, vals, func(term string) (time.Time, error) {

Callers 6

TestParseQueryParamsFunction · 0.95
ConnectionLogsFunction · 0.95
UsersFunction · 0.95
WorkspacesFunction · 0.95
AIBridgeInterceptionsFunction · 0.95
AIBridgeSessionsFunction · 0.95

Calls 1

timeWithMutateMethod · 0.95

Tested by 1

TestParseQueryParamsFunction · 0.76