pipeline

package
v0.0.0-...-5105834 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PositionTopLeft     = "topLeft"
	PositionTop         = "top"
	PositionTopRight    = "topRight"
	PositionLeft        = "left"
	PositionCenter      = "center"
	PositionRight       = "right"
	PositionBottomLeft  = "bottomLeft"
	PositionBottom      = "bottom"
	PositionBottomRight = "bottomRight"
)
View Source
const (
	ImageTypePNG  = "png"
	ImageTypeJPEG = "jpeg"
	ImageTypeWEBP = "webp"
	ImageTypeAVIF = "avif"
)

Variables

View Source
var ErrAbort = errors.New("abort")

不再执行后续时返回

Functions

func Do

func Do(ctx context.Context, img *storage.Image, jobs ...ImageJob) (*storage.Image, error)

Types

type ImageJob

type ImageJob func(context.Context, *storage.Image) (*storage.Image, error)

func NewAutoOptimImage

func NewAutoOptimImage(quality int, header http.Header) ImageJob

func NewFillResizeImage

func NewFillResizeImage(width, height int) ImageJob

func NewFitResizeImage

func NewFitResizeImage(width, height int) ImageJob

func NewGetEntImage

func NewGetEntImage(bucket, name string) ImageJob

func NewGetHTTPImage

func NewGetHTTPImage(url string) ImageJob

func NewOptimImage

func NewOptimImage(quality int, formats ...string) ImageJob

func NewWatermark

func NewWatermark(url string, postion string, angle float64) ImageJob

func Parse

func Parse(tasks []string, header http.Header) ([]ImageJob, error)

type Parser

type Parser func([]string, http.Header) (ImageJob, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL