Documentation ¶
Overview ¶
Package http provides an HTTP Handler for the imageserver package
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewParametersHashETagFunc ¶
func NewParametersHashETagFunc(newHashFunc func() hash.Hash) func(parameters imageserver.Parameters) string
NewParametersHashETagFunc returns a function that hashes the parameters and returns an ETag value
Types ¶
type Error ¶
Error represent an http error
func NewErrorWithText ¶
NewErrorWithText creates an Error
type ImageHTTPHandler ¶
type ImageHTTPHandler struct { Parser // parse request to Parameters ImageServer imageserver.ImageServerInterface // handle image requests ETagFunc func(parameters imageserver.Parameters) string // optional Expire time.Duration // set the "Expires" header, optional RequestFunc func(request *http.Request) error // allows to handle incoming requests (and eventually return an error), optional HeaderFunc func(header http.Header, request *http.Request, err error) // allows to set custom headers, optional ErrorFunc func(err error, request *http.Request) // allows to handle internal errors, optional ResponseFunc func(request *http.Request, statusCode int, contentSize int64, err error) // allows to handle returned responses, optional }
ImageHTTPHandler represents an HTTP Handler for imageserver.Server
func (*ImageHTTPHandler) ServeHTTP ¶
func (handler *ImageHTTPHandler) ServeHTTP(writer http.ResponseWriter, request *http.Request)
ServeHTTP implements the HTTP Handler interface
Only GET and HEAD methods are supported.
Supports ETag/If-None-Match (status code 304). It doesn't check if the image really exists.
type Parser ¶
type Parser interface {
Parse(*http.Request, imageserver.Parameters) error
}
Parser represents a http parser
It parses the Tequest and fill Parameters.
Directories ¶
Path | Synopsis |
---|---|
parser
|
|
graphicsmagick
Package graphicsmagick provides a GraphicsMagick http Parser
|
Package graphicsmagick provides a GraphicsMagick http Parser |
list
Package list provides a list of http Parser
|
Package list provides a list of http Parser |
source
Package source provides an http Parser that takes the "source" parameter from query
|
Package source provides an http Parser that takes the "source" parameter from query |
sourcepath
Package sourcepath provides an http Parser that takes the "source" parameter from the path
|
Package sourcepath provides an http Parser that takes the "source" parameter from the path |
Click to show internal directories.
Click to hide internal directories.