Documentation ¶
Index ¶
- type DownloadAction
- type EnumFilesAction
- func (action *EnumFilesAction) ListAll(path string, includeSubdirectories bool) ([]*storage.ResourceInfo, error)
- func (action *EnumFilesAction) ListAllWithFilter(path string, includeSubdirectories bool, ...) ([]*storage.ResourceInfo, error)
- func (action *EnumFilesAction) ListDirs(path string, includeSubdirectories bool) ([]*storage.ResourceInfo, error)
- func (action *EnumFilesAction) ListFiles(path string, includeSubdirectories bool) ([]*storage.ResourceInfo, error)
- type FileOperationsAction
- func (action *FileOperationsAction) DirExists(path string) bool
- func (action *FileOperationsAction) FileExists(path string) bool
- func (action *FileOperationsAction) GetHome() (string, error)
- func (action *FileOperationsAction) MakePath(path string) error
- func (action *FileOperationsAction) Move(source string, target string) error
- func (action *FileOperationsAction) MoveTo(source string, path string) error
- func (action *FileOperationsAction) Remove(path string) error
- func (action *FileOperationsAction) ResourceExists(path string) bool
- func (action *FileOperationsAction) Stat(path string) (*provider.ResourceInfo, error)
- type RecycleOperationsAction
- type UploadAction
- func (action *UploadAction) Upload(data io.Reader, size int64, target string) (*provider.ResourceInfo, error)
- func (action *UploadAction) UploadBytes(data []byte, target string) (*provider.ResourceInfo, error)
- func (action *UploadAction) UploadFile(file *os.File, target string) (*provider.ResourceInfo, error)
- func (action *UploadAction) UploadFileTo(file *os.File, path string) (*provider.ResourceInfo, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DownloadAction ¶
type DownloadAction struct {
// contains filtered or unexported fields
}
DownloadAction is used to download files through Reva. WebDAV will be used automatically if the endpoint supports it.
func MustNewDownloadAction ¶
func MustNewDownloadAction(session *sdk.Session) *DownloadAction
MustNewDownloadAction creates a new download action and panics on failure.
func NewDownloadAction ¶
func NewDownloadAction(session *sdk.Session) (*DownloadAction, error)
NewDownloadAction creates a new download action.
func (*DownloadAction) Download ¶
func (action *DownloadAction) Download(fileInfo *provider.ResourceInfo) ([]byte, error)
Download retrieves the data of the provided resource.
func (*DownloadAction) DownloadFile ¶
func (action *DownloadAction) DownloadFile(path string) ([]byte, error)
DownloadFile retrieves the data of the provided file path. The method first tries to retrieve information about the remote file by performing a "stat" on it.
type EnumFilesAction ¶
type EnumFilesAction struct {
// contains filtered or unexported fields
}
EnumFilesAction offers functions to enumerate files and directories.
func MustNewEnumFilesAction ¶
func MustNewEnumFilesAction(session *sdk.Session) *EnumFilesAction
MustNewEnumFilesAction creates a new enum files action and panics on failure.
func NewEnumFilesAction ¶
func NewEnumFilesAction(session *sdk.Session) (*EnumFilesAction, error)
NewEnumFilesAction creates a new enum files action.
func (*EnumFilesAction) ListAll ¶
func (action *EnumFilesAction) ListAll(path string, includeSubdirectories bool) ([]*storage.ResourceInfo, error)
ListAll retrieves all files and directories contained in the provided path.
func (*EnumFilesAction) ListAllWithFilter ¶
func (action *EnumFilesAction) ListAllWithFilter(path string, includeSubdirectories bool, filter func(*storage.ResourceInfo) bool) ([]*storage.ResourceInfo, error)
ListAllWithFilter retrieves all files and directories that fulfill the provided predicate.
func (*EnumFilesAction) ListDirs ¶
func (action *EnumFilesAction) ListDirs(path string, includeSubdirectories bool) ([]*storage.ResourceInfo, error)
ListDirs retrieves all directories contained in the provided path.
func (*EnumFilesAction) ListFiles ¶
func (action *EnumFilesAction) ListFiles(path string, includeSubdirectories bool) ([]*storage.ResourceInfo, error)
ListFiles retrieves all files contained in the provided path.
type FileOperationsAction ¶
type FileOperationsAction struct {
// contains filtered or unexported fields
}
FileOperationsAction offers basic file operations.
func MustNewFileOperationsAction ¶
func MustNewFileOperationsAction(session *sdk.Session) *FileOperationsAction
MustNewFileOperationsAction creates a new file operations action and panics on failure.
func NewFileOperationsAction ¶
func NewFileOperationsAction(session *sdk.Session) (*FileOperationsAction, error)
NewFileOperationsAction creates a new file operations action.
func (*FileOperationsAction) DirExists ¶
func (action *FileOperationsAction) DirExists(path string) bool
DirExists checks whether the specified directory exists.
func (*FileOperationsAction) FileExists ¶
func (action *FileOperationsAction) FileExists(path string) bool
FileExists checks whether the specified file exists.
func (*FileOperationsAction) GetHome ¶ added in v0.0.14
func (action *FileOperationsAction) GetHome() (string, error)
GetHome retrieves the home directory path of the current user.
func (*FileOperationsAction) MakePath ¶
func (action *FileOperationsAction) MakePath(path string) error
MakePath creates the entire directory tree specified by the given path.
func (*FileOperationsAction) Move ¶
func (action *FileOperationsAction) Move(source string, target string) error
Move moves the specified source to a new location. The caller must ensure that the target directory exists.
func (*FileOperationsAction) MoveTo ¶
func (action *FileOperationsAction) MoveTo(source string, path string) error
MoveTo moves the specified source to the target directory, creating it if necessary.
func (*FileOperationsAction) Remove ¶
func (action *FileOperationsAction) Remove(path string) error
Remove deletes the specified resource.
func (*FileOperationsAction) ResourceExists ¶
func (action *FileOperationsAction) ResourceExists(path string) bool
ResourceExists checks whether the specified resource exists (w/o checking for its actual type).
func (*FileOperationsAction) Stat ¶
func (action *FileOperationsAction) Stat(path string) (*provider.ResourceInfo, error)
Stat queries the file information of the specified remote resource.
type RecycleOperationsAction ¶ added in v0.0.14
type RecycleOperationsAction struct {
// contains filtered or unexported fields
}
RecycleOperationsAction offers recycle bin operations.
func MustNewRecycleOperationsAction ¶ added in v0.0.14
func MustNewRecycleOperationsAction(session *sdk.Session) *RecycleOperationsAction
MustNewRecycleOperationsAction creates a new recycle operations action and panics on failure.
func NewRecycleOperationsAction ¶ added in v0.0.14
func NewRecycleOperationsAction(session *sdk.Session) (*RecycleOperationsAction, error)
NewRecycleOperationsAction creates a new recycle operations action.
func (*RecycleOperationsAction) Purge ¶ added in v0.0.14
func (action *RecycleOperationsAction) Purge() error
Purge purges the entire recycle bin of the current user.
type UploadAction ¶
type UploadAction struct { EnableTUS bool // contains filtered or unexported fields }
UploadAction is used to upload files through Reva. WebDAV will be used automatically if the endpoint supports it. The EnableTUS flag specifies whether to use TUS if WebDAV is not supported.
func MustNewUploadAction ¶
func MustNewUploadAction(session *sdk.Session) *UploadAction
MustNewUploadAction creates a new upload action and panics on failure.
func NewUploadAction ¶
func NewUploadAction(session *sdk.Session) (*UploadAction, error)
NewUploadAction creates a new upload action.
func (*UploadAction) Upload ¶
func (action *UploadAction) Upload(data io.Reader, size int64, target string) (*provider.ResourceInfo, error)
Upload uploads data from the provided reader to the target.
func (*UploadAction) UploadBytes ¶
func (action *UploadAction) UploadBytes(data []byte, target string) (*provider.ResourceInfo, error)
UploadBytes uploads the provided byte data to the target.
func (*UploadAction) UploadFile ¶
func (action *UploadAction) UploadFile(file *os.File, target string) (*provider.ResourceInfo, error)
UploadFile uploads the provided file to the target.
func (*UploadAction) UploadFileTo ¶
func (action *UploadAction) UploadFileTo(file *os.File, path string) (*provider.ResourceInfo, error)
UploadFileTo uploads the provided file to the target directory, keeping the original file name.