Help us shape the future of Go! Take the 2026 Go Developer Survey

mimetab

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package mimetab is the platform's pinned extension → MIME table — the one source both writers of the files registry consult, so the same filename yields the same registry row wherever it enters: the outputs harvest (internal/executor, #264) and the upload endpoint's extension fallback (internal/api, #277). Neither may consult mime.TypeByExtension: it merges the host's /etc/mime.types (or registry), so a host-dependent lookup would let the serving host decide a wire-visible value.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByPath

func ByPath(p string) string

ByPath returns the pinned MIME type for the path's extension, case-folded, or application/octet-stream when the extension is unlisted. path.Ext (not filepath.Ext) on purpose: every caller hands it a slash-separated sandbox path or a validated bare filename, never a host-native path.

func ExtFor added in v0.5.0

func ExtFor(mimeType string) string

ExtFor returns the extension the table pairs with a MIME type, ignoring its case and parameters, or "" when the type is unlisted. It names an upload that arrived without a filename (internal/api), and ByPath of the name it gives is the same bare type, carrying the table's parameters rather than the caller's ("text/plain" comes back "text/plain; charset=utf-8").

Types

This section is empty.

Jump to

Keyboard shortcuts

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