Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileServer ¶
func FileServer(r chi.Router, path string, fs http.FileSystem)
FileServer sets up a http.FileServer handler to serve static files from a a http.FileSystem.
Types ¶
type Handlers ¶
type Handlers struct {
// contains filtered or unexported fields
}
Handlers represents a group of http handlers in charge of handling static files operations.
func NewHandlers ¶
NewHandlers creates a new Handlers instance.
func (*Handlers) Image ¶
func (h *Handlers) Image(w http.ResponseWriter, r *http.Request)
Image is an http handler that serves images stored in the database.
func (*Handlers) SaveImage ¶
func (h *Handlers) SaveImage(w http.ResponseWriter, r *http.Request)
SaveImage is an http handler that stores the provided image returning its id.
func (*Handlers) ServeIndex ¶
func (h *Handlers) ServeIndex(w http.ResponseWriter, r *http.Request)
ServeIndex is an http handler that serves the index.html file.
Click to show internal directories.
Click to hide internal directories.