Documentation ¶
Index ¶
- Variables
- func HandleDimsStatus(config EnvironmentConfig, debug bool, dev bool, w http.ResponseWriter, ...)
- func Handler(kernel Kernel, config Config, w http.ResponseWriter, r *http.Request)
- type Command
- type Config
- type EdgeControl
- type EnvironmentConfig
- type Error
- type Image
- type Kernel
- type Operation
- type Options
- type OriginCacheControl
- type OutputFormat
- type Request
- func (r *Request) FetchImage() error
- func (r *Request) ProcessImage() (string, []byte, error)
- func (r *Request) SendError(w http.ResponseWriter, status int, message string)
- func (r *Request) SendHeaders(w http.ResponseWriter)
- func (r *Request) SendImage(w http.ResponseWriter, status int, imageFormat string, imageBlob []byte) error
- type Signing
- type Timeout
Constants ¶
This section is empty.
Variables ¶
View Source
var CmykIccProfile []byte = []byte{}/* 557164 elements not displayed */
View Source
var RgbIccProfile []byte = []byte{}/* 560 elements not displayed */
Functions ¶
func HandleDimsStatus ¶
func HandleDimsStatus(config EnvironmentConfig, debug bool, dev bool, w http.ResponseWriter, r *http.Request)
Types ¶
type Config ¶
type Config struct { DevelopmentMode bool DebugMode bool EtagAlgorithm string EnvironmentConfig }
type EdgeControl ¶
type EdgeControl struct {
DownstreamTtl int `env:"DIMS_EDGE_CONTROL_DOWNSTREAM_TTL" envDefault:"0"`
}
type EnvironmentConfig ¶
type EnvironmentConfig struct { Timeout EdgeControl Signing Error OriginCacheControl OutputFormat Options }
func ReadConfig ¶
func ReadConfig() EnvironmentConfig
type Image ¶
type Image struct { Bytes []byte // The downloaded image. Size int // The original image size in bytes. Format string // The original image format. Status int // The HTTP status code of the downloaded image. CacheControl string // The cache headers from the downloaded image. EdgeControl string // The edge control headers from the downloaded image. LastModified string // The last modified header from the downloaded image. Etag string // The etag header from the downloaded image. }
type OriginCacheControl ¶
type OriginCacheControl struct { UseOrigin bool `env:"DIMS_CACHE_CONTROL_USE_ORIGIN" envDefault:"false"` Min int `env:"DIMS_CACHE_CONTROL_MIN" envDefault:"0"` Max int `env:"DIMS_CACHE_CONTROL_MAX" envDefault:"0"` Default int `env:"DIMS_CACHE_CONTROL_DEFAULT" envDefault:"31536000"` Error int `env:"DIMS_CACHE_CONTROL_ERROR" envDefault:"60"` }
type OutputFormat ¶
type Request ¶
type Request struct { Id string // The hash of the request -> hash(clientId + commands + imageUrl). Signature string // The signature of the request. Config Config // The global configuration. ClientId string // The client ID of this request. ImageUrl string // The image URL that is being manipulated. SendContentDisposition bool // The content disposition of the request. Commands []Command // The commands (resize, crop, etc). Error bool // Whether the error image is being served. SourceImage Image // The source image. }
func (*Request) FetchImage ¶
FetchImage downloads the image from the given URL.
func (*Request) ProcessImage ¶
ProcessImage will execute the commands on the image.
func (*Request) SendError ¶
func (r *Request) SendError(w http.ResponseWriter, status int, message string)
func (*Request) SendHeaders ¶
func (r *Request) SendHeaders(w http.ResponseWriter)
Click to show internal directories.
Click to hide internal directories.