MCPcopy
hub / github.com/grpc-ecosystem/grpc-gateway / timeoutUnitToDuration

Function timeoutUnitToDuration

runtime/context.go:312–329  ·  view source on GitHub ↗
(u uint8)

Source from the content-addressed store, hash-verified

310}
311
312func timeoutUnitToDuration(u uint8) (d time.Duration, ok bool) {
313 switch u {
314 case 'H':
315 return time.Hour, true
316 case 'M':
317 return time.Minute, true
318 case 'S':
319 return time.Second, true
320 case 'm':
321 return time.Millisecond, true
322 case 'u':
323 return time.Microsecond, true
324 case 'n':
325 return time.Nanosecond, true
326 default:
327 return
328 }
329}
330
331// isPermanentHTTPHeader checks whether hdr belongs to the list of
332// permanent request headers maintained by IANA.

Callers 1

timeoutDecodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected