Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MountDebug ¶ added in v1.3.3
MountDebug will mount pprof routes on the passed in mux.
func MountEndpoint ¶
MountEndpoint mounts an endpoint on the mux and logs out the action.
func Serve ¶
func Serve(opts *ServerOpts) error
Serve creates and starts a new server to provide image resizing services.
func Tracer ¶ added in v1.3.0
func Tracer(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
Tracer adds opentracing spanning to each incoming request.
Types ¶
type ServerOpts ¶
type ServerOpts struct { // Addr is the address to listen for http requests on. Addr string // Debug enables pprof endpoints and debug logs. Debug bool // DisableMetrics disables Prometheus endpoints. DisableMetrics bool // Backends is the comma separated <host>,<origin> where <origin> is a pathname // or a url (with scheme) to load images from. Backends []string // OriginCache is the reference to the cache source for origin based // backends. OriginCache string // CacheTimeout is the time that images will have cache headers for when // writing them out to the http response. CacheTimeout time.Duration // CORSDomains are the permitted domains that will be permitted to make // CORS requests from. CORSDomains []string // SigningSecret is used to mount a signing middleware on the image // processing domain to only allow signed requests through. SigningSecret string // IncludePath when true will add the path component to the signing value // when request signing has been enabled. IncludePath bool }
ServerOpts is the options for starting a new Server.
Click to show internal directories.
Click to hide internal directories.