webdav

package
v0.0.0-...-0e769ad Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2025 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package webdav is a webdav client library.

Index

Constants

View Source
const ListFilesPayload = `` /* 419-byte string literal not displayed */

Variables

View Source
var (
	// ErrInvalidAuth is used when an authentication error occurs (invalid
	// credentials).
	ErrInvalidAuth = errors.New("invalid authentication")
	// ErrAlreadyExist is used when trying to create a directory that already
	// exists.
	ErrAlreadyExist = errors.New("it already exists")
	// ErrParentNotFound is used when trying to create a directory and the
	// parent directory does not exist.
	ErrParentNotFound = errors.New("parent directory does not exist")
	// ErrNotFound is used when the given file/directory has not been found.
	ErrNotFound = errors.New("file/directory not found")
	// ErrInternalServerError is used when something unexpected happens.
	ErrInternalServerError = errors.New("internal server error")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	Scheme   string
	Host     string
	Username string
	Password string
	BasePath string
	Logger   *logger.Entry
}

func (*Client) Copy

func (c *Client) Copy(oldPath, newPath string) error

func (*Client) Delete

func (c *Client) Delete(path string) error

func (*Client) Get

func (c *Client) Get(path string) (*Download, error)

func (*Client) List

func (c *Client) List(path string) ([]Item, error)

func (*Client) Mkcol

func (c *Client) Mkcol(path string) error

func (*Client) Move

func (c *Client) Move(oldPath, newPath string) error

func (*Client) Put

func (c *Client) Put(
	path string,
	contentLength int64,
	headers map[string]string,
	body io.Reader,
) error

type Download

type Download struct {
	Content      io.ReadCloser
	ETag         string
	Length       string
	Mime         string
	LastModified string
}

type Item

type Item struct {
	ID           string
	Type         string
	Href         string
	Name         string
	TrashedName  string
	RestorePath  string
	Size         uint64
	ContentType  string
	LastModified string
	ETag         string
}

Jump to

Keyboard shortcuts

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