davClient

package
v0.4.45 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatOverwrite

func FormatOverwrite(overwrite bool) string

FormatOverwrite formats an Overwrite header.

func IsNotFound

func IsNotFound(err error) bool

func ParseOverwrite

func ParseOverwrite(s string) (bool, error)

ParseOverwrite parses an Overwrite header.

Types

type Client

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

Client provides access to a remote WebDAV filesystem.

func NewClient

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

func (*Client) CopyAll

func (c *Client) CopyAll(ctx context.Context, name, dest string, overwrite bool) error

func (*Client) Create

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

func (*Client) CreateWithModTime

func (c *Client) CreateWithModTime(ctx context.Context, name string, modTime time.Time) (io.WriteCloser, error)

func (*Client) FindCurrentUserPrincipal

func (c *Client) FindCurrentUserPrincipal(ctx context.Context) (string, error)

func (*Client) Mkdir

func (c *Client) Mkdir(ctx context.Context, name string) error

func (*Client) MoveAll

func (c *Client) MoveAll(ctx context.Context, name, dest string, overwrite bool) error

func (*Client) Open

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

func (*Client) Readdir

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

func (*Client) RemoveAll

func (c *Client) RemoveAll(ctx context.Context, name string) error

func (*Client) Stat

func (c *Client) Stat(ctx context.Context, name string) (*FileInfo, error)

func (*Client) Touch

func (c *Client) Touch(ctx context.Context, path string, mtime time.Time) error

type Depth

type Depth int

Depth indicates whether a request applies to the resource's members. It's defined in RFC 4918 section 10.2.

const (
	// DepthZero indicates that the request applies only to the resource.
	DepthZero Depth = 0
	// DepthOne indicates that the request applies to the resource and its
	// internal members only.
	DepthOne Depth = 1
	// DepthInfinity indicates that the request applies to the resource and all
	// of its members.
	DepthInfinity Depth = -1
)

func ParseDepth

func ParseDepth(s string) (Depth, error)

ParseDepth parses a Depth header.

func (Depth) String

func (d Depth) String() string

String formats the depth.

type FileInfo

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

type HTTPClient

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

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

func HTTPClientWithBasicAuth

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 HTTPError

type HTTPError struct {
	Code int
	Err  error
}

func HTTPErrorFromError

func HTTPErrorFromError(err error) *HTTPError

func HTTPErrorf

func HTTPErrorf(code int, format string, a ...interface{}) *HTTPError

func (*HTTPError) Error

func (err *HTTPError) Error() string

func (*HTTPError) Unwrap

func (err *HTTPError) Unwrap() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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