Documentation ¶
Overview ¶
Package webdav implements a WebDAV server backed by rclone VFS
Index ¶
- Variables
- type FileInfo
- type Handle
- type WebDAV
- func (w *WebDAV) Mkdir(ctx context.Context, name string, perm os.FileMode) (err error)
- func (w *WebDAV) OpenFile(ctx context.Context, name string, flags int, perm os.FileMode) (file webdav.File, err error)
- func (w *WebDAV) RemoveAll(ctx context.Context, name string) (err error)
- func (w *WebDAV) Rename(ctx context.Context, oldName, newName string) (err error)
- func (w *WebDAV) Stat(ctx context.Context, name string) (fi os.FileInfo, err error)
Constants ¶
This section is empty.
Variables ¶
var Command = &cobra.Command{ Use: "webdav remote:path", Short: `Serve remote:path over webdav.`, Long: ` rclone serve webdav implements a basic webdav server to serve the remote over HTTP via the webdav protocol. This can be viewed with a webdav client, through a web browser, or you can make a remote of type webdav to read and write it. ### Webdav options #### --etag-hash This controls the ETag header. Without this flag the ETag will be based on the ModTime and Size of the object. If this flag is set to "auto" then rclone will choose the first supported hash on the backend or you can use a named hash such as "MD5" or "SHA-1". Use "rclone hashsum" to see the full list. ` + httplib.Help + vfs.Help + proxy.Help, RunE: func(command *cobra.Command, args []string) error { var f fs.Fs if proxyflags.Opt.AuthProxy == "" { cmd.CheckArgs(1, 1, command, args) f = cmd.NewFsSrc(args) } else { cmd.CheckArgs(0, 0, command, args) } hashType = hash.None if hashName == "auto" { hashType = f.Hashes().GetOne() } else if hashName != "" { err := hashType.Set(hashName) if err != nil { return err } } if hashType != hash.None { fs.Debugf(f, "Using hash %v for ETag", hashType) } cmd.Run(false, false, command, func() error { s := newWebDAV(context.Background(), f, &httpflags.Opt) err := s.serve() if err != nil { return err } s.Wait() return nil }) return nil }, }
Command definition for cobra
Functions ¶
This section is empty.
Types ¶
type FileInfo ¶
FileInfo represents info about a file satisfying os.FileInfo and also some additional interfaces for webdav for ETag and ContentType
func (FileInfo) ContentType ¶
ContentType returns a content type for the FileInfo
type Handle ¶
Handle represents an open file
type WebDAV ¶
WebDAV is a webdav.FileSystem interface
A FileSystem implements access to a collection of named files. The elements in a file path are separated by slash ('/', U+002F) characters, regardless of host operating system convention.
Each method has the same semantics as the os package's function of the same name.
Note that the os.Rename documentation says that "OS-specific restrictions might apply". In particular, whether or not renaming a file or directory overwriting another existing file or directory is an error is OS-dependent.
func (*WebDAV) OpenFile ¶
func (w *WebDAV) OpenFile(ctx context.Context, name string, flags int, perm os.FileMode) (file webdav.File, err error)
OpenFile opens a file or a directory