Documentation ¶
Index ¶
- Constants
- Variables
- func CreateETagFromFile(filePath string) (string, error)
- func DetermineImageType(imagePath string) (vips.ImageType, error)
- func DoesFileExist(filePath string) (bool, error)
- func ReadWholeFile(filePath string) ([]byte, error)
- type JobLimiter
- type NonStandardSupport
- type OptimiseJob
Constants ¶
View Source
const AppName = "Img Opt"
Variables ¶
View Source
var ErrJobLimitReached = errors.New("Job Limit Has Been Reached")
View Source
var FormatNameToImageType = map[string]vips.ImageType{ "jpeg": vips.ImageTypeJPEG, "png": vips.ImageTypePNG, "webp": vips.ImageTypeWEBP, "avif": vips.ImageTypeAVIF, }
View Source
var ImageTypeToFormatName = map[vips.ImageType]string{ vips.ImageTypeJPEG: "jpeg", vips.ImageTypePNG: "png", vips.ImageTypeWEBP: "webp", vips.ImageTypeAVIF: "avif", }
View Source
var ImageTypeToMime = map[vips.ImageType]string{ vips.ImageTypeJPEG: "image/jpeg", vips.ImageTypePNG: "image/png", vips.ImageTypeWEBP: "image/webp", vips.ImageTypeAVIF: "image/avif", }
View Source
var UnknownImageTypeErr = errors.New("unknown image type")
View Source
var UnsupportedImageTypeErr = errors.New("unsupported image type")
Functions ¶
func CreateETagFromFile ¶
func DoesFileExist ¶
func ReadWholeFile ¶
Types ¶
type JobLimiter ¶
type JobLimiter struct {
// contains filtered or unexported fields
}
func NewJobLimiter ¶
func NewJobLimiter(max uint) *JobLimiter
func (*JobLimiter) AddJob ¶
func (jc *JobLimiter) AddJob() error
func (*JobLimiter) Jobs ¶
func (jc *JobLimiter) Jobs() uint
func (*JobLimiter) RemoveJob ¶
func (jc *JobLimiter) RemoveJob()
type NonStandardSupport ¶
func NonStandardFromAcceptHeader ¶
func NonStandardFromAcceptHeader(headerContent string) NonStandardSupport
Click to show internal directories.
Click to hide internal directories.