handler

package
v0.0.0-...-694dc98 Latest Latest
Warning

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

Go to latest
Published: May 18, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

ErrorStatusCodes maps commonly returned errors to HTTP status codes

Functions

This section is empty.

Types

type FaceDetectionService

type FaceDetectionService interface {
	Detect(io.Reader) (facedetection.FaceDetection, error)
}

FaceDetectionService provides an interface to the service that deals with face detection

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler provides an generic interface for handling HTTP requests.

func New

func New(services Services) *Handler

New returns a new Handler.

func (*Handler) Error

func (handler *Handler) Error(w http.ResponseWriter, r *http.Request, err error)

func (*Handler) ServeHTTP

func (handler *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP handles every incoming HTTP request and passes the request along to the configured HTTP router.

type ImageFetcherService

type ImageFetcherService interface {
	FetchImageByURL(string) (io.Reader, error)
}

ImageFetcherService provides an interface to the service that deals with fetching images

type Services

type Services struct {
	FaceDetection FaceDetectionService
	ImageFetcher  ImageFetcherService
}

Services describe the external services that the Handler relies on.

Jump to

Keyboard shortcuts

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