Documentation
¶
Index ¶
- func DecodeBase64(input string, maxBytes int64) (io.Reader, error)
- func MapMediaType(rawType string) media.MediaType
- func MimeFromDataURL(raw string) string
- func NormalizeBase64DataURL(input, mime string) string
- func NormalizeMime(raw string) string
- func PrepareReaderAndMime(reader io.Reader, mediaType media.MediaType, sourceMime string) (io.Reader, string, error)
- func ResolveMime(mediaType media.MediaType, sourceMime, sniffedMime string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeBase64 ¶
DecodeBase64 decodes both raw base64 and data URL base64 content. The returned reader is bounded to maxBytes+1 for caller-side size validation.
func MapMediaType ¶
MapMediaType maps attachment type strings to media types.
func MimeFromDataURL ¶
MimeFromDataURL extracts MIME from a data URL.
func NormalizeBase64DataURL ¶
NormalizeBase64DataURL normalizes raw base64 into a data URL.
func NormalizeMime ¶
NormalizeMime normalizes MIME to lowercase token form.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.