MCPcopy
hub / github.com/PatchMon/PatchMon / getReqString

Function getReqString

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

getReqString returns string from req for key or altKey (camelCase fallback).

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

Source from the content-addressed store, hash-verified

730
731// getReqString returns string from req for key or altKey (camelCase fallback).
732func getReqString(req map[string]interface{}, key, altKey string) (string, bool) {
733 if v, ok := req[key].(string); ok && v != "" {
734 return v, true
735 }
736 if v, ok := req[altKey].(string); ok && v != "" {
737 return v, true
738 }
739 return "", false
740}
741
742// getReqStringOrEmpty returns string from req for key or altKey; ok is true if key exists (even if empty).
743func getReqStringOrEmpty(req map[string]interface{}, key, altKey string) (string, bool) {

Callers 3

applyOidcSettingsUpdateFunction · 0.85
applySettingsUpdateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected