mime

package
v0.2.25 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Type

func Type(r io.Reader) (string, []schema.Meta, error)

Type returns the MIME type of the content read from the provided reader. It first checks if the reader provides Name() and uses both file extension and content sniffing, falling back to content sniffing only when no name is available.

This function consumes up to 512 bytes from r while sniffing content type. If callers need to read the full stream afterward, they should buffer and replay those bytes (or use a seekable reader and rewind). Returns application/octet-stream if the MIME type cannot be determined.

func TypeByExtension

func TypeByExtension(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