[feature/backend] overall enhancement of image uploading
All checks were successful
Build Backend / Build Docker Image (push) Successful in 5m3s
All checks were successful
Build Backend / Build Docker Image (push) Successful in 5m3s
This commit is contained in:
parent
6e1be3d513
commit
3e6181e578
13 changed files with 740 additions and 314 deletions
|
@ -49,7 +49,7 @@ type StorageConfig struct {
|
|||
Type string `yaml:"type"`
|
||||
Local LocalStorage `yaml:"local"`
|
||||
S3 S3Storage `yaml:"s3"`
|
||||
Upload types.UploadConfig `yaml:"upload"`
|
||||
Upload UploadConfig `yaml:"upload"`
|
||||
}
|
||||
|
||||
type LocalStorage struct {
|
||||
|
@ -66,6 +66,27 @@ type S3Storage struct {
|
|||
ProxyS3 bool `yaml:"proxy_s3"`
|
||||
}
|
||||
|
||||
type UploadConfig struct {
|
||||
Limits struct {
|
||||
Image struct {
|
||||
MaxSize int `yaml:"max_size"`
|
||||
AllowedTypes []string `yaml:"allowed_types"`
|
||||
} `yaml:"image"`
|
||||
Video struct {
|
||||
MaxSize int `yaml:"max_size"`
|
||||
AllowedTypes []string `yaml:"allowed_types"`
|
||||
} `yaml:"video"`
|
||||
Audio struct {
|
||||
MaxSize int `yaml:"max_size"`
|
||||
AllowedTypes []string `yaml:"allowed_types"`
|
||||
} `yaml:"audio"`
|
||||
Document struct {
|
||||
MaxSize int `yaml:"max_size"`
|
||||
AllowedTypes []string `yaml:"allowed_types"`
|
||||
} `yaml:"document"`
|
||||
} `yaml:"limits"`
|
||||
}
|
||||
|
||||
// Load loads configuration from a YAML file
|
||||
func Load(path string) (*Config, error) {
|
||||
data, err := os.ReadFile(path)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue