Documentation
¶
Overview ¶
SPDX-License-Identifier: MIT Purpose: attachment store with SHA-256 dedup and magic-byte MIME detection. Supports images (PNG, JPEG, GIF), PDFs, and text. Backed by filesystem (no bbolt needed; files are content-addressed by hash).
Index ¶
Constants ¶
View Source
const ( MaxSize = 50 * 1024 * 1024 DefaultExpiry = 30 * 24 * time.Hour )
Variables ¶
View Source
var ( ErrTooLarge = errors.New("attachment exceeds 50MB") ErrNotFound = errors.New("attachment not found") )
Functions ¶
This section is empty.
Types ¶
type Attachment ¶
type Attachment struct {
ID string `json:"id"`
Hash string `json:"hash"`
Name string `json:"name"`
MIME string `json:"mime"`
Size int64 `json:"size"`
Path string `json:"path"`
Created time.Time `json:"created"`
ExpiresAt time.Time `json:"expires_at"`
}
func (*Attachment) IsImage ¶
func (a *Attachment) IsImage() bool
func (*Attachment) Marker ¶
func (a *Attachment) Marker() string
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func NewStoreAt ¶
func (*Store) AttachReader ¶
Click to show internal directories.
Click to hide internal directories.