Documentation

Index

Constants

This section is empty.

Variables

View Source
var Types sync.Map

Types Support concurrent map writes

View Source
var Unknown = NewType("unknown", "")

Unknown default type

Functions

This section is empty.

Types

type MIME

type MIME struct {
	Type    string
	Subtype string
	Value   string
}

MIME stores the file MIME type values

func NewMIME

func NewMIME(mime string) MIME

Creates a new MIME type

type Type

type Type struct {
	MIME      MIME
	Extension string
}

Type represents a file MIME type and its extension

func Add

func Add(t Type) Type

Add registers a new type in the package

func Get

func Get(ext string) Type

Get retrieves a Type by extension

func NewType

func NewType(ext, mime string) Type

NewType creates a new Type