Documentation
¶
Overview ¶
Package mediahost validates uploads and owns the media directory.
Index ¶
Constants ¶
View Source
const DefaultMaxSize = 128 << 20
DefaultMaxSize bounds an upload when the library is not given its own cap.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Dir is the directory uploads land in. Empty refuses every upload.
Dir string
// MaxSize bounds one upload in bytes. Zero applies [DefaultMaxSize].
MaxSize int64
}
Config carries what a library needs to own its directory.
type Library ¶
type Library struct {
// contains filtered or unexported fields
}
Library owns the media directory uploads land in.
type Refusal ¶
type Refusal struct {
// Code names the rule the upload broke, for a client that translates it.
Code string
// Reason names the rule the upload broke, in words fit for an admin screen.
Reason string
// Detail is what went wrong underneath, for the log.
Detail error
}
Refusal reports an upload turned away, carrying the reason an operator reads.
Click to show internal directories.
Click to hide internal directories.