mime

package
v0.0.0-...-fe78ce7 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MediaTypeJSON = &MediaType{
	Type: "application/json",
}
View Source
var MediaTypeProtobuf = &MediaType{
	Type: "application/protobuf",
}

Functions

This section is empty.

Types

type HTTPAcceptMediaType

type HTTPAcceptMediaType struct {
	*MediaType

	IsPattern bool
	Quality   float32
}

func NewHTTPAcceptMediaType

func NewHTTPAcceptMediaType(t *MediaType) (*HTTPAcceptMediaType, error)

func (*HTTPAcceptMediaType) Match

func (t *HTTPAcceptMediaType) Match(typ string) bool

type HTTPAcceptMediaTypes

type HTTPAcceptMediaTypes []*HTTPAcceptMediaType

func ParseHTTPAcceptMediaTypes

func ParseHTTPAcceptMediaTypes(s string) HTTPAcceptMediaTypes

func (HTTPAcceptMediaTypes) SortByQuality

func (s HTTPAcceptMediaTypes) SortByQuality()

type MediaType

type MediaType struct {
	Type   string
	Params map[string]string
	// contains filtered or unexported fields
}

func ParseMediaType

func ParseMediaType(v string) (*MediaType, error)

func (*MediaType) Extensions

func (t *MediaType) Extensions() ([]string, error)

func (*MediaType) Serialize

func (t *MediaType) Serialize() string

Jump to

Keyboard shortcuts

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