Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
func FS ¶
func FS(fs filesystem.FileSystem) Option
type Server ¶
type Server struct { Database database.Database FileSystem filesystem.FileSystem Lifetime time.Duration Limit int64 PublicPath string // contains filtered or unexported fields }
Server acts as the HTTP server and configuration.
func (Server) ServeHTTP ¶
func (s Server) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP will serve HTTP requests. It first tries to determine if the request is for uploading, it then tries to serve static files and then will try to serve public files.
func (Server) UploadHandler ¶
func (s Server) UploadHandler(w http.ResponseWriter, r *http.Request)
UploadHandler write the contents of the "file" part to a filesystem.Reader, persists the entry to the database and writes the location of the file to the response.
Click to show internal directories.
Click to hide internal directories.