MCPcopy Index your code
hub / github.com/dnote/dnote / V3Index

Method V3Index

pkg/server/controllers/notes.go:145–156  ·  view source on GitHub ↗

V3Index is a v3 handler for getting notes

(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

143
144// V3Index is a v3 handler for getting notes
145func (n *Notes) V3Index(w http.ResponseWriter, r *http.Request) {
146 result, _, err := n.getNotes(r)
147 if err != nil {
148 handleJSONError(w, err, "getting notes")
149 return
150 }
151
152 respondJSON(w, http.StatusOK, GetNotesResponse{
153 Notes: presenters.PresentNotes(result.Notes),
154 Total: result.Total,
155 })
156}
157
158func (n *Notes) getNote(r *http.Request) (database.Note, error) {
159 user := context.User(r.Context())

Callers

nothing calls this directly

Calls 4

getNotesMethod · 0.95
PresentNotesFunction · 0.92
handleJSONErrorFunction · 0.85
respondJSONFunction · 0.85

Tested by

no test coverage detected