MCPcopy
hub / github.com/pocketbase/pocketbase / prepareInternalAction

Function prepareInternalAction

apis/batch.go:485–496  ·  view source on GitHub ↗
(activeApp core.App, ir *core.InternalRequest, optNext func(data any) error)

Source from the content-addressed store, hash-verified

483}
484
485func prepareInternalAction(activeApp core.App, ir *core.InternalRequest, optNext func(data any) error) (HandleFunc, map[string]string, bool) {
486 full := strings.ToUpper(ir.Method) + " " + ir.URL
487
488 for re, actionFactory := range ValidBatchActions {
489 params, ok := findNamedMatches(re, full)
490 if ok {
491 return actionFactory(activeApp, ir, params, optNext), params, true
492 }
493 }
494
495 return nil, nil, false
496}
497
498func findNamedMatches(re *regexp.Regexp, str string) (map[string]string, bool) {
499 match := re.FindStringSubmatch(str)

Callers 1

processInternalRequestFunction · 0.85

Calls 1

findNamedMatchesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…