Documentation ¶
Index ¶
- Constants
- func CreateFile(file *FileInfo, meta *FileMeta) error
- func CreateFileMeta(meta *FileMeta) error
- func CreateFolder(folder *FolderInfo) error
- func InitBottle(bottle *BottleMeta) error
- func RemoveFile(ownerId int64, file *FileInfo) error
- func RemoveFolderAndSub(folder *FolderInfo, folders []*FolderInfo, files []*FileInfo) error
- func UpdateBottle(meta *BottleMeta) error
- func UpdateFiles(file *FileInfo) error
- func UpdateFolder(folder *FolderInfo) error
- type BottleMeta
- type FileInfo
- func GetFileById(ownerId, id int64) (*FileInfo, error)
- func GetFileByUploadMeta(ownerId int64, filename string, folderId int64, metaId int64) (*FileInfo, error)
- func GetFilesByFolderId(ownerId, folderId int64, filterFiles []int64) ([]*FileInfo, error)
- func GetFilesByFolderIds(ownerId int64, parentIds []int64) ([]*FileInfo, error)
- type FileMeta
- type FolderInfo
- func GetFolderById(ownerId int64, id int64) (*FolderInfo, error)
- func GetFoldersByIds(ownerId int64, ids []int64) ([]*FolderInfo, error)
- func GetFoldersByParentId(ownerId, parentId int64, filterFolders []int64) ([]*FolderInfo, error)
- func GetFoldersByParentIds(ownerId int64, parentIds []int64) ([]*FolderInfo, error)
- func GetFoldersByPath(ownerId int64, names []string, baseFolder int64, filterFolders []int64) (*FolderInfo, error)
- func VirtualRoot() *FolderInfo
Constants ¶
View Source
const RootId int64 = -1
Variables ¶
This section is empty.
Functions ¶
func CreateFile ¶
func CreateFileMeta ¶
func CreateFolder ¶
func CreateFolder(folder *FolderInfo) error
func InitBottle ¶
func InitBottle(bottle *BottleMeta) error
func RemoveFile ¶
func RemoveFolderAndSub ¶
func RemoveFolderAndSub(folder *FolderInfo, folders []*FolderInfo, files []*FileInfo) error
func UpdateBottle ¶
func UpdateBottle(meta *BottleMeta) error
func UpdateFiles ¶
func UpdateFolder ¶
func UpdateFolder(folder *FolderInfo) error
Types ¶
type BottleMeta ¶
type BottleMeta struct { db.BasicModel UserID int64 `gorm:"not null"` Capacity int64 `gorm:"type:bigint;not null"` // b Remain int64 `gorm:"type:bigint;not null"` // b }
user store space metadata
func GetBottlesById ¶
func GetBottlesById(id int64) (*BottleMeta, error)
func GetBottlesByUserId ¶
func GetBottlesByUserId(uid int64) (*BottleMeta, error)
func (BottleMeta) TableName ¶
func (BottleMeta) TableName() string
type FileInfo ¶
type FileInfo struct { db.BasicModel Name string `gorm:"type:varchar(128);not null"` FileId int64 `grom:"not null"` OwnerId int64 `gorm:"not null"` FolderId int64 `gorm:"not null"` Size int64 `gorm:"not null"` Metadata FileMeta `gorm:"foreignkey:FileId;save_associations:false;preload:false"` }
func GetFileById ¶
func GetFileByUploadMeta ¶
func GetFilesByFolderId ¶
func GetFilesByFolderIds ¶
func (*FileInfo) FromUploadMeta ¶
func (f *FileInfo) FromUploadMeta(meta *weed.FileUploadMeta)
type FileMeta ¶
type FileMeta struct { db.BasicModel Fid string `gorm:"type:varchar(64);not null"` Size int64 `gorm:"type:bigint;not null"` Hash string `gorm:"type:varchar(128);not null"` ChunkManifest string `gorm:"type:text;not null"` }
func GetFileMetaByHash ¶
func GetFileMetaById ¶
func (*FileMeta) FromUploadMeta ¶
func (f *FileMeta) FromUploadMeta(meta *weed.FileUploadMeta)
func (*FileMeta) GetChunkInfo ¶
func (f *FileMeta) GetChunkInfo() (cm *weed.ChunkManifest, err error)
type FolderInfo ¶
type FolderInfo struct { db.BasicModel Name string `gorm:"type:varchar(128);not null"` ParentId int64 `gorm:"not null"` OwnerId int64 `gorm:"not null"` }
func GetFolderById ¶
func GetFolderById(ownerId int64, id int64) (*FolderInfo, error)
func GetFoldersByIds ¶
func GetFoldersByIds(ownerId int64, ids []int64) ([]*FolderInfo, error)
func GetFoldersByParentId ¶
func GetFoldersByParentId(ownerId, parentId int64, filterFolders []int64) ([]*FolderInfo, error)
func GetFoldersByParentIds ¶
func GetFoldersByParentIds(ownerId int64, parentIds []int64) ([]*FolderInfo, error)
func GetFoldersByPath ¶
func VirtualRoot ¶
func VirtualRoot() *FolderInfo
func (FolderInfo) TableName ¶
func (FolderInfo) TableName() string
Click to show internal directories.
Click to hide internal directories.