mime

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2023 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const MESSAGE_MIME_TYPE = "application/x-ma-message; version=0.0.1"

A MIME type for a message. Just to implement it for future proofing.

Variables

View Source
var CommonMimeTypes = map[string]string{
	"car":         "application/vnd.ipld.car",
	"ipld_cbor":   "application/vnd.ipld.cbor",
	"ipld_json":   "application/vnd.ipld.json",
	"ipld":        "application/vnd.ipld.raw",
	"ipns-record": "application/vnd.ipfs.ipns-record",
	"json":        "application/json",
	"cbor":        "application/cbor",
	"message":     MESSAGE_MIME_TYPE,
	"text":        "text/plain",
}

For more short names, see https://www.iana.org/assignments/media-types/media-types.xhtml

Functions

func IsValidMimeType

func IsValidMimeType(mimetype string) bool

func MimeType

func MimeType(mime_type string) string

MimeType returns the MIME type value for a given key.

func MimeTypeAliases

func MimeTypeAliases() []string

MimeTypes returns a list of the keys (shorthand names) from CommonMimeTypes.

func MimeTypeTuples

func MimeTypeTuples() [][2]string

MimeTypeTuples returns a list of key-value pairs (tuples) from CommonMimeTypes.

func MimeTypes

func MimeTypes() []string

MimeTypeValues returns a list of the MIME type values from CommonMimeTypes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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