Documentation
¶
Overview ¶
Package media serves the uploaded files under /local--files/.
Index ¶
Constants ¶
const (
Prefix = "/local--files/"
)
const (
ResizedPrefix = "/local--resized-images/"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Attachments ¶
type Attachments interface {
ArticleFile(ctx context.Context, siteID int64, articleRef, fileName string) (*db.ArticleFile, error)
}
Attachments resolves an article attachment's on-disk names.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func New ¶
func New(root string, files Attachments) *Handler
New serves out of root, which is files/ itself rather than its media/ subdirectory; the request decides which of the two it lands in.
type ResizedHandler ¶
type ResizedHandler struct {
// contains filtered or unexported fields
}
func NewResized ¶
func NewResized(root string, files Attachments) *ResizedHandler
func (*ResizedHandler) ServeHTTP ¶
func (h *ResizedHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)