go-webdav: github.com/emersion/go-webdav Index | Files | Directories

package webdav

import "github.com/emersion/go-webdav"

Package webdav provides a client and server WebDAV filesystem implementation.

WebDAV is defined in RFC 4918.

Index

Package Files

client.go fs_local.go server.go webdav.go

type Client Uses

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

Client provides access to a remote WebDAV filesystem.

func NewClient Uses

func NewClient(c HTTPClient, endpoint string) (*Client, error)

func (*Client) CopyAll Uses

func (c *Client) CopyAll(name, dest string, overwrite bool) error

func (*Client) Create Uses

func (c *Client) Create(name string) (io.WriteCloser, error)

func (*Client) FindCurrentUserPrincipal Uses

func (c *Client) FindCurrentUserPrincipal() (string, error)

func (*Client) Mkdir Uses

func (c *Client) Mkdir(name string) error

func (*Client) MoveAll Uses

func (c *Client) MoveAll(name, dest string, overwrite bool) error

func (*Client) Open Uses

func (c *Client) Open(name string) (io.ReadCloser, error)

func (*Client) Readdir Uses

func (c *Client) Readdir(name string, recursive bool) ([]FileInfo, error)

func (*Client) RemoveAll Uses

func (c *Client) RemoveAll(name string) error

func (*Client) Stat Uses

func (c *Client) Stat(name string) (*FileInfo, error)

type FileInfo Uses

type FileInfo struct {
    Path     string
    Size     int64
    ModTime  time.Time
    IsDir    bool
    MIMEType string
    ETag     string
}

type FileSystem Uses

type FileSystem interface {
    Open(name string) (io.ReadCloser, error)
    Stat(name string) (*FileInfo, error)
    Readdir(name string, recursive bool) ([]FileInfo, error)
    Create(name string) (io.WriteCloser, error)
    RemoveAll(name string) error
    Mkdir(name string) error
    Copy(name, dest string, recursive, overwrite bool) (created bool, err error)
    MoveAll(name, dest string, overwrite bool) (created bool, err error)
}

FileSystem is a WebDAV server backend.

type HTTPClient Uses

type HTTPClient interface {
    Do(req *http.Request) (*http.Response, error)
}

HTTPClient performs HTTP requests. It's implemented by *http.Client.

func HTTPClientWithBasicAuth Uses

func HTTPClientWithBasicAuth(c HTTPClient, username, password string) HTTPClient

HTTPClientWithBasicAuth returns an HTTP client that adds basic authentication to all outgoing requests. If c is nil, http.DefaultClient is used.

type Handler Uses

type Handler struct {
    FileSystem FileSystem
}

Handler handles WebDAV HTTP requests. It can be used to create a WebDAV server.

func (*Handler) ServeHTTP Uses

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements http.Handler.

type LocalFileSystem Uses

type LocalFileSystem string

func (LocalFileSystem) Copy Uses

func (fs LocalFileSystem) Copy(src, dst string, recursive, overwrite bool) (created bool, err error)

func (LocalFileSystem) Create Uses

func (fs LocalFileSystem) Create(name string) (io.WriteCloser, error)

func (LocalFileSystem) Mkdir Uses

func (fs LocalFileSystem) Mkdir(name string) error

func (LocalFileSystem) MoveAll Uses

func (fs LocalFileSystem) MoveAll(src, dst string, overwrite bool) (created bool, err error)

func (LocalFileSystem) Open Uses

func (fs LocalFileSystem) Open(name string) (io.ReadCloser, error)

func (LocalFileSystem) Readdir Uses

func (fs LocalFileSystem) Readdir(name string, recursive bool) ([]FileInfo, error)

func (LocalFileSystem) RemoveAll Uses

func (fs LocalFileSystem) RemoveAll(name string) error

func (LocalFileSystem) Stat Uses

func (fs LocalFileSystem) Stat(name string) (*FileInfo, error)

Directories

PathSynopsis
caldavPackage caldav provides a client and server CalDAV implementation.
carddavPackage carddav provides a client and server CardDAV implementation.
internalPackage internal provides low-level helpers for WebDAV clients and servers.

Package webdav imports 12 packages (graph) and is imported by 2 packages. Updated 2020-10-13. Refresh now. Tools for package owners.