StorageServer/modules/utils/definitions.go

23 lines
509 B
Go

package utils
const (
// is specified in the form data of the frontend
FormFileKey = "file"
MaxAvatarSize = 2 * 1024 * 1024 // 2 MB
// filename len = 36 + dot . 1 + longestFileType 4
// example: cf75ace7-da4c-434d-bf7d-0bdbcea5c57d.webp
MaxFileNameLen = 41
DefaultImageSize = 4
)
var (
ValidFileTypes = []string{"jpeg", "jpg", "png", "webp"}
// represents the query parameter size for the dynamic image resolution
// example ?size=1 -> 64x64
ImageSizes = []int{32, 64, 150, 256, 512, 1024}
)