MCPcopy Index your code
hub / github.com/perkeep/perkeep / parseCamliPath

Function parseCamliPath

pkg/serverinit/serverinit.go:98–105  ·  view source on GitHub ↗

parseCamliPath looks for "/camli/" in the path and returns what follows it (the action).

(path string)

Source from the content-addressed store, hash-verified

96// parseCamliPath looks for "/camli/" in the path and returns
97// what follows it (the action).
98func parseCamliPath(path string) (action string, err error) {
99 camIdx := strings.Index(path, camliPrefix)
100 if camIdx == -1 {
101 return "", ErrCamliPath
102 }
103 action = path[camIdx+len(camliPrefix):]
104 return
105}
106
107func unsupportedHandler(rw http.ResponseWriter, req *http.Request) {
108 httputil.BadRequestError(rw, "Unsupported Perkeep path or method.")

Callers 1

makeCamliHandlerFunction · 0.85

Calls 1

IndexMethod · 0.80

Tested by

no test coverage detected