forked from ldez/mimetype
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmultipart.go
83 lines (80 loc) · 2.43 KB
/
multipart.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
package mimetype
// CODE GENERATED AUTOMATICALLY
// THIS FILE MUST NOT BE EDITED BY HAND
const (
// MultipartAlternative alternative mime type.
MultipartAlternative = "multipart/alternative"
// MultipartAppledouble appledouble mime type.
MultipartAppledouble = "multipart/appledouble"
// MultipartByteranges byteranges mime type.
MultipartByteranges = "multipart/byteranges"
// MultipartDigest digest mime type.
MultipartDigest = "multipart/digest"
// MultipartEncrypted encrypted mime type.
MultipartEncrypted = "multipart/encrypted"
// MultipartExample example mime type.
MultipartExample = "multipart/example"
// MultipartFormData form-data mime type.
MultipartFormData = "multipart/form-data"
// MultipartHeaderSet header-set mime type.
MultipartHeaderSet = "multipart/header-set"
// MultipartMixed mixed mime type.
MultipartMixed = "multipart/mixed"
// MultipartMultilingual multilingual mime type.
MultipartMultilingual = "multipart/multilingual"
// MultipartParallel parallel mime type.
MultipartParallel = "multipart/parallel"
// MultipartRelated related mime type.
MultipartRelated = "multipart/related"
// MultipartReport report mime type.
MultipartReport = "multipart/report"
// MultipartSigned signed mime type.
MultipartSigned = "multipart/signed"
// MultipartVndBintMedPlus vnd.bint.med-plus mime type.
MultipartVndBintMedPlus = "multipart/vnd.bint.med-plus"
// MultipartVoiceMessage voice-message mime type.
MultipartVoiceMessage = "multipart/voice-message"
// MultipartXMixedReplace x-mixed-replace mime type.
MultipartXMixedReplace = "multipart/x-mixed-replace"
)
// IsMultipart checks if the mime types is multipart.
func IsMultipart(mt string) bool {
switch mt {
case "multipart/alternative":
return true
case "multipart/appledouble":
return true
case "multipart/byteranges":
return true
case "multipart/digest":
return true
case "multipart/encrypted":
return true
case "multipart/example":
return true
case "multipart/form-data":
return true
case "multipart/header-set":
return true
case "multipart/mixed":
return true
case "multipart/multilingual":
return true
case "multipart/parallel":
return true
case "multipart/related":
return true
case "multipart/report":
return true
case "multipart/signed":
return true
case "multipart/vnd.bint.med-plus":
return true
case "multipart/voice-message":
return true
case "multipart/x-mixed-replace":
return true
default:
return false
}
}