Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseModel ¶
type BaseModel struct {
ID int64 `json:"id" gorm:"primary_key"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
BaseModel common info for all models
type File ¶
type File struct {
BaseModel
UUID string // UUID,解决重名问题;用自增 id 在存储介质上容易冲突
DisplayName string // 文件名,用于下载的时候展示
Ext string // 文件后缀,带 dot
ByteSize int64 // 文件大小,Byte
StorageType storage.Type // 存储类型
FullRelativePath string // 文件相对路径,不包含 网盘挂载点 或 oss bucket
From string // 文件来源,例如 issue / gittar mr
Creator string // 文件创建者 ID
Extra FileExtra // 额外信息,包括存储介质关键信息快照等
ExpiredAt *time.Time // 文件超时自动删除
}
type FileExtra ¶
type FileExtra struct {
OSSSnapshot OSSSnapshot `json:"ossSnapshot,omitempty"`
IsPublic bool `json:"isPublic,omitempty"`
Encrypt bool `json:"encrypt,omitempty"`
KMSKeyID string `json:"kmsKeyID,omitempty"`
DEKCiphertextBase64 string `json:"dekCiphertextBase64,omitempty"`
}
type OSSSnapshot ¶
Click to show internal directories.
Click to hide internal directories.