exmime

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2024 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MimeExtensionSanityOverrides = map[string]string{
	"image/png":  ".png",
	"image/webp": ".webp",
	"image/jpeg": ".jpg",
	"image/tiff": ".tiff",
	"image/heif": ".heic",
	"image/heic": ".heic",

	"audio/mpeg":  ".mp3",
	"audio/ogg":   ".ogg",
	"audio/webm":  ".webm",
	"audio/x-caf": ".caf",
	"video/mp4":   ".mp4",
	"video/mpeg":  ".mpeg",
	"video/webm":  ".webm",

	"text/plain": ".txt",
	"text/html":  ".html",

	"application/xml": ".xml",
}

MimeExtensionSanityOverrides includes extensions for various common mimetypes.

This is necessary because sometimes the OS mimetype database and Go interact in weird ways, which causes very obscure extensions to be first in the array for common mimetypes (e.g. image/jpeg -> .jpe, text/plain -> ,v).

Functions

func ExtensionFromMimetype

func ExtensionFromMimetype(mimetype string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL