mime

package
v0.0.0-...-e758773 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2011 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package mime implements parts of the MIME spec.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddExtensionType

func AddExtensionType(ext, typ string) os.Error

AddExtensionType sets the MIME type associated with the extension ext to typ. The extension should begin with a leading dot, as in ".html".

func IsQText

func IsQText(rune int) bool

IsQText returns true if rune is in 'qtext' as defined by RFC 822.

func IsTokenChar

func IsTokenChar(rune int) bool

IsTokenChar returns true if rune is in 'token' as defined by RFC 1531 and RFC 2045.

func ParseMediaType

func ParseMediaType(v string) (mediatype string, params map[string]string)

ParseMediaType parses a media type value and any optional parameters, per RFC 1531. Media types are the values in Content-Type and Content-Disposition headers (RFC 2183). On success, ParseMediaType returns the media type converted to lowercase and trimmed of white space and a non-nil params. On error, it returns an empty string and a nil params.

func TypeByExtension

func TypeByExtension(ext string) string

TypeByExtension returns the MIME type associated with the file extension ext. The extension ext should begin with a leading dot, as in ".html". When ext has no associated type, TypeByExtension returns "".

The built-in table is small but is is augmented by the local system's mime.types file(s) if available under one or more of these names:

/etc/mime.types
/etc/apache2/mime.types
/etc/apache/mime.types

Types

This section is empty.

Directories

Path Synopsis
Package multipart implements MIME multipart parsing, as defined in RFC 2046.
Package multipart implements MIME multipart parsing, as defined in RFC 2046.

Jump to

Keyboard shortcuts

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