webdav

package
v0.0.0-...-21b7097 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2018 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

View Source
const (
	Depth0        Depth = "0"
	Depth1              = "1"
	DepthInfinity       = "infinity"
)
View Source
const (
	StatusMulti = 207
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client http.Client

a client for making WebDAV requests

func NewClient

func NewClient(server *Server, native *nhttp.Client) *Client

creates a new client for communicating with an WebDAV server

func NewDefaultClient

func NewDefaultClient(server *Server) *Client

creates a new client for communicating with a WebDAV server uses the default HTTP client from net/http

func (*Client) Acl

func (c *Client) Acl(path string, depth Depth, acl *entities.Acl) error

func (*Client) Bind

func (c *Client) Bind(path string, depth Depth, bind *entities.Bind) error

func (*Client) Delete

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

deletes a resource if it exists on a particular path

func (*Client) Do

func (c *Client) Do(req *Request) (*Response, error)

executes a WebDAV request

func (*Client) Exists

func (c *Client) Exists(path string) (bool, error)

checks if a resource exists given a particular path

func (*Client) Features

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

fetches a list of WebDAV features supported by the server returns an error if the server does not support DAV

func (*Client) Http

func (c *Client) Http() *http.Client

downcasts the client to the local HTTP interface

func (*Client) Propfind

func (c *Client) Propfind(path string, depth Depth, pf *entities.Propfind) (*entities.Multistatus, error)

executes a PROPFIND request against the WebDAV server returns a multistatus XML entity

func (*Client) Server

func (c *Client) Server() *Server

returns the embedded WebDav server reference

func (*Client) ValidateServer

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

returns an error if the server does not support WebDAV

type Depth

type Depth string

type Request

type Request http.Request

an WebDAV request object

func NewRequest

func NewRequest(method string, urlstr string, xmldata ...interface{}) (*Request, error)

creates a new WebDAV request object

func (*Request) Http

func (r *Request) Http() *http.Request

downcasts the request to the local HTTP interface

type Response

type Response http.Response

a WebDAV response object

func NewResponse

func NewResponse(response *http.Response) *Response

creates a new WebDAV response object

func (*Response) Decode

func (r *Response) Decode(into interface{}) error

decodes a WebDAV XML response into the provided interface

func (*Response) Features

func (r *Response) Features() (features []string)

returns a list of WebDAV features found in the response

func (*Response) Http

func (r *Response) Http() *http.Response

downcasts the response to the local HTTP interface

type Server

type Server http.Server

a server that accepts WebDAV requests

func NewServer

func NewServer(baseUrlStr string) (*Server, error)

creates a reference to an WebDAV server

func (*Server) Http

func (s *Server) Http() *http.Server

downcasts the server to the local HTTP interface

func (*Server) NewRequest

func (s *Server) NewRequest(method string, path string, xmldata ...interface{}) (*Request, error)

creates a new WebDAV request object

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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