Documentation
¶
Index ¶
- Constants
- Variables
- type Matter
- func (m *Matter) BeforeCreate(db *gorm.DB) error
- func (m *Matter) BuildObject(rootPath string, filePath string)
- func (m *Matter) BuildRecycleBinItem() *RecycleBin
- func (m *Matter) Clone() *Matter
- func (m *Matter) FullPath() string
- func (m *Matter) GetID() int64
- func (m *Matter) IsDir() bool
- func (m *Matter) SetUploadedAt()
- func (m *Matter) TableName() string
- func (m *Matter) UserAccessible(uid int64) bool
- type MatterEnv
- type RecycleBin
- type Storage
- type UserStorage
Constants ¶
View Source
const ( DirTypeSys = iota + 1 DirTypeUser DirFileMaxNum = 65534 )
View Source
const ( StorageModeNetDisk = iota + 1 StorageModeOutline )
View Source
const ( StorageStatusEnabled = iota + 1 StorageStatusDisabled )
View Source
const ( UserStorageDefaultSize = 50 << 20 UserStorageActiveSize = 1024 << 20 )
Variables ¶
View Source
var DocTypes = []string{
"text/csv",
"application/msword",
"application/vnd.ms-excel",
"application/vnd.ms-powerpoint",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"application/vnd.openxmlformats-officedocument.presentationml.presentation",
}
View Source
var SupportEnvs = []MatterEnv{ {Name: "$UID", Intro: "用户ID", Example: "10001", /* contains filtered or unexported fields */}, {Name: "$UUID", Intro: "UUID", Example: "6ba7b810-9dad-11d1-80b4-00c04fd430c8", /* contains filtered or unexported fields */}, {Name: "$RAW_PATH", Intro: "初始上传路径", Example: "文稿/简历", /* contains filtered or unexported fields */}, {Name: "$RAW_NAME", Intro: "初始文件名", Example: "张三-简历", /* contains filtered or unexported fields */}, {Name: "$RAW_EXT", Intro: "初始文件后缀", Example: "pdf", /* contains filtered or unexported fields */}, {Name: "$RAND_8KEY", Intro: "8位随机字符", Example: "mCUoR35r", /* contains filtered or unexported fields */}, {Name: "$RAND_16KEY", Intro: "16位随机字符", Example: "e1CbDUNfyVP3sScJ", /* contains filtered or unexported fields */}, {Name: "$NOW_DATE", Intro: "当前时间-日期", Example: "20210101", /* contains filtered or unexported fields */}, {Name: "$NOW_YEAR", Intro: "当前时间-年", Example: "2021", /* contains filtered or unexported fields */}, {Name: "$NOW_MONTH", Intro: "当前时间-月", Example: "01", /* contains filtered or unexported fields */}, {Name: "$NOW_DAY", Intro: "当前时间-日", Example: "01", /* contains filtered or unexported fields */}, {Name: "$NOW_HOUR", Intro: "当前时间-时", Example: "12", /* contains filtered or unexported fields */}, {Name: "$NOW_MIN", Intro: "当前时间-分", Example: "30", /* contains filtered or unexported fields */}, {Name: "$NOW_SEC", Intro: "当前时间-秒", Example: "10", /* contains filtered or unexported fields */}, {Name: "$NOW_UNIX", Intro: "当前时间-时间戳", Example: "1612631185", /* contains filtered or unexported fields */}, }
Functions ¶
This section is empty.
Types ¶
type Matter ¶
type Matter struct { Id int64 `json:"id"` Uid int64 `json:"uid" gorm:"not null"` Sid int64 `json:"sid" gorm:"not null"` // storage_id Alias string `json:"alias" gorm:"size:16;not null"` Name string `json:"name" gorm:"not null"` Type string `json:"type" gorm:"not null"` Size int64 `json:"size" gorm:"not null"` DirType int8 `json:"dirtype" gorm:"column:dirtype;not null"` Parent string `json:"parent" gorm:"not null"` Object string `json:"object" gorm:"not null"` URL string `json:"url" gorm:"-"` Uploader map[string]any `json:"uploader" gorm:"-"` UploadedAt *time.Time `json:"uploaded"` CreatedAt time.Time `json:"created" gorm:"not null"` UpdatedAt time.Time `json:"updated" gorm:"not null"` DeletedAt gorm.DeletedAt `json:"-"` TrashedBy string `json:"-" gorm:"size:16;not null"` }
func (*Matter) BuildObject ¶
func (*Matter) BuildRecycleBinItem ¶
func (m *Matter) BuildRecycleBinItem() *RecycleBin
func (*Matter) SetUploadedAt ¶
func (m *Matter) SetUploadedAt()
func (*Matter) UserAccessible ¶
type RecycleBin ¶
type RecycleBin struct { Id int64 `json:"id"` Uid int64 `json:"uid" gorm:"not null"` Sid int64 `json:"sid" gorm:"not null"` // storage_id Mid int64 `json:"mid" gorm:"not null;default:0"` // matter_id Alias string `json:"alias" gorm:"size:16;not null"` Name string `json:"name" gorm:"not null"` Type string `json:"type" gorm:"not null"` Size int64 `json:"size" gorm:"not null"` DirType int8 `json:"dirtype" gorm:"column:dirtype;not null"` // Deprecated: 弃用 Parent string `json:"parent" gorm:"not null"` // Deprecated: 弃用,不在存储具体对象 Object string `json:"object" gorm:"not null"` CreatedAt time.Time `json:"created" gorm:"not null"` DeletedAt gorm.DeletedAt `json:"-"` }
func (*RecycleBin) GetID ¶
func (m *RecycleBin) GetID() string
func (*RecycleBin) IsDir ¶
func (m *RecycleBin) IsDir() bool
func (*RecycleBin) TableName ¶
func (m *RecycleBin) TableName() string
func (*RecycleBin) UserAccessible ¶
func (m *RecycleBin) UserAccessible(uid int64) bool
type Storage ¶
type Storage struct { Id int64 `json:"id"` Mode int8 `json:"mode" gorm:"size:16;not null"` Name string `json:"name" gorm:"size:16;not null"` Title string `json:"title" gorm:"size:16;not null"` IDirs string `json:"idirs" gorm:"size:255;not null"` // internal dirs Bucket string `json:"bucket" gorm:"size:32;not null"` Provider string `json:"provider" gorm:"size:8;not null"` Endpoint string `json:"endpoint" gorm:"size:128;not null"` Region string `json:"region" gorm:"size:128;default:auto;not null"` AccessKey string `json:"access_key" gorm:"size:64;not null"` SecretKey string `json:"secret_key" gorm:"size:64;not null"` CustomHost string `json:"custom_host" gorm:"size:128;not null"` PathStyle bool `json:"path_style" gorm:"not null;default:false"` RootPath string `json:"root_path" gorm:"size:64;not null"` FilePath string `json:"file_path" gorm:"size:1024;not null"` Status int8 `json:"status" gorm:"size:1;default:1;not null"` Created time.Time `json:"created" gorm:"->;<-:create;autoCreateTime;not null"` Updated time.Time `json:"updated" gorm:"autoUpdateTime;not null"` Deleted gorm.DeletedAt `json:"-"` }
func (*Storage) PublicRead ¶
func (*Storage) SKAsterisk ¶
type UserStorage ¶
type UserStorage struct { Id int64 `json:"id"` Uid int64 `json:"uid" gorm:"not null"` Max uint64 `json:"max" gorm:"not null"` Used uint64 `json:"used" gorm:"not null"` Created time.Time `json:"created" gorm:"autoCreateTime;not null"` Updated time.Time `json:"updated" gorm:"autoUpdateTime;not null"` Deleted gorm.DeletedAt `json:"-"` }
func (*UserStorage) Overflowed ¶
func (us *UserStorage) Overflowed(addonSize int64) bool
func (*UserStorage) TableName ¶
func (us *UserStorage) TableName() string
Click to show internal directories.
Click to hide internal directories.