Documentation
¶
Index ¶
- Constants
- type Config
- func (c *Config) CheckTypeExtension(typ string, extension string) bool
- func (c *Config) DetectType(extension string) string
- func (c *Config) Extensions(typ string) (r []string)
- func (c *Config) FileIcon(typ string) string
- func (c *Config) Init()
- func (c *Config) MaxSizeBytes(typ string) int
- func (c *Config) Register()
- func (c *Config) Reload() error
- func (c *Config) SetDefaults()
- type FileType
Constants ¶
View Source
const Name = `upload`
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
FileTypes map[string]*FileType `json:"fileTypes"`
MaxSize string `json:"maxSize"`
Icon string `json:"icon"`
// contains filtered or unexported fields
}
func (*Config) CheckTypeExtension ¶
CheckTypeExtension 检查类型扩展名
func (*Config) DetectType ¶
DetectType 根据扩展名判断类型
func (*Config) Extensions ¶
Extensions 文件类型文件扩展名
func (*Config) MaxSizeBytes ¶
func (*Config) SetDefaults ¶
func (c *Config) SetDefaults()
type FileType ¶
type FileType struct {
Icon string `json:"icon"`
Extensions []string `json:"extensions"`
MIMEs []string `json:"mimes"`
MIMEKeywords []string `json:"mimeKeywords"`
MaxSize string `json:"maxSize"`
Description string `json:"description"`
Disabled bool `json:"disabled"`
// contains filtered or unexported fields
}
func (*FileType) MaxSizeBytes ¶
Click to show internal directories.
Click to hide internal directories.