mirror of
https://gitlab.bertha.cloud/partitio/Nextcloud-Partitio/gonextcloud
synced 2025-06-25 13:22:27 +00:00
fix #6: added gowebdav and webdav interface (TODO: webdav tests)
This commit is contained in:
@ -9,6 +9,7 @@ type Client interface {
|
||||
Shares() Shares
|
||||
Users() Users
|
||||
Groups() Groups
|
||||
WebDav() WebDav
|
||||
Login(username string, password string) error
|
||||
Logout() error
|
||||
}
|
||||
|
34
types/webdav.go
Normal file
34
types/webdav.go
Normal file
@ -0,0 +1,34 @@
|
||||
package types
|
||||
|
||||
import (
|
||||
"io"
|
||||
"os"
|
||||
)
|
||||
|
||||
// WebDav available methods
|
||||
type WebDav interface {
|
||||
// ReadDir reads the contents of a remote directory
|
||||
ReadDir(path string) ([]os.FileInfo, error)
|
||||
// Stat returns the file stats for a specified path
|
||||
Stat(path string) (os.FileInfo, error)
|
||||
// Remove removes a remote file
|
||||
Remove(path string) error
|
||||
// RemoveAll removes remote files
|
||||
RemoveAll(path string) error
|
||||
// Mkdir makes a directory
|
||||
Mkdir(path string, _ os.FileMode) error
|
||||
// MkdirAll like mkdir -p, but for webdav
|
||||
MkdirAll(path string, _ os.FileMode) error
|
||||
// Rename moves a file from A to B
|
||||
Rename(oldpath, newpath string, overwrite bool) error
|
||||
// Copy copies a file from A to B
|
||||
Copy(oldpath, newpath string, overwrite bool) error
|
||||
// Read reads the contents of a remote file
|
||||
Read(path string) ([]byte, error)
|
||||
// ReadStream reads the stream for a given path
|
||||
ReadStream(path string) (io.ReadCloser, error)
|
||||
// Write writes data to a given path
|
||||
Write(path string, data []byte, _ os.FileMode) error
|
||||
// WriteStream writes a stream
|
||||
WriteStream(path string, stream io.Reader, _ os.FileMode) error
|
||||
}
|
Reference in New Issue
Block a user