mirror of
https://github.com/1f349/go-webdav.git
synced 2025-01-11 09:56:28 +00:00
webdav: add Client.RemoveAll
This commit is contained in:
parent
41b68829e8
commit
04bcea1ee8
10
client.go
10
client.go
@ -192,3 +192,13 @@ func (c *Client) Create(name string) (io.WriteCloser, error) {
|
|||||||
|
|
||||||
return &fileWriter{pw, done}, nil
|
return &fileWriter{pw, done}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *Client) RemoveAll(name string) error {
|
||||||
|
req, err := c.ic.NewRequest(http.MethodDelete, name, nil)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err = c.ic.Do(req)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user