Documentation ¶
Index ¶
- func BuildOne(parent string, path string, tx *gorm.DB, parentPassword string, ...) error
- func BuildTree(drive *conf.Drive, depth int) error
- func BuildTreeAll(depth int)
- func BuildTreeWithPath(path string, depth int) error
- func Clear(drive *conf.Drive) error
- func DeleteWithDir(dir string) error
- func GetFilesByDir(dir string) (*[]File, error)
- func SearchByNameGlobal(keyword string) (*[]File, error)
- func SearchByNameInDir(keyword string, dir string) (*[]File, error)
- type File
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildOne ¶
func BuildOne(parent string, path string, tx *gorm.DB, parentPassword string, drive *conf.Drive, depth int) error
递归构建目录树,插入指定目录下的所有文件 parent 父目录的file_id path 指定的目录 parentPassword 父目录所携带的密码 drive 要构建的盘
func BuildTreeAll ¶ added in v1.0.1
func BuildTreeAll(depth int)
func BuildTreeWithPath ¶ added in v1.0.4
重建指定路径与深度的目录树: 先删除该目录与该目录下所有文件的model,再重新插入
func DeleteWithDir ¶ added in v1.0.4
func GetFilesByDir ¶
func SearchByNameGlobal ¶
Types ¶
type File ¶
type File struct { Dir string `json:"dir" gorm:"index"` FileExtension string `json:"file_extension"` FileId string `json:"file_id"` Name string `json:"name" gorm:"index"` Type string `json:"type"` UpdatedAt *time.Time `json:"updated_at"` Category string `json:"category"` ContentType string `json:"content_type"` Size int64 `json:"size"` Password string `json:"password"` Url string `json:"url" gorm:"-"` ContentHash string `json:"content_hash"` }
func GetFileByDirAndName ¶
Click to show internal directories.
Click to hide internal directories.