mimeconsts

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ANY_CTYPE  = "*/*"
	JSON_CTYPE = "application/json"

	//https://datatracker.ietf.org/doc/draft-ietf-httpapi-yaml-mediatypes/
	/* quote:
	"Deprecated alias names for this type: application/x-yaml, text/yaml,
	text/x-yaml. These names are used, but not registered."
	*/
	APP_YAML_CTYPE = "application/yaml"

	HTML_CTYPE             = "text/html"
	CSS_CTYPE              = "text/css"
	JS_CTYPE               = "text/javascript" //https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types#textjavascript
	INOX_CTYPE             = "text/inox"
	PLAIN_TEXT_CTYPE       = "text/plain"
	EVENT_STREAM_CTYPE     = "text/event-stream"
	APP_OCTET_STREAM_CTYPE = "application/octet-stream"
	MULTIPART_FORM_DATA    = "multipart/form-data"

	AVIF_CTYPE = "image/avif"
	GIF_CTYPE  = "image/gif"
	JPEG_CTYPE = "image/jpeg"
	SVG_CTYPE  = "image/svg+xml"
	WEBP_CTYPE = "image/webp"
	PNG_CTYPE  = "image/png"
)

Variables

Functions

func IsMimeTypeForExtension

func IsMimeTypeForExtension(mimetype string, ext string) bool

IsMimeTypeForExtension returns true if ext corresponds to mimetype.

func TypeByExtensionWithoutParams

func TypeByExtensionWithoutParams(ext 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