{"modulePath":"github.com/OpenSIN-Code/SIN-Code-Bundle","version":"v1.9.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package attachments\n\nSPDX-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).\n\n## Constants\n\n```go\nconst (\n\tMaxSize       = 50 * 1024 * 1024\n\tDefaultExpiry = 30 * 24 * time.Hour\n)\n```\n\n## Variables\n\n```go\nvar (\n\tErrTooLarge = errors.New(\"attachment exceeds 50MB\")\n\tErrNotFound = errors.New(\"attachment not found\")\n)\n```\n\n## Types\n\n```go\ntype Attachment struct {\n\tID        string    `json:\"id\"`\n\tHash      string    `json:\"hash\"`\n\tName      string    `json:\"name\"`\n\tMIME      string    `json:\"mime\"`\n\tSize      int64     `json:\"size\"`\n\tPath      string    `json:\"path\"`\n\tCreated   time.Time `json:\"created\"`\n\tExpiresAt time.Time `json:\"expires_at\"`\n}\n```\n\n```go\nfunc (a *Attachment) IsImage() bool\n```\n\n```go\nfunc (a *Attachment) Marker() string\n```\n\n```go\ntype Store struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewStore() (*Store, error)\n```\n\n```go\nfunc NewStoreAt(dir string) (*Store, error)\n```\n\n```go\nfunc (s *Store) Attach(srcPath string) (*Attachment, error)\n```\n\n```go\nfunc (s *Store) AttachReader(r io.Reader, name string, size int64) (*Attachment, error)\n```\n\n```go\nfunc (s *Store) BaseDir() string\n```\n\n```go\nfunc (s *Store) Get(hash string) (*Attachment, error)\n```\n\n```go\nfunc (s *Store) Prune() (int, error)\n```\n\n","path":"github.com/OpenSIN-Code/SIN-Code-Bundle/cmd/sin-code/internal/attachments","name":"attachments","synopsis":"SPDX-License-Identifier: MIT Purpose: attachment store with SHA-256 dedup and magic-byte MIME detection.","isRedistributable":true}
