Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanOutdatedLocalFiles ¶
Types ¶
type FSFileInfo ¶
type FSFileInfo struct {
// contains filtered or unexported fields
}
FSFileInfo implements fs.FileInfo interface
func (*FSFileInfo) Size ¶
func (fi *FSFileInfo) Size() int64
length in bytes for regular files; system-dependent for others
type File ¶
type File struct { ID string `gorm:"size:256;not null;primaryKey" json:"id"` Name string `gorm:"not null;" json:"name"` Ext string `gorm:"not null;" json:"ext"` Size int64 `gorm:"not null;" json:"size"` Data []byte `gorm:"not null" json:"-"` Time time.Time `gorm:"not null" json:"time,omitempty"` }
func SaveUploadedFile ¶
type FileResult ¶
type FileResult struct {
File *File `json:"file"`
}
type FilesResult ¶
type FilesResult struct {
Files []*File `json:"files"`
}
type XFS ¶
type XFS interface { fs.FS SaveFile(id string, filename string, data []byte, modTime ...time.Time) (*File, error) ReadFile(fid string) ([]byte, error) DeleteFile(id string) error DeleteFiles(ids ...string) (int64, error) DeletePrefix(prefix string) (int64, error) DeleteBefore(before time.Time) (int64, error) DeleteWhere(where string, args ...any) (int64, error) DeleteAll() (int64, error) Truncate() error }
Click to show internal directories.
Click to hide internal directories.