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

Method handlePutDesignDoc

rest/view_api.go:54–66  ·  view source on GitHub ↗

HTTP handler for PUT _design/$ddoc

()

Source from the content-addressed store, hash-verified

52
53// HTTP handler for PUT _design/$ddoc
54func (h *handler) handlePutDesignDoc() error {
55 ddocID := h.PathVar("ddoc")
56 var ddoc sgbucket.DesignDoc
57 err := h.readJSONInto(&ddoc)
58 if err != nil {
59 return err
60 }
61 if err = h.db.PutDesignDoc(h.ctx(), ddocID, ddoc); err != nil {
62 return err
63 }
64 h.writeStatus(http.StatusCreated, "OK")
65 return nil
66}
67
68// HTTP handler for DELETE _design/$ddoc
69func (h *handler) handleDeleteDesignDoc() error {

Callers

nothing calls this directly

Calls 5

PathVarMethod · 0.95
readJSONIntoMethod · 0.95
ctxMethod · 0.95
writeStatusMethod · 0.95
PutDesignDocMethod · 0.80

Tested by

no test coverage detected