core

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ImageTypes = map[string]vips.ImageType{
	"gif":  vips.ImageTypeGIF,
	"jpeg": vips.ImageTypeJPEG,
	"jpg":  vips.ImageTypeJPEG,
	"png":  vips.ImageTypePNG,
	"tiff": vips.ImageTypeTIFF,
	"webp": vips.ImageTypeWEBP,
	"heif": vips.ImageTypeHEIF,
	"svg":  vips.ImageTypeSVG,
	"psd":  vips.ImageTypePSD,
}

ImageTypes defines the various image types supported by govips

View Source
var Version = "v0.0.0"

Functions

This section is empty.

Types

type Config

type Config struct {
	DevelopmentMode bool
	DebugMode       bool
	EtagAlgorithm   string
	EnvironmentConfig
}

type EdgeControl

type EdgeControl struct {
	DownstreamTtl int `env:"DIMS_EDGE_CONTROL_DOWNSTREAM_TTL" envDefault:"0"`
}

type Error

type Error struct {
	Image      string `env:"DIMS_ERROR_IMAGE" envDefault:""`
	Background string `env:"DIMS_ERROR_BACKGROUND" envDefault:"#5ADAFD"`
}

type Image

type Image struct {
	Bytes        []byte // The downloaded image.
	Size         int    // The original image size in bytes.
	Format       string // The original image format.
	Status       int    // The HTTP status code of the downloaded image.
	CacheControl string // The cache headers from the downloaded image.
	EdgeControl  string // The edge control headers from the downloaded image.
	LastModified string // The last modified header from the downloaded image.
	Etag         string // The etag header from the downloaded image.
}

func FetchImage

func FetchImage(imageUrl string, timeout time.Duration) (*Image, error)

type Options

type Options struct {
	StripMetadata      bool `env:"DIMS_STRIP_METADATA" envDefault:"true"`
	IncludeDisposition bool `env:"DIMS_INCLUDE_DISPOSITION" envDefault:"false"`
}

type OriginCacheControl

type OriginCacheControl struct {
	UseOrigin bool `env:"DIMS_CACHE_CONTROL_USE_ORIGIN" envDefault:"false"`
	Min       int  `env:"DIMS_CACHE_CONTROL_MIN" envDefault:"0"`
	Max       int  `env:"DIMS_CACHE_CONTROL_MAX" envDefault:"0"`
	Default   int  `env:"DIMS_CACHE_CONTROL_DEFAULT" envDefault:"31536000"`
	Error     int  `env:"DIMS_CACHE_CONTROL_ERROR" envDefault:"60"`
}

type OutputFormat

type OutputFormat struct {
	OutputFormat string   `env:"DIMS_OUTPUT_FORMAT"`
	Exclude      []string `env:"DIMS_OUTPUT_FORMAT_EXCLUDE"`
}

type Signing

type Signing struct {
	SigningKey string `env:"DIMS_SIGNING_KEY,notEmpty"`
}

type StatusError

type StatusError struct {
	StatusCode int
	Message    string
}

func NewStatusError

func NewStatusError(statusCode int, message string) *StatusError

func (*StatusError) Error

func (e *StatusError) Error() string

type Timeout

type Timeout struct {
	Download int `env:"DIMS_DOWNLOAD_TIMEOUT" envDefault:"3000"`
}

Jump to

Keyboard shortcuts

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