diff --git a/client.go b/client.go index c24991c..4434ac8 100644 --- a/client.go +++ b/client.go @@ -32,7 +32,7 @@ func NewClient(uri string, user string, pw string) *Client { } func (c *Client) Connect() error { - if rs, err := c.Options("/"); err == nil { + if rs, err := c.options("/"); err == nil { defer rs.Body.Close() if rs.StatusCode != 200 || (rs.Header.Get("Dav") == "" && rs.Header.Get("DAV") == "") { @@ -103,7 +103,7 @@ func (c *Client) ReadDir(path string) ([]os.FileInfo, error) { r.Props = nil } - err := c.Propfind(path, false, + err := c.propfind(path, false, ` @@ -133,7 +133,7 @@ func (c *Client) Remove(path string) error { func (c *Client) Mkdir(path string) error { path = FixSlashes(path) - status := c.MkCol(path) + status := c.mkcol(path) if status == 201 { return nil } diff --git a/requests.go b/requests.go index 3b1aa3b..fbcfd71 100644 --- a/requests.go +++ b/requests.go @@ -30,7 +30,7 @@ func (c *Client) reqDo(method string, path string, body io.Reader) (*http.Respon return c.c.Do(rq) } -func (c *Client) MkCol(path string) int { +func (c *Client) mkcol(path string) int { rs, err := c.reqDo("MKCOL", path, nil) if err != nil { return 400 @@ -44,7 +44,7 @@ func (c *Client) MkCol(path string) int { return rs.StatusCode } -func (c *Client) Options(path string) (*http.Response, error) { +func (c *Client) options(path string) (*http.Response, error) { rq, err := c.req("OPTIONS", path, nil) if err != nil { return nil, err @@ -55,7 +55,7 @@ func (c *Client) Options(path string) (*http.Response, error) { return c.c.Do(rq) } -func (c *Client) Propfind(path string, self bool, body string, resp interface{}, parse func(resp interface{})) error { +func (c *Client) propfind(path string, self bool, body string, resp interface{}, parse func(resp interface{})) error { rq, err := c.req("PROPFIND", path, strings.NewReader(body)) if err != nil { return err