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

Method Get

internal/storage/attachments.go:52–64  ·  view source on GitHub ↗

Get retrieves attachment content.

(path string)

Source from the content-addressed store, hash-verified

50
51// Get retrieves attachment content.
52func (s *AttachmentStore) Get(path string) ([]byte, error) {
53 if s.mode == "filesystem" {
54 return os.ReadFile(filepath.Join(s.dir, path))
55 }
56
57 s.mu.RLock()
58 defer s.mu.RUnlock()
59 data, ok := s.files[path]
60 if !ok {
61 return nil, fmt.Errorf("attachment not found: %s", path)
62 }
63 return data, nil
64}
65
66// GetReader returns a reader for the attachment.
67func (s *AttachmentStore) GetReader(path string) (io.ReadCloser, error) {

Callers 10

GetReaderMethod · 0.95
RegisterAPIFunction · 0.45
detectEventTypeFunction · 0.45
ServeHTTPMethod · 0.45
downloadAttachmentFunction · 0.45
previewAttachmentFunction · 0.45
CORSMiddlewareFunction · 0.45

Calls

no outgoing calls

Tested by 3