webdav

package
v0.0.0-...-8af6868 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2025 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const XInhibitRedirect = "X-Gowebdav-Inhibit-Redirect"

Variables

View Source
var ErrAuthChanged = errors.New("authentication failed, change algorithm")
View Source
var ErrTooManyRedirects = errors.New("stopped after 10 redirects")

Functions

func FixSlash

func FixSlash(s string) string

func FixSlashes

func FixSlashes(s string) string

func Join

func Join(path0 string, path1 string) string

func NewPathError

func NewPathError(op string, path string, statusCode int) error

func NewPathErrorErr

func NewPathErrorErr(op string, path string, err error) error

func PathEscape

func PathEscape(path string) string

func SplitPathToHierarchy

func SplitPathToHierarchy(fullPath string) []string

func String

func String(r io.Reader) string

Types

type AuthFactory

type AuthFactory func(c *http.Client, rs *http.Response, path string) (auth Authenticator, err error)

type Authenticator

type Authenticator interface {
	Authorize(c *http.Client, rq *http.Request, path string) error
	Verify(c *http.Client, rs *http.Response, path string) (redo bool, err error)
	Clone() Authenticator
	io.Closer
}

func NewDigestAuth

func NewDigestAuth(login, secret string, rs *http.Response) (Authenticator, error)

func NewPassportAuth

func NewPassportAuth(c *http.Client, user, pw, partnerURL string, header *http.Header) (Authenticator, error)

type Authorizer

type Authorizer interface {
	NewAuthenticator(body io.Reader) (Authenticator, io.Reader)
	AddAuthenticator(key string, fn AuthFactory)
}

func NewAutoAuth

func NewAutoAuth(login string, secret string) Authorizer

func NewEmptyAuth

func NewEmptyAuth() Authorizer

func NewPreemptiveAuth

func NewPreemptiveAuth(auth Authenticator) Authorizer

type BasicAuth

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

func (*BasicAuth) Authorize

func (b *BasicAuth) Authorize(c *http.Client, rq *http.Request, path string) error

func (*BasicAuth) Clone

func (b *BasicAuth) Clone() Authenticator

func (*BasicAuth) Close

func (b *BasicAuth) Close() error

func (*BasicAuth) String

func (b *BasicAuth) String() string

func (*BasicAuth) Verify

func (b *BasicAuth) Verify(c *http.Client, rs *http.Response, path string) (redo bool, err error)

type Client

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

func NewAuthClient

func NewAuthClient(uri string, auth Authorizer) *Client

func NewClient

func NewClient(uri, user, pw string) *Client

func (*Client) Connect

func (c *Client) Connect() error

func (*Client) MkdirAll

func (c *Client) MkdirAll(path string, _ os.FileMode) (err error)

func (*Client) ReadDir

func (c *Client) ReadDir(path string) ([]os.FileInfo, error)

func (*Client) ReadStream

func (c *Client) ReadStream(path string) (io.ReadCloser, error)

func (*Client) RemoveAll

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

func (*Client) SetTransport

func (c *Client) SetTransport(transport http.RoundTripper)

func (*Client) Stat

func (c *Client) Stat(path string) (os.FileInfo, error)

func (*Client) WriteStream

func (c *Client) WriteStream(path string, stream io.Reader, _ os.FileMode) (err error)

type DigestAuth

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

func (*DigestAuth) Authorize

func (d *DigestAuth) Authorize(c *http.Client, rq *http.Request, path string) error

func (*DigestAuth) Clone

func (d *DigestAuth) Clone() Authenticator

func (*DigestAuth) Close

func (d *DigestAuth) Close() error

func (*DigestAuth) String

func (d *DigestAuth) String() string

func (*DigestAuth) Verify

func (d *DigestAuth) Verify(c *http.Client, rs *http.Response, path string) (redo bool, err error)

type File

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

func (File) ContentType

func (f File) ContentType() string

func (File) ETag

func (f File) ETag() string

func (File) IsDir

func (f File) IsDir() bool

func (File) ModTime

func (f File) ModTime() time.Time

func (File) Mode

func (f File) Mode() os.FileMode

func (File) Name

func (f File) Name() string

func (File) Size

func (f File) Size() int64

func (File) String

func (f File) String() string

func (File) Sys

func (f File) Sys() interface{}

type PassportAuth

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

func (*PassportAuth) Authorize

func (p *PassportAuth) Authorize(c *http.Client, rq *http.Request, path string) error

func (*PassportAuth) Clone

func (p *PassportAuth) Clone() Authenticator

func (*PassportAuth) Close

func (p *PassportAuth) Close() error

func (*PassportAuth) String

func (p *PassportAuth) String() string

func (*PassportAuth) Verify

func (p *PassportAuth) Verify(c *http.Client, rs *http.Response, path string) (redo bool, err error)

type StatusError

type StatusError struct {
	Status int
}

func (StatusError) Error

func (se StatusError) Error() string

Jump to

Keyboard shortcuts

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