mime

package
v2.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ForceMimeMap = map[string]string{
	".ts":   "video/mp2t",
	".text": "text/plain; charset=utf-8",
}
View Source
var MimeMap = map[string]string{}/* 109 elements not displayed */

MimeMap 文件后缀 mime 类型

Functions

func GetAddedMimeTypes

func GetAddedMimeTypes() map[string]string

GetAddedMimeTypes 返回实际被添加的MIME类型

func GetFileMimeType

func GetFileMimeType(file io.Reader) (string, error)

GetFileMimeType 接受一个已打开的文件指针并返回文件的MIME类型。 如果发生错误,返回错误信息。在

func GetFilePathMimeType

func GetFilePathMimeType(filePath string) (string, error)

GetFilePathMimeType 接受文件路径并返回文件的MIME类型。 如果发生错误,返回错误信息。

func GetMimeType

func GetMimeType(file io.Reader) (io.Reader, string, error)

GetMimeType 接受一个已打开的文件指针并返回文件的MIME类型。

func InitMimeTypes

func InitMimeTypes()

Types

This section is empty.

Jump to

Keyboard shortcuts

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