Documentation
¶
Overview ¶
Package webdavclnt contains WebDav Http Client.
Author: Yuri Y. Karamani <y.karamani@gmail.com>
Index ¶
- type Multistatus
- type Prop
- type PropValue
- type Properties
- type Propstat
- type Response
- type WebDavClient
- func (clnt *WebDavClient) AllPropFind(uri string) (map[string]Properties, error)
- func (clnt *WebDavClient) Copy(uri, destURI string) error
- func (clnt *WebDavClient) Delete(uri string) error
- func (clnt *WebDavClient) Exists(uri string) (bool, error)
- func (clnt *WebDavClient) Get(uri string) ([]byte, error)
- func (clnt *WebDavClient) MkCol(uri string) error
- func (clnt *WebDavClient) Move(uri, destURI string) error
- func (clnt *WebDavClient) PropFind(uri string, props ...string) (map[string]Properties, error)
- func (clnt *WebDavClient) PropNameFind(uri string) (map[string][]string, error)
- func (clnt *WebDavClient) Put(uri string, data io.Reader) error
- func (clnt *WebDavClient) SetDefFolder(defFolder string) *WebDavClient
- func (clnt *WebDavClient) SetLogin(login string) *WebDavClient
- func (clnt *WebDavClient) SetPassword(password string) *WebDavClient
- func (clnt *WebDavClient) SetPort(port int) *WebDavClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Multistatus ¶
type Multistatus struct {
Responses []Response `xml:"response"`
}
Multistatus contains PROPFIND response.
type Prop ¶
type Prop struct {
PropList []PropValue `xml:",any"`
}
Prop contains list of property values.
type Propstat ¶
type Propstat struct {
Prop *Prop `xml:"prop"`
}
Propstat contains properties struct.
type WebDavClient ¶
WebDavClient contains WebDAV initialization data.
func NewClient ¶
func NewClient(host string) *WebDavClient
NewClient creates a pointer to an instance of WebDavClient.
func (*WebDavClient) AllPropFind ¶
func (clnt *WebDavClient) AllPropFind(uri string) (map[string]Properties, error)
AllPropFind gets all properties of file at the specified uri.
func (*WebDavClient) Copy ¶
func (clnt *WebDavClient) Copy(uri, destURI string) error
Copy copies a file from uri to destURI.
func (*WebDavClient) Delete ¶
func (clnt *WebDavClient) Delete(uri string) error
Delete removes a file from WebDav storage to the specified uri.
func (*WebDavClient) Exists ¶
func (clnt *WebDavClient) Exists(uri string) (bool, error)
Exists checks if the file or collection exists.
func (*WebDavClient) Get ¶
func (clnt *WebDavClient) Get(uri string) ([]byte, error)
Get gets a file from uri.
func (*WebDavClient) MkCol ¶
func (clnt *WebDavClient) MkCol(uri string) error
MkCol makes new directory (collection).
func (*WebDavClient) Move ¶
func (clnt *WebDavClient) Move(uri, destURI string) error
Move moves a file from uri to destURI.
func (*WebDavClient) PropFind ¶
func (clnt *WebDavClient) PropFind(uri string, props ...string) (map[string]Properties, error)
PropFind gets specific properties of file at the specified uri.
func (*WebDavClient) PropNameFind ¶
func (clnt *WebDavClient) PropNameFind(uri string) (map[string][]string, error)
PropNameFind gets properties names of file at the specified uri.
func (*WebDavClient) Put ¶
func (clnt *WebDavClient) Put(uri string, data io.Reader) error
Put uploads a file into WebDav storage to the specified uri.
func (*WebDavClient) SetDefFolder ¶
func (clnt *WebDavClient) SetDefFolder(defFolder string) *WebDavClient
SetDefFolder sets the value of a field DefFolder, returns a poiner to an instance WebDavClient.
func (*WebDavClient) SetLogin ¶
func (clnt *WebDavClient) SetLogin(login string) *WebDavClient
SetLogin sets the value of a field Login, returns a poiner to an instance WebDavClient.
func (*WebDavClient) SetPassword ¶
func (clnt *WebDavClient) SetPassword(password string) *WebDavClient
SetPassword sets the value of a field Password, returns a poiner to an instance WebDavClient.
func (*WebDavClient) SetPort ¶
func (clnt *WebDavClient) SetPort(port int) *WebDavClient
SetPort sets the value of a field Port, returns a poiner to an instance WebDavClient.