39 lines
868 B
Go
39 lines
868 B
Go
package constants
|
|
|
|
type FileType string
|
|
|
|
const (
|
|
FileTypeUnknown FileType = "unknown"
|
|
FileTypeImage FileType = "image"
|
|
//FileTypeVideo FileType = "video"
|
|
FileTypeExcel FileType = "excel"
|
|
FileTypeWord FileType = "word"
|
|
FileTypeTxt FileType = "txt"
|
|
FileTypePDF FileType = "pdf"
|
|
)
|
|
|
|
var FileTypeMappings = map[FileType][]string{
|
|
FileTypeImage: {
|
|
"image/jpeg", "image/png", "image/gif", "image/webp", "image/svg+xml",
|
|
".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg",
|
|
},
|
|
FileTypeExcel: {
|
|
"application/vnd.ms-excel",
|
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
".xls", ".xlsx",
|
|
},
|
|
FileTypeWord: {
|
|
"application/msword",
|
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
".doc", ".docx",
|
|
},
|
|
FileTypePDF: {
|
|
"application/pdf",
|
|
".pdf",
|
|
},
|
|
FileTypeTxt: {
|
|
"text/plain",
|
|
".txt",
|
|
},
|
|
}
|