Documentation
¶
Index ¶
- Constants
- Variables
- func FixSlash(s string) string
- func FixSlashes(s string) string
- func Join(path0 string, path1 string) string
- func NewPathError(op string, path string, statusCode int) error
- func NewPathErrorErr(op string, path string, err error) error
- func PathEscape(path string) string
- func SplitPathToHierarchy(fullPath string) []string
- func String(r io.Reader) string
- type AuthFactory
- type Authenticator
- type Authorizer
- type BasicAuth
- type Client
- func (c *Client) Connect() error
- func (c *Client) MkdirAll(path string, _ os.FileMode) (err error)
- func (c *Client) ReadDir(path string) ([]os.FileInfo, error)
- func (c *Client) ReadStream(path string) (io.ReadCloser, error)
- func (c *Client) RemoveAll(path string) error
- func (c *Client) SetTransport(transport http.RoundTripper)
- func (c *Client) Stat(path string) (os.FileInfo, error)
- func (c *Client) WriteStream(path string, stream io.Reader, _ os.FileMode) (err error)
- type DigestAuth
- type File
- type PassportAuth
- func (p *PassportAuth) Authorize(c *http.Client, rq *http.Request, path string) error
- func (p *PassportAuth) Clone() Authenticator
- func (p *PassportAuth) Close() error
- func (p *PassportAuth) String() string
- func (p *PassportAuth) Verify(c *http.Client, rs *http.Response, path string) (redo bool, err error)
- type StatusError
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 FixSlashes ¶
func PathEscape ¶
func SplitPathToHierarchy ¶
Types ¶
type AuthFactory ¶
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 ¶
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) Clone ¶
func (b *BasicAuth) Clone() Authenticator
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewAuthClient ¶
func NewAuthClient(uri string, auth Authorizer) *Client
func (*Client) ReadStream ¶
func (c *Client) ReadStream(path string) (io.ReadCloser, error)
func (*Client) SetTransport ¶
func (c *Client) SetTransport(transport http.RoundTripper)
type DigestAuth ¶
type DigestAuth struct {
// contains filtered or unexported fields
}
func (*DigestAuth) Clone ¶
func (d *DigestAuth) Clone() Authenticator
func (*DigestAuth) Close ¶
func (d *DigestAuth) Close() error
func (*DigestAuth) String ¶
func (d *DigestAuth) String() string
type File ¶
type File struct {
// contains filtered or unexported fields
}
func (File) ContentType ¶
type PassportAuth ¶
type PassportAuth struct {
// contains filtered or unexported fields
}
func (*PassportAuth) Clone ¶
func (p *PassportAuth) Clone() Authenticator
func (*PassportAuth) Close ¶
func (p *PassportAuth) Close() error
func (*PassportAuth) String ¶
func (p *PassportAuth) String() string
type StatusError ¶
type StatusError struct {
Status int
}
func (StatusError) Error ¶
func (se StatusError) Error() string
Click to show internal directories.
Click to hide internal directories.