Documentation
¶
Index ¶
- func ExtractFolder(AbstractDriverFiles []AbstractDriverFile, extractFolder string)
- func GetThumb(AbstractDriverFile AbstractDriverFile) (thumb string, ok bool)
- func GetUrl(AbstractDriverFile AbstractDriverFile) (url string, ok bool)
- func SortFiles(AbstractDriverFiles []AbstractDriverFile, orderBy, orderDirection string)
- func WrapAbstractDriverFilesName(AbstractDriverFiles []AbstractDriverFile)
- type AbstractDriverFile
- type AbstractDriverFileMerge
- type AbstractDriverFileUnwrap
- type AbstractDriverFileWrapName
- type Additional
- type Config
- type Copy
- type Driver
- type DriverFile
- type DriverFileThumb
- type DriverFileThumbURL
- type DriverFileURL
- type FileStreamer
- type FsOtherArgs
- type GetRooter
- type Getter
- type Link
- type LinkArgs
- type ListArgs
- type Meta
- type Mkdir
- type Move
- type OtherArgs
- type Progress
- type Put
- type Reader
- type Remove
- type Rename
- type RootPath
- type SetPath
- type Thumb
- type Thumbnail
- type URL
- type UpdateProgress
- type Url
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractFolder ¶
func ExtractFolder(AbstractDriverFiles []AbstractDriverFile, extractFolder string)
func GetThumb ¶
func GetThumb(AbstractDriverFile AbstractDriverFile) (thumb string, ok bool)
func GetUrl ¶
func GetUrl(AbstractDriverFile AbstractDriverFile) (url string, ok bool)
func SortFiles ¶
func SortFiles(AbstractDriverFiles []AbstractDriverFile, orderBy, orderDirection string)
func WrapAbstractDriverFilesName ¶
func WrapAbstractDriverFilesName(AbstractDriverFiles []AbstractDriverFile)
Types ¶
type AbstractDriverFile ¶
type AbstractDriverFile interface { GetSize() int64 GetName() string ModTime() time.Time IsDir() bool // The internal information of the driver. // If you want to use it, please understand what it means GetID() string GetPath() string }
func UnwrapAbstractDriverFile ¶
func UnwrapAbstractDriverFile(AbstractDriverFile AbstractDriverFile) AbstractDriverFile
func WrapAbstractDriverFileName ¶
func WrapAbstractDriverFileName(AbstractDriverFiles AbstractDriverFile) AbstractDriverFile
type AbstractDriverFileMerge ¶
type AbstractDriverFileMerge struct {
// contains filtered or unexported fields
}
func (*AbstractDriverFileMerge) InitHideReg ¶
func (om *AbstractDriverFileMerge) InitHideReg(hides string)
func (*AbstractDriverFileMerge) Merge ¶
func (om *AbstractDriverFileMerge) Merge(AbstractDriverFiles []AbstractDriverFile, AbstractDriverFiles_ ...AbstractDriverFile) []AbstractDriverFile
func (*AbstractDriverFileMerge) Reset ¶
func (om *AbstractDriverFileMerge) Reset()
type AbstractDriverFileUnwrap ¶
type AbstractDriverFileUnwrap interface {
Unwrap() AbstractDriverFile
}
type AbstractDriverFileWrapName ¶
type AbstractDriverFileWrapName struct { Name string AbstractDriverFile }
func (*AbstractDriverFileWrapName) GetName ¶
func (o *AbstractDriverFileWrapName) GetName() string
func (*AbstractDriverFileWrapName) Unwrap ¶
func (o *AbstractDriverFileWrapName) Unwrap() AbstractDriverFile
type Additional ¶
type Additional interface{}
type Config ¶
type Config struct { Name string `json:"name"` LocalSort bool `json:"local_sort"` OnlyLocal bool `json:"only_local"` OnlyProxy bool `json:"only_proxy"` NoCache bool `json:"no_cache"` NoUpload bool `json:"no_upload"` NeedMs bool `json:"need_ms"` // if need get message from user, such as validate code DefaultRoot string `json:"default_root"` CheckStatus bool `json:"-"` Alert string `json:"alert"` //info,success,warning,danger NoOverwriteUpload bool `json:"-"` }
type Copy ¶
type Copy interface {
Copy(ctx context.Context, srcObj, dstDir AbstractDriverFile) error
}
type DriverFile ¶
type DriverFile struct { ID string Path string Name string Size int64 Modified time.Time IsFolder bool }
func (*DriverFile) GetID ¶
func (o *DriverFile) GetID() string
func (*DriverFile) GetName ¶
func (o *DriverFile) GetName() string
func (*DriverFile) GetPath ¶
func (o *DriverFile) GetPath() string
func (*DriverFile) GetSize ¶
func (o *DriverFile) GetSize() int64
func (*DriverFile) IsDir ¶
func (o *DriverFile) IsDir() bool
func (*DriverFile) ModTime ¶
func (o *DriverFile) ModTime() time.Time
func (*DriverFile) SetPath ¶
func (o *DriverFile) SetPath(id string)
type DriverFileThumb ¶
type DriverFileThumb struct { DriverFile Thumbnail }
type DriverFileThumbURL ¶
type DriverFileThumbURL struct { DriverFile Thumbnail Url }
type DriverFileURL ¶
type DriverFileURL struct { DriverFile Url }
type FileStreamer ¶
type FileStreamer interface { io.ReadCloser AbstractDriverFile GetMimetype() string SetReadCloser(io.ReadCloser) NeedStore() bool GetReadCloser() io.ReadCloser GetOld() AbstractDriverFile }
type FsOtherArgs ¶
type GetRooter ¶
type GetRooter interface {
GetRoot(ctx context.Context) (AbstractDriverFile, error)
}
type Getter ¶
type Getter interface { // Get file by path, the path haven't been joined with root path Get(ctx context.Context, path string) (AbstractDriverFile, error) }
type Meta ¶
type Meta interface { Config() Config // GetStorage just get raw storage, no need to implement, because model.Storage have implemented // SetStorage(model.Storage) // GetAddition Additional is used for unmarshal of JSON, so need return pointer GetAddition() Additional // Init If already initialized, drop first Init(ctx context.Context) error Drop(ctx context.Context) error }
type Mkdir ¶
type Mkdir interface {
MakeDir(ctx context.Context, parentDir AbstractDriverFile, dirName string) error
}
type Move ¶
type Move interface {
Move(ctx context.Context, srcObj, dstDir AbstractDriverFile) error
}
type OtherArgs ¶
type OtherArgs struct { AbstractDriverFile AbstractDriverFile Method string Data interface{} }
type Progress ¶
func NewProgress ¶
func NewProgress(total int64, up UpdateProgress) *Progress
type Put ¶
type Put interface {
Put(ctx context.Context, dstDir AbstractDriverFile, stream FileStreamer, up UpdateProgress) error
}
type Reader ¶
type Reader interface { // List files in the path // if identify files by path, need to set ID with path,like path.Join(dir.GetID(), obj.GetName()) // if identify files by id, need to set ID with corresponding id List(ctx context.Context, dir AbstractDriverFile, args ListArgs) ([]AbstractDriverFile, error) // Link get url/filepath/reader of file Link(ctx context.Context, file AbstractDriverFile, args LinkArgs) (*Link, error) }
type Rename ¶
type Rename interface {
Rename(ctx context.Context, srcObj AbstractDriverFile, newName string) error
}
type RootPath ¶
type RootPath struct {
RootFolderPath string `json:"root_folder_path"`
}
func (RootPath) GetRootPath ¶
func (*RootPath) SetRootPath ¶
type UpdateProgress ¶
type UpdateProgress func(percentage int)
Click to show internal directories.
Click to hide internal directories.