Documentation
¶
Overview ¶
Package attachment provides file storage for channel attachments. Files are stored on the local filesystem under {stateDir}/attachments/{id}/{filename}. This is a stop-gap implementation; the storage backend can be swapped later.
Index ¶
Constants ¶
View Source
const MaxFileSize = 50 * 1024 * 1024
MaxFileSize is the default maximum file size (50MB).
View Source
const MaxFilesPerMessage = 5
MaxFilesPerMessage is the default maximum number of attachments per message.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Metadata ¶
type Metadata struct {
CreatedAt time.Time `json:"created_at"`
ID string `json:"id"`
Filename string `json:"filename"`
MIMEType string `json:"mime_type"`
Channel string `json:"channel"`
Sender string `json:"sender"`
Size int64 `json:"size"`
}
Metadata holds information about a stored attachment.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store manages attachment file storage on the local filesystem.
func (*Store) AddSharedDir ¶
AddSharedDir adds a directory to search when looking up files by name. Files in shared dirs are served by filename (not by hex ID).
Click to show internal directories.
Click to hide internal directories.