Documentation ¶
Index ¶
Constants ¶
const ( // Images. PNG = "png" JPEG = "jpeg" JPG = "jpg" GIF = "gif" WEBP = "webp" TIFF = "tiff" BMP = "bmp" // Documents. PDF = "pdf" )
Variables ¶
This section is empty.
Functions ¶
func ParseMimeType ¶
Types ¶
type Bmp ¶
type Bmp struct {
// contains filtered or unexported fields
}
Bmp struct implements the File and Image interface from the files pkg.
func NewBmp ¶
func NewBmp() *Bmp
NewBmp returns a pointer to a Bmp instance. The Bmp object is set with a map with list of supported file formats.
func (*Bmp) ConvertTo ¶
ConvertTo method converts a given file to a target format. This method returns a file in form of a slice of bytes. The methd receives a file type and the sub-type of the target format and the file as array of bytes.
func (*Bmp) ImageType ¶
ImageType returns the file format of the current image. This method implements the Image interface.
func (*Bmp) SupportedFormats ¶
SupportedFormats returns a map with a slice of supported files. Every key of the map represents a kind of a file.
func (*Bmp) SupportedMIMETypes ¶ added in v0.2.0
SupportedMIMETypes returns a map with a slice of supported MIME types.
type Gif ¶
type Gif struct {
// contains filtered or unexported fields
}
Gif struct implements the File and Image interface from the files pkg.
func NewGif ¶
func NewGif() *Gif
NewGif returns a pointer to a Gif instance. The Gif object is set with a map with list of supported file formats.
func (*Gif) ConvertTo ¶
ConvertTo method converts a given file to a target format. This method returns a file in form of a slice of bytes. The methd receives a file type and the sub-type of the target format and the file as array of bytes.
func (*Gif) ImageType ¶
ImageType returns the file format of the current image. This method implements the Image interface.
func (*Gif) SupportedFormats ¶
SupportedFormats returns a map with a slice of supported files. Every key of the map represents the kind of a file.
func (*Gif) SupportedMIMETypes ¶ added in v0.2.0
SupportedMIMETypes returns a map with a slice of supported MIME types.
type Jpeg ¶
type Jpeg struct {
// contains filtered or unexported fields
}
Jpeg struct implements the File and Image interface from the files pkg.
func NewJpeg ¶
func NewJpeg() *Jpeg
NewJpeg returns a pointer to a Jpeg instance. The Jpeg object is set with a map with list of supported file formats.
func (*Jpeg) ConvertTo ¶
ConvertTo method converts a given file to a target format. This method returns a file in form of a slice of bytes. The methd receives a file type and the sub-type of the target format and the file as array of bytes.
func (*Jpeg) ImageType ¶
ImageType returns the file format of the current image. This method implements the Image interface.
func (*Jpeg) SupportedFormats ¶
SupportedFormats returns a map with a slice of supported files. Every key of the map represents a kind of a file.
func (*Jpeg) SupportedMIMETypes ¶ added in v0.2.0
SupportedMIMETypes returns a map with a slice of supported MIME types.
type Png ¶
type Png struct {
// contains filtered or unexported fields
}
Png struct implements the File and Image interface from the files pkg.
func NewPng ¶
func NewPng() *Png
NewPng returns a pointer to a Png instance. The Png object is set with a map with list of supported file formats.
func (*Png) ConvertTo ¶
ConvertTo method converts a given file to a target format. This method returns a file in form of a slice of bytes.
func (*Png) ImageType ¶
ImageType returns the file format of the current image. This method implements the Image interface.
func (*Png) SupportedFormats ¶
SupportedFormats returns a map with a slice of supported files. Every key of the map represents the kind of a file.
func (*Png) SupportedMIMETypes ¶ added in v0.2.0
SupportedMIMETypes returns a map with a slice of supported MIME types.
type Tiff ¶
type Tiff struct {
// contains filtered or unexported fields
}
Tiff struct implements the File and Image interface from the files pkg.
func NewTiff ¶
func NewTiff() *Tiff
NewTiff returns a pointer to a Tiff instance. The Tiff object is set with a map with list of supported file formats.
func (*Tiff) ConvertTo ¶
ConvertTo method converts a given file to a target format. This method returns a file in form of a slice of bytes.
func (*Tiff) ImageType ¶
ImageType returns the file format of the current image. This method implements the Image interface.
func (*Tiff) SupportedFormats ¶
SupportedFormats method returns a map with a slice of supported files. Every key of the map represents the kind of a file.
func (*Tiff) SupportedMIMETypes ¶ added in v0.2.0
SupportedMIMETypes returns a map with a slice of supported MIME types.
type Webp ¶
type Webp struct {
// contains filtered or unexported fields
}
Webp struct implements the File and Image interface from the files pkg.
func NewWebp ¶
func NewWebp() *Webp
NewWebp returns a pointer to a Webp instance. The Webp object is set with a map with list of supported file formats.
func (*Webp) ConvertTo ¶
ConvertTo method converts a given file to a target format. This method returns a file in form of a slice of bytes.
func (*Webp) ImageType ¶
ImageType method returns the file format of the current image. This method implements the Image interface.
func (*Webp) SupportedFormats ¶
SupportedFormats returns a map with a slice of supported files. Every key of the map represents the kind of a file.
func (*Webp) SupportedMIMETypes ¶ added in v0.2.0
SupportedMIMETypes returns a map with a slice of supported MIME types.