1 Star 0 Fork 0

Cruvie Kang / kk_go_kit

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
file_type.go 767 Bytes
Copy Edit Raw Blame History
cruvie authored 2024-03-09 17:56 . update
package kk_file
const (
TypeImage = 1
)
type FileType struct {
ContentType string
Suffix string
}
func New(contentType string) FileType {
switch contentType {
case Jpeg.ContentType:
return Jpeg
case Avif.ContentType:
return Avif
case Gif.ContentType:
return Gif
case Png.ContentType:
return Png
case Heic.ContentType:
return Heic
default:
return FileType{}
}
}
var (
Jpeg = FileType{
ContentType: "image/jpeg",
Suffix: ".jpg",
}
Avif = FileType{
ContentType: "image/avif",
Suffix: ".avif",
}
Gif = FileType{
ContentType: "image/gif",
Suffix: ".gif",
}
Png = FileType{
ContentType: "image/png",
Suffix: ".png",
}
Heic = FileType{
ContentType: "image/heic",
Suffix: ".heic",
}
)
1
https://gitee.com/cruvie/kk_go_kit.git
git@gitee.com:cruvie/kk_go_kit.git
cruvie
kk_go_kit
kk_go_kit
6c1fc534a942

Search