MCPcopy Create free account
hub / github.com/apache/openwhisk-cli / IsValidApiVerb

Function IsValidApiVerb

commands/api.go:63–76  ·  view source on GitHub ↗
(verb string)

Source from the content-addressed store, hash-verified

61var ApiGwAccessToken string
62
63func IsValidApiVerb(verb string) (error, bool) {
64 // Is the API verb valid?
65 if _, ok := whisk.ApiVerbs[strings.ToUpper(verb)]; !ok {
66 whisk.Debug(whisk.DbgError, "Invalid API verb: '%s'\n", verb)
67 errMsg := wski18n.T("'{{.verb}}' is not a valid API verb. Valid values are: {{.verbs}}",
68 map[string]interface{}{
69 "verb": verb,
70 "verbs": reflect.ValueOf(whisk.ApiVerbs).MapKeys()})
71 whiskErr := whisk.MakeWskError(errors.New(errMsg), whisk.EXIT_CODE_ERR_GENERAL,
72 whisk.DISPLAY_MSG, whisk.DISPLAY_USAGE)
73 return whiskErr, false
74 }
75 return nil, true
76}
77
78func hasPathPrefix(path string) (error, bool) {
79 if !strings.HasPrefix(path, "/") {

Callers 2

api.goFile · 0.85
parseApiFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected