Documentation
¶
Index ¶
- Constants
- Variables
- func AppendPathPrefixToExternalRecipientListEntries(prefix string, recipientEntry any) any
- func DeterministicHashStringOf(data []byte) string
- func EncodeJPEG(image image.Image, quality int) ([]byte, error)
- func EncodePNG(image image.Image) ([]byte, error)
- func IsPathLocal(p string) bool
- func IsPathLocalBytes(p []byte) bool
- func IsRecipientEntryExternal(p string) bool
- func NewCyclicalImportPreventingFileSystem(fs fs.FS) fs.FS
- func NewUnsafeUnconstrainedFileSystem() fs.FS
- func Resize(image image.Image, width, height uint) image.Image
- type Constraints
Constants ¶
View Source
const ( // TODO: those are duplicates of mime types in mime package because of cyclical imports: fix ContentTypeOctetStream = "application/octet-stream" ContentTypeTextPlain = "text/plain" ContentTypeTextHTML = "text/html" ContentTypeImageJPEG = "image/jpeg" ContentTypeImageBMP = "image/bmp" ContentTypeImagePNG = "image/png" ContentTypeImageGIF = "image/gif" ContentTypeImageWEBP = "image/webp" ContentTypeZip = "application/zip" )
Variables ¶
View Source
var ( //go:embed testdata/cat.jpg Cat []byte //go:embed testdata/panda.jpg Panda []byte //go:embed testdata/chamillion.jpg Chamillion []byte )
View Source
var ErrCyclicalImport = errors.New("cyclical import of dependencies")
Functions ¶
func IsPathLocal ¶
func IsPathLocalBytes ¶
Types ¶
type Constraints ¶
func (Constraints) ApplyTo ¶
func (m Constraints) ApplyTo(b []byte) (_ []byte, contentType string, err error)
func (Constraints) WithResolution ¶
func (m Constraints) WithResolution(resolution int) Constraints
Click to show internal directories.
Click to hide internal directories.