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

Method handlePutDbConfigFunctions

rest/admin_functions_api.go:50–64  ·  view source on GitHub ↗

PUT/DELETE config: user function(s)

()

Source from the content-addressed store, hash-verified

48
49// PUT/DELETE config: user function(s)
50func (h *handler) handlePutDbConfigFunctions() error {
51 var functionsConfig *functions.FunctionsConfig
52 if h.rq.Method != "DELETE" {
53 if err := h.readJSONInto(&functionsConfig); err != nil {
54 return err
55 }
56 }
57 return h.mutateDbConfig(func(dbConfig *DbConfig) error {
58 if functionsConfig == nil && dbConfig.UserFunctions == nil {
59 return base.HTTPErrorf(http.StatusNotFound, "")
60 }
61 dbConfig.UserFunctions = functionsConfig
62 return nil
63 })
64}
65
66// PUT/DELETE config: a single user function
67func (h *handler) handlePutDbConfigFunction() error {

Callers

nothing calls this directly

Calls 3

readJSONIntoMethod · 0.95
mutateDbConfigMethod · 0.95
HTTPErrorfFunction · 0.92

Tested by

no test coverage detected