Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Upload = TConfig{ Path: dotenv.GetByDefault("UPLOAD_DIR", "upload"), File: FileConfig{ Path: "file", MaxSize: dotenv.GetIntByDefault("UPLOAD_FILE_MAX_SIZE", 1024*1024*10), AllowType: dotenv.GetStrArrayByDefault("UPLOAD_FILE_EXTENSION", []string{".txt", ".md"}), }, Image: ImageConfig{ Path: "image", MaxSize: dotenv.GetIntByDefault("UPLOAD_IMAGE_MAX_SIZE", 1024*1024*10), Thumbnail: ThumbnailConfig{ Path: "thumbnail", MaxWidth: dotenv.GetIntByDefault("UPLOAD_IMAGE_THUMBNAIL_WIDTH", 100), MaxHeight: dotenv.GetIntByDefault("UPLOAD_IMAGE_THUMBNAIL_HEIGHT", 100), }, Avatar: AvatarConfig{ Path: "avatar", }, }, }
Functions ¶
This section is empty.
Types ¶
type AvatarConfig ¶
type AvatarConfig struct {
Path string // 头像存储的路径
}
type FileConfig ¶
type ImageConfig ¶
type ImageConfig struct { Path string `json:"path"` // 图片存储路径 MaxSize int `json:"max_size"` // 最大图片上传限制,单位byte Thumbnail ThumbnailConfig `json:"thumbnail"` // 缩略图配置 Avatar AvatarConfig `json:"avatar"` // 用户头像的配置 }
type TConfig ¶
type TConfig struct { Path string `json:"path"` //文件上传的根目录 File FileConfig `json:"file"` // 普通文件上传的配置 Image ImageConfig `json:"image"` // 普通图片上传的配置 }
type ThumbnailConfig ¶
Click to show internal directories.
Click to hide internal directories.