webdav

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package webdav keeps backups in a folder on a WebDAV server, through gowebdav.

Index

Constants

This section is empty.

Variables

View Source
var ErrURL = errors.New("webdav: URL must be http or https with a host")

ErrURL reports a server URL that is not http(s) with a host, or that carries user info, a query or a fragment.

Functions

func CheckURL

func CheckURL(raw string) (*url.URL, error)

CheckURL checks a server URL as Folder takes it.

Types

type Folder

type Folder struct {
	// URL is the server's WebDAV root, as
	// https://cloud.example.com/remote.php/dav/files/me/.
	URL string
	// Dir is the folder under URL, "" for URL itself.
	Dir            string
	User, Password string
	// HTTP gives the transport and the time limit; nil is backup.Client(nil).
	HTTP *http.Client
}

Folder is a folder of a WebDAV server that keeps backups.

func (*Folder) Check

func (f *Folder) Check(ctx context.Context) error

Check lists the folder, or the server's root while the folder is not made yet.

func (*Folder) Delete

func (f *Folder) Delete(ctx context.Context, name string) error

Delete removes the backup name.

func (*Folder) Get

func (f *Folder) Get(ctx context.Context, name string) ([]byte, error)

Get reads the backup name.

func (*Folder) List

func (f *Folder) List(ctx context.Context) ([]backup.Object, error)

List is the backups in the folder, none while it is not made.

func (*Folder) Put

func (f *Folder) Put(ctx context.Context, name string, data []byte) error

Put writes the backup name, making the folder when it is missing.

Jump to

Keyboard shortcuts

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