Documentation
¶
Index ¶
- Variables
- func DecryptAES128GCM(key []byte, base64EncryptedText string) (string, error)
- func DecryptURL(url string) (string, error)
- func DecryptURLKey(secretKey string, url string) (string, error)
- func EncryptAES128GCM(key []byte, plaintext string) (string, error)
- func EncryptURLKey(secretKey string, url string) (string, error)
- func ErrorImage(color string) (*vips.ImageRef, error)
- func NewJpegExportParams(options JpegCompression, stripMetadata bool) *vips.JpegExportParams
- func NewPngExportParams(options PngCompression, stripMetadata bool) *vips.PngExportParams
- func NewWebpExportParams(options WebpCompression, stripMetadata bool) *vips.WebpExportParams
- func RegisterImageBackend(sourceBackend SourceBackend)
- type Config
- type EdgeControl
- type Error
- type FileSource
- type Image
- type ImageOutputOptions
- type JpegCompression
- type Options
- type OriginCacheControl
- type OutputFormat
- type PngCompression
- type S3
- type Signer
- type Signing
- type Source
- type SourceBackend
- type StatusError
- type Timeout
- type WebpCompression
Constants ¶
This section is empty.
Variables ¶
View Source
var ImageTypes = map[string]vips.ImageType{ "gif": vips.ImageTypeGIF, "jpeg": vips.ImageTypeJPEG, "jpg": vips.ImageTypeJPEG, "png": vips.ImageTypePNG, "tiff": vips.ImageTypeTIFF, "webp": vips.ImageTypeWEBP, "heif": vips.ImageTypeHEIF, "svg": vips.ImageTypeSVG, "psd": vips.ImageTypePSD, }
View Source
var Version = "v0.0.0"
Functions ¶
func DecryptAES128GCM ¶
DecryptAES128GCM takes a base64-encoded ciphertext and decrypts it using AES-128-GCM. The input must be encoded as: IV (12 bytes) | Ciphertext | Tag (16 bytes).
func DecryptURL ¶
func DecryptURLKey ¶ added in v0.7.2
DecryptURLKey decrypts the given eurl string using a derived AES-128-GCM key.
func EncryptAES128GCM ¶
EncryptAES128GCM encrypts the given plaintext using AES-128-GCM with the provided key. The result is base64-encoded and includes IV (12 bytes) | ciphertext | tag (16 bytes).
func EncryptURLKey ¶ added in v0.7.2
func NewJpegExportParams ¶
func NewJpegExportParams(options JpegCompression, stripMetadata bool) *vips.JpegExportParams
func NewPngExportParams ¶
func NewPngExportParams(options PngCompression, stripMetadata bool) *vips.PngExportParams
func NewWebpExportParams ¶
func NewWebpExportParams(options WebpCompression, stripMetadata bool) *vips.WebpExportParams
func RegisterImageBackend ¶ added in v0.6.0
func RegisterImageBackend(sourceBackend SourceBackend)
Types ¶
type Config ¶
type Config struct {
BindAddress string `env:"DIMS_BIND_ADDRESS" envDefault:":8080"`
DevelopmentMode bool `env:"DIMS_DEVELOPMENT_MODE" envDefault:"false"`
DebugMode bool `env:"DIMS_DEBUG_MODE" envDefault:"false"`
LogFormat string `env:"DIMS_LOG_FORMAT" envDefault:"text"`
EtagAlgorithm string
Timeout
EdgeControl
Signing
Error
OriginCacheControl
OutputFormat
Options
ImageOutputOptions
}
func ReadConfig ¶
func ReadConfig() *Config
type EdgeControl ¶
type EdgeControl struct {
DownstreamTtl int `env:"DIMS_EDGE_CONTROL_DOWNSTREAM_TTL" envDefault:"0"`
}
type Error ¶
type Error struct {
Background string `env:"DIMS_ERROR_BACKGROUND" envDefault:"#5ADAFD"`
}
type FileSource ¶ added in v0.6.0
type FileSource struct {
BaseDir string `env:"DIMS_FILE_BASE_DIR" envDefault:"./resources"`
}
type Image ¶
type Image struct {
Bytes []byte // The downloaded image.
Size int // The original image size in bytes.
Format vips.ImageType // 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 ImageOutputOptions ¶
type ImageOutputOptions struct {
Jpeg JpegCompression
Png PngCompression
Webp WebpCompression
}
type JpegCompression ¶
type JpegCompression struct {
Quality int `env:"DIMS_JPEG_QUALITY" envDefault:"80"`
Interlace bool `env:"DIMS_JPEG_INTERLACE" envDefault:"false"`
OptimizeCoding bool `env:"DIMS_JPEG_OPTIMIZE_CODING" envDefault:"true"`
SubsampleMode bool `env:"DIMS_JPEG_SUBSAMPLE_MODE" envDefault:"true"`
TrellisQuant bool `env:"DIMS_JPEG_TRELLIS_QUANT" envDefault:"false"`
OvershootDeringing bool `env:"DIMS_JPEG_OVERSHOOT_DERINGING" envDefault:"false"`
OptimizeScans bool `env:"DIMS_JPEG_OPTIMIZE_SCANS" envDefault:"false"`
QuantTable int `env:"DIMS_JPEG_QUANT_TABLE" envDefault:"3"`
}
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 PngCompression ¶
type SourceBackend ¶ added in v0.6.0
type StatusError ¶
func NewStatusError ¶
func NewStatusError(statusCode int, message string) *StatusError
func (*StatusError) Error ¶
func (e *StatusError) Error() string
type WebpCompression ¶
Click to show internal directories.
Click to hide internal directories.