upload

package
v0.4.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

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 Get

func Get() *Config

func NewConfig

func NewConfig() *Config

func (*Config) CheckTypeExtension

func (c *Config) CheckTypeExtension(typ string, extension string) bool

CheckTypeExtension 检查类型扩展名

func (*Config) DetectType

func (c *Config) DetectType(extension string) string

DetectType 根据扩展名判断类型

func (*Config) Extensions

func (c *Config) Extensions(typ string) (r []string)

Extensions 文件类型文件扩展名

func (*Config) FileIcon

func (c *Config) FileIcon(typ string) string

func (*Config) Init

func (c *Config) Init()

func (*Config) MaxSizeBytes

func (c *Config) MaxSizeBytes(typ string) int

func (*Config) Register

func (c *Config) Register()

func (*Config) Reload

func (c *Config) Reload() error

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) Init

func (c *FileType) Init()

func (*FileType) MaxSizeBytes

func (c *FileType) MaxSizeBytes() int

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL