MCPcopy
hub / github.com/cloudflare/cloudflared / Duration

Method Duration

config/configuration.go:289–300  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

287}
288
289func (c *configFileSettings) Duration(name string) (time.Duration, error) {
290 if raw, ok := c.Settings[name]; ok {
291 switch v := raw.(type) {
292 case time.Duration:
293 return v, nil
294 case string:
295 return time.ParseDuration(v)
296 }
297 return 0, fmt.Errorf("expected duration found %T for %s", raw, name)
298 }
299 return 0, nil
300}
301
302func (c *configFileSettings) Float64(name string) (float64, error) {
303 if raw, ok := c.Settings[name]; ok {

Callers 15

TestConfigFileSettingsFunction · 0.95
wsFlakyEndpointFunction · 0.80
RegisterConnectionMethod · 0.80
registerUdpSessionMethod · 0.80
UnmarshalBinaryMethod · 0.80
DecodeLineFunction · 0.80
TestDecodeFunction · 0.80
DecodeLineFunction · 0.80
TestDecodeFunction · 0.80
validation.goFile · 0.80

Calls 1

ErrorfMethod · 0.80

Tested by 5

TestConfigFileSettingsFunction · 0.76
wsFlakyEndpointFunction · 0.64
TestDecodeFunction · 0.64
TestDecodeFunction · 0.64