Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var EncodingDefaults = map[string]encodingDefault{ "jpeg": { DesiredQuality: 85, // contains filtered or unexported fields }, "jpg": { DesiredQuality: 85, // contains filtered or unexported fields }, "png": { DesiredQuality: 3, // contains filtered or unexported fields }, }
EncodingDefaults are used to easily define the default values for a given encoding
View Source
var FunctionMappings = map[string]CVFunction{ "resize": ResizeMatrix, }
FunctionMappings maps an incoming id to the desired function
Functions ¶
func EncodeMatrix ¶
EncodeMatrix .
Types ¶
type AwsConfig ¶
type AwsConfig struct { S3Downloader *s3manager.Downloader Cache *cache.ImageCache CacheNamespace uuid.UUID }
AwsConfig configuration
func NewAwsConfig ¶
func NewAwsConfig(mc *cache.ImageCache) (*AwsConfig, error)
NewAwsConfig returns a new AWS configuration
type CVFunction ¶
CVFunction .
type ComplexHandlerJSON ¶
type ComplexHandlerJSON struct { Encoding string `json:"encoding"` Quality int `json:"quality"` Functions []struct { FunctionID string `json:"functionID"` Parameters []complexHandlerParameters `json:"parameters"` } `json:"functions"` }
ComplexHandlerJSON used to unmarshal
type Handler ¶
type Handler struct {
AwsConfig *AwsConfig
}
Handler for routes
func NewHandler ¶
NewHandler returns an initialised handler
func (*Handler) Complex ¶
func (h *Handler) Complex(w http.ResponseWriter, r *middleware.ProcessedRequest)
Complex handler takes json objects as input and 'curries' the matrix through the desired functions outlined in the json object
func (*Handler) Simple ¶
func (h *Handler) Simple(w http.ResponseWriter, r *middleware.ProcessedRequest)
Simple .
Click to show internal directories.
Click to hide internal directories.