Documentation ¶
Index ¶
- Constants
- Variables
- func AddAliyunOSSFinder(name, uri string) error
- func AddFileFinder(name, basePath string) error
- func AddFinder(name, uri string) error
- func AddGridFSFinder(name, uri string) error
- func AddHTTPFinder(name, uri string, onStatus ...upstream.StatusListener) error
- func AddMinioFinder(name, uri string) error
- func RangeFinder(fn func(name string, f Finder))
- func TaskAlias(alias, name string)
- type Finder
- type Image
- type ImageFinder
- type Job
- func NewAutoOptimizeImage(addr string, quality int, accept string) Job
- func NewFillResizeImage(width, height int) Job
- func NewFitResizeImage(width, height int) Job
- func NewOptimizeImage(addr string, quality int, formats ...string) Job
- func NewWatermark(watermarkImg image.Image, position string, angle float64) Job
- func Parse(taskPipeLine, accept string) ([]Job, error)
- type Parser
Constants ¶
const ( PositionTopLeft = "topLeft" PositionTop = "top" PositionTopRight = "topRight" PositionLeft = "left" PositionCenter = "center" PositionRight = "right" PositionBottomLeft = "bottomLeft" PositionBottom = "bottom" PositionBottomRight = "bottomRight" )
const ( ImageTypePNG = "png" ImageTypeJPEG = "jpeg" ImageTypeWEBP = "webp" ImageTypeAVIF = "avif" )
const ( TaskProxy = "proxy" TaskOptimize = "optimize" TaskAutoOptimize = "autoOptimize" TaskFitResize = "fitResize" TaskFillResize = "fillResize" TaskWatermark = "watermark" )
Variables ¶
var ErrAbortNext = errors.New("abort next")
不再执行后续时返回
var ErrFinderInValid = errors.New("Finder is invald")
var ErrFinderNotFound = errors.New("Finder is not found")
var ErrGRPCClientInvalid = errors.New("grpc client connection is invalid")
Functions ¶
func AddAliyunOSSFinder ¶
AddAliyunOSSFinder add aliyun oss finder
func AddFileFinder ¶
AddFileFinder adds a file finder
func AddGridFSFinder ¶
AddGridFSFinder adds mongodb gridfs finder
func AddHTTPFinder ¶
func AddHTTPFinder(name, uri string, onStatus ...upstream.StatusListener) error
AddHTTPFinder adds a http finder
func AddMinioFinder ¶
AddMinioFinder adds a minio finder
func RangeFinder ¶
RangeFinder calls fn sequentially for each key and find in the finders
Types ¶
type Finder ¶
type Image ¶
type Image struct {
// contains filtered or unexported fields
}
func FetchImageFromURL ¶
FetchImageFromURL fetch image from http url
func NewImageFromBytes ¶
NewImageFromBytes returns a image from byte data, an error will be return if decode fail
type Job ¶
Job is the image pipeline job
func NewAutoOptimizeImage ¶
NewAutoOptimizeImage creates an optimize image job, which will find the match type for optimizing by accept
func NewFillResizeImage ¶
NewFillResizeImage creates an image job, which will resize the image to fill with/height
func NewFitResizeImage ¶
NewFitResizeImage creates an image job, which will resize the image to fit width/height
func NewOptimizeImage ¶
NewOptimizeImage creates an optimize image job, it the format is nil, the original format will be used
func NewWatermark ¶
NewWatermark creates an image job, which will add watermark to image