Files
MeBox/internal/model/storage_assistant.go
T
truewhile 71bf60c69c 初始化
初始化项目
2026-08-23 22:12:32 +08:00

17 lines
670 B
Go

package model
// StorageConfig holds the connection settings for one external storage
// backend (Alist / S3 / WebDAV). Type column makes the row poly-typed
// — Config is a JSON blob whose shape is determined by Type.
//
// alist → {server, token}
// s3 → {endpoint, region, bucket, access_key, secret_key, force_path_style}
// webdav → {url, username, password}
type StorageConfig struct {
Base
Type string `gorm:"uniqueIndex;size:16;not null" json:"type"`
Config string `gorm:"type:text;not null" json:"-"` // ciphertext
Enabled bool `gorm:"default:true" json:"enabled"`
LastError string `gorm:"size:512" json:"last_error,omitempty"`
}