webdav

package
v0.0.0-...-1b1593a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2017 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 or you can make a remote of type webdav to read and
write it.

NB at the moment each directory listing reads the start of each file
which is undesirable: see https://github.com/golang/go/issues/22577

` + vfs.Help,
	Run: func(command *cobra.Command, args []string) {
		cmd.CheckArgs(1, 1, command, args)
		fsrc := cmd.NewFsSrc(args)
		cmd.Run(false, false, command, func() error {
			return serveWebDav(fsrc)
		})
	},
}

Command definition for cobra

Functions

This section is empty.

Types

type WebDAV

type WebDAV struct {
	// contains filtered or unexported fields
}

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) Mkdir

func (w *WebDAV) Mkdir(ctx context.Context, name string, perm os.FileMode) (err error)

Mkdir creates a directory

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

func (*WebDAV) RemoveAll

func (w *WebDAV) RemoveAll(ctx context.Context, name string) (err error)

RemoveAll removes a file or a directory and its contents

func (*WebDAV) Rename

func (w *WebDAV) Rename(ctx context.Context, oldName, newName string) (err error)

Rename a file or a directory

func (*WebDAV) Stat

func (w *WebDAV) Stat(ctx context.Context, name string) (fi os.FileInfo, err error)

Stat returns info about the file or directory

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL