MCPcopy Create free account
hub / github.com/astercloud/aster / ValidateRequired

Function ValidateRequired

pkg/tools/builtin/utils.go:17–24  ·  view source on GitHub ↗

ValidateRequired 验证必需参数的通用函数

(input map[string]any, required []string)

Source from the content-addressed store, hash-verified

15
16// ValidateRequired 验证必需参数的通用函数
17func ValidateRequired(input map[string]any, required []string) error {
18 for _, key := range required {
19 if _, exists := input[key]; !exists {
20 return fmt.Errorf("missing required parameter: %s", key)
21 }
22 }
23 return nil
24}
25
26// GetStringParam 获取字符串参数的通用函数
27func GetStringParam(input map[string]any, key string, defaultValue string) string {

Callers 7

ExecuteMethod · 0.85
ExecuteMethod · 0.85
ExecuteMethod · 0.85
ExecuteMethod · 0.85
ExecuteMethod · 0.85
ExecuteMethod · 0.85
ExecuteMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected