Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Fake ¶
type Fake struct{}
Fake returns the input unchanged
func NewFakeService ¶
func NewFakeService() *Fake
NewFakeService creates a new fake image proxy service
func (*Fake) GenerateURL ¶
func (fake *Fake) GenerateURL(sourceURL string, config ImageConfig) (string, error)
GenerateURL appends the ImageConfig width to the sourceURL: <sourceURL>/<width>
type ImageConfig ¶
type ImageConfig struct { Width int Height int ResizingType ResizingType }
func ParseImageConfig ¶
func ParseImageConfig(width, height, resizingType string) (ImageConfig, error)
func (ImageConfig) String ¶
func (config ImageConfig) String() string
func (ImageConfig) Validate ¶
func (config ImageConfig) Validate() error
type ImgProxy ¶
type ImgProxy struct {
// contains filtered or unexported fields
}
ImgProxy provides helper functions for working with imgproxy. See https://imgproxy.net/
func NewImgProxyService ¶
func NewImgProxyService(baseURL, keyHex, saltHex string, allowedConfigs []ImageConfig) (*ImgProxy, error)
NewImgProxyService creates a new ImgProxy service
func (*ImgProxy) GenerateURL ¶
func (imgproxy *ImgProxy) GenerateURL(sourceURL string, config ImageConfig) (string, error)
GenerateURL generates a signed URL for imgproxy. See https://docs.imgproxy.net/generating_the_url
type ResizingType ¶
type ResizingType string
const ResizingTypeFill ResizingType = "FILL"
const ResizingTypeFit ResizingType = "FIT"
func ParseResizingType ¶
func ParseResizingType(input string) (ResizingType, error)
Click to show internal directories.
Click to hide internal directories.