MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / handleGetDbConfigFunction

Method handleGetDbConfigFunction

rest/admin_functions_api.go:34–47  ·  view source on GitHub ↗

GET config: a single user function

()

Source from the content-addressed store, hash-verified

32
33// GET config: a single user function
34func (h *handler) handleGetDbConfigFunction() error {
35 functionName := h.PathVar("function")
36 if config, etagVersion, err := h.getDBConfig(); err != nil {
37 return err
38 } else if config.UserFunctions == nil {
39 return base.HTTPErrorf(http.StatusNotFound, "")
40 } else if functionConfig, found := config.UserFunctions.Definitions[functionName]; !found {
41 return base.HTTPErrorf(http.StatusNotFound, "")
42 } else {
43 h.writeJSON(functionConfig)
44 h.setEtag(etagVersion)
45 return nil
46 }
47}
48
49// PUT/DELETE config: user function(s)
50func (h *handler) handlePutDbConfigFunctions() error {

Callers

nothing calls this directly

Calls 5

PathVarMethod · 0.95
getDBConfigMethod · 0.95
writeJSONMethod · 0.95
setEtagMethod · 0.95
HTTPErrorfFunction · 0.92

Tested by

no test coverage detected