static

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

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

func NewHandlers(cfg *viper.Viper, imageStore img.Store) *Handlers

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL