Documentation
¶
Index ¶
- func DecodeBase64(b64Data string) ([]byte, string, error)
- func DecodeDataURI(raw string) ([]byte, string, error)
- func DownloadURL(ctx context.Context, rawURL, fallbackMime string, maxBytes int64) ([]byte, string, error)
- func FallbackFilenameForMIME(mimeType string) string
- func MessageTypeForMIME(mimeType string) event.MessageType
- func ParseDataURI(dataURI string) (string, string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeBase64 ¶
DecodeBase64 decodes raw/base64 data or data URIs and returns bytes plus mime type.
func DecodeDataURI ¶
DecodeDataURI decodes a data URI (both base64 and percent-encoded) and returns the decoded bytes plus the mime type extracted from the URI header. It returns an empty mime type string if no media type is specified in the URI.
func DownloadURL ¶
func DownloadURL(ctx context.Context, rawURL, fallbackMime string, maxBytes int64) ([]byte, string, error)
DownloadURL fetches a file from rawURL over HTTP(S) and returns the bytes, resolved MIME type, and any error. When maxBytes > 0 the download is rejected if the server-advertised Content-Length or the actual body exceeds that limit. fallbackMime is used when the server does not return a usable Content-Type header.
func FallbackFilenameForMIME ¶
func MessageTypeForMIME ¶
func MessageTypeForMIME(mimeType string) event.MessageType
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.