Documentation
¶
Index ¶
- Variables
- func DecryptAES128GCM(key []byte, base64EncryptedText string) (string, error)
- func DecryptURL(secretKey string, base64Eurl string) (string, error)
- func EncryptAES128GCM(key []byte, plaintext string) (string, error)
- func EncryptURL(secretKey string, url string) (string, error)
- func EncryptionKey(secretKey string) []byte
- func HandleDimsStatus(config core.EnvironmentConfig, debug bool, dev bool, w http.ResponseWriter, ...)
- func Handler(request Request, config core.Config, w http.ResponseWriter) error
- func Sign_HmacSha256_128(request Request) []byte
- func Sign_md5(r Request) string
- type ErrorImageGenerator
- type ImageProcessor
- type Request
- func (r *Request) Commands() []operations.Command
- func (r *Request) LoadImage(sourceImage *core.Image) (*vips.ImageRef, error)
- func (r *Request) ProcessImage(image *vips.ImageRef, errorImage bool) (string, []byte, error)
- func (r *Request) SendError(w http.ResponseWriter, err error) error
- func (r *Request) SendHeaders(w http.ResponseWriter)
- func (r *Request) SendImage(w http.ResponseWriter, status int, imageFormat string, imageBlob []byte) error
- type Signer
- type UrlSigner
Constants ¶
This section is empty.
Variables ¶
View Source
var VipsExportCommands = map[string]operations.VipsExportOperation{ "strip": operations.StripMetadataCommand, "format": operations.FormatCommand, "quality": operations.QualityCommand, }
View Source
var VipsRequestCommands = map[string]operations.VipsRequestOperation{ "watermark": operations.Watermark, }
View Source
var VipsTransformCommands = map[string]operations.VipsTransformOperation{ "crop": operations.CropCommand, "resize": operations.ResizeCommand, "sharpen": operations.SharpenCommand, "brightness": operations.BrightnessCommand, "flipflop": operations.FlipFlopCommand, "sepia": operations.SepiaCommand, "grayscale": operations.GrayscaleCommand, "autolevel": operations.AutolevelCommand, "invert": operations.InvertCommand, "rotate": operations.RotateCommand, "thumbnail": operations.ThumbnailCommand, "legacy_thumbnail": operations.LegacyThumbnailCommand, }
Functions ¶
func DecryptAES128GCM ¶ added in v0.4.0
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 ¶ added in v0.4.0
DecryptURL decrypts the given eurl string using a derived AES-128-GCM key.
func EncryptAES128GCM ¶ added in v0.4.0
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 EncryptionKey ¶ added in v0.4.0
func HandleDimsStatus ¶
func HandleDimsStatus(config core.EnvironmentConfig, debug bool, dev bool, w http.ResponseWriter, r *http.Request)
func Sign_HmacSha256_128 ¶ added in v0.4.0
Sign returns a signed string using HMAC-SHA256-128.
Types ¶
type ErrorImageGenerator ¶ added in v0.3.0
type ErrorImageGenerator interface {
GenerateErrorImage(w http.ResponseWriter, status int, message string)
}
type ImageProcessor ¶ added in v0.3.0
type Request ¶
type Request struct {
HttpRequest http.Request
Id string // The hash of the request -> hash(clientId + commands + imageUrl).
Signature string // The signature of the request.
Config core.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.
RawCommands string // The commands ('resize/100x100', 'strip/true/format/png', etc).
Error bool // Whether the error image is being served.
Timestamp int64 // The timestamp of the request
SourceImage core.Image // The source image.
// contains filtered or unexported fields
}
func ParseAndValidateV4Request ¶ added in v0.4.0
func ParseAndValidateV5Request ¶ added in v0.4.0
func (*Request) Commands ¶
func (r *Request) Commands() []operations.Command
func (*Request) ProcessImage ¶
ProcessImage will execute the commands on the image.
func (*Request) SendHeaders ¶
func (r *Request) SendHeaders(w http.ResponseWriter)
Click to show internal directories.
Click to hide internal directories.