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

Function GetStringParam

pkg/tools/builtin/utils.go:27–34  ·  view source on GitHub ↗

GetStringParam 获取字符串参数的通用函数

(input map[string]any, key string, defaultValue string)

Source from the content-addressed store, hash-verified

25
26// GetStringParam 获取字符串参数的通用函数
27func GetStringParam(input map[string]any, key string, defaultValue string) string {
28 if value, exists := input[key]; exists {
29 if str, ok := value.(string); ok {
30 return str
31 }
32 }
33 return defaultValue
34}
35
36// GetIntParam 获取整数参数的通用函数
37func GetIntParam(input map[string]any, key string, defaultValue int) int {

Callers 14

parseQuestionsMethod · 0.85
parseOptionsMethod · 0.85
ExecuteMethod · 0.85
ExecuteMethod · 0.85
ExecuteMethod · 0.85
ExecuteMethod · 0.85
ExecuteMethod · 0.85
ExecuteMethod · 0.85
ExecuteMethod · 0.85
runTaskMethod · 0.85
ExecuteMethod · 0.85
ExecuteMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected