File: type.go

package info (click to toggle)
golang-gopkg-h2non-filetype.v1 1.1.3%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 208 kB
  • sloc: makefile: 4
file content (16 lines) | stat: -rw-r--r-- 271 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package types

// Type represents a file MIME type and its extension
type Type struct {
	MIME      MIME
	Extension string
}

// NewType creates a new Type
func NewType(ext, mime string) Type {
	t := Type{
		MIME:      NewMIME(mime),
		Extension: ext,
	}
	return Add(t)
}