MCPcopy Create free account
hub / github.com/buggregator/server / registerAttachmentsForModule

Function registerAttachmentsForModule

internal/server/http/attachments.go:28–32  ·  view source on GitHub ↗
(mux *http.ServeMux, db *sql.DB, store *storage.AttachmentStore, prefix, table string)

Source from the content-addressed store, hash-verified

26}
27
28func registerAttachmentsForModule(mux *http.ServeMux, db *sql.DB, store *storage.AttachmentStore, prefix, table string) {
29 mux.HandleFunc("GET "+prefix+"/{uuid}", listAttachments(db, table))
30 mux.HandleFunc("GET "+prefix+"/{eventUuid}/{uuid}", downloadAttachment(db, store, table))
31 mux.HandleFunc("GET "+prefix+"/{eventUuid}/preview/{uuid}", previewAttachment(db, store, table))
32}
33
34func listAttachments(db *sql.DB, table string) http.HandlerFunc {
35 return func(w http.ResponseWriter, r *http.Request) {

Callers 1

RegisterAttachmentAPIFunction · 0.85

Calls 3

listAttachmentsFunction · 0.85
downloadAttachmentFunction · 0.85
previewAttachmentFunction · 0.85

Tested by

no test coverage detected