MCPcopy Index your code
hub / github.com/PatchMon/PatchMon / getReqFloat64

Function getReqFloat64

server-source-code/internal/handler/settings.go:765–773  ·  view source on GitHub ↗

getReqFloat64 returns float64 from req for key or altKey (for JSON numbers).

(req map[string]interface{}, key, altKey string)

Source from the content-addressed store, hash-verified

763
764// getReqFloat64 returns float64 from req for key or altKey (for JSON numbers).
765func getReqFloat64(req map[string]interface{}, key, altKey string) (float64, bool) {
766 if v, ok := req[key].(float64); ok {
767 return v, true
768 }
769 if v, ok := req[altKey].(float64); ok {
770 return v, true
771 }
772 return 0, false
773}
774
775// constructServerURL builds a server URL from protocol, host, and port.
776// Omits port for default ports (80 for http, 443 for https).

Callers 1

applySettingsUpdateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected