Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileCopyStatus ¶
type FileDestination ¶
type FileDestination struct { // FileName -> if necessary you can override the file name // it will override even for DirPath & FilePath FileName string // if none of the lower params are indicated, it will take the current files basedir and it will // recreate on the destination location //========= Optional Params ===========\\ // DirPath -> is optional, a new folder path is indicated, the file name remains the same! DirPath string // FilePath -> is optional, a new full file path is indicated (it includes as the dir path) FilePath string // FileMode -> is optional, If you need to override the currents file mode, the set here FileMode os.FileMode // if you want to receive in real time the status (how much left to copy) // put a callback handler over here OnCopy FileOnCopy }
FileDestination -> is used when copying or moving to a new destination
type FileInfoInterface ¶
type FileInfoInterface interface { // ToStruct -> Converts to a struct ToStruct() FileInfo // ID - is available only when saving to a storage which supports File Identification ID() *uuid.UUID // Name() string FullName() string // Path() string DirPath() string ContentType() string Size() int64 Extension() string Mode() os.FileMode // UpdatedAt() time.Time CreatedAt() time.Time // Sys - other system info for this file Sys() Any }
type FileInterface ¶
type FileInterface interface { // Read() ([]byte, error) Info() FileInfoInterface // TODO: we can return all the functions from the current file over there // Get location of the file Location() LocationInterface }
type FileOnCopy ¶
type FileOnCopy func(status FileCopyStatus)
type LocationInterface ¶
type LocationInterface interface { // Open the location Open() (bool, error) CopyFile(file FileInterface, dest FileDestination) (FileInterface, error) MoveFile(file FileInterface, dest FileDestination) (FileInterface, error) // DeleteFile - File status will be used for deletion DeleteFile(file FileInterface) error // FileFromInfo -> it recreates the file struct/object from FileInfo so further manipulations can be made FileFromInfo(fileInfo FileInfo) (FileInterface, error) FileFromInfoMap(fileInfo map[string]interface{}) (FileInterface, error) FileFromInfoJson(fileInfo string) (FileInterface, error) }
Click to show internal directories.
Click to hide internal directories.