Documentation ¶
Index ¶
Constants ¶
View Source
const SvgMimeType = "image/svg+xml"
SvgMimeType MIME type of SVG images.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SniffedType ¶
type SniffedType struct {
// contains filtered or unexported fields
}
SniffedType contains information about a blobs type.
func DetectContentType ¶
func DetectContentType(data []byte) SniffedType
DetectContentType extends http.DetectContentType with more content types. Defaults to text/unknown if input is empty.
func DetectContentTypeFromReader ¶
func DetectContentTypeFromReader(r io.Reader) (SniffedType, error)
DetectContentTypeFromReader guesses the content type contained in the reader.
func (SniffedType) IsAudio ¶
func (ct SniffedType) IsAudio() bool
IsAudio detects if data is an video format
func (SniffedType) IsImage ¶
func (ct SniffedType) IsImage() bool
IsImage detects if data is an image format
func (SniffedType) IsRepresentableAsText ¶
func (ct SniffedType) IsRepresentableAsText() bool
IsRepresentableAsText returns true if file content can be represented as plain text or is empty.
func (SniffedType) IsSvgImage ¶
func (ct SniffedType) IsSvgImage() bool
IsSvgImage detects if data is an SVG image format
func (SniffedType) IsText ¶
func (ct SniffedType) IsText() bool
IsText etects if content format is plain text.
func (SniffedType) IsVideo ¶
func (ct SniffedType) IsVideo() bool
IsVideo detects if data is an video format
Click to show internal directories.
Click to hide internal directories.