A Go library for WebDAV, CalDAV and CardDAV
Go to file
Conrad Hoffmann 85d2b222bb Add error type representing DAV/XML errors
Backends will need some way to signal that a precondition error occurred
(and specifying which one) without causing the server to return a 500.
This commit adds an exported function to create a specific error for
this. The existing error handling routine is slightly adapted to handle
this error in such a way that it returns the desired result.

Usage would be something like:

```
return "", carddav.NewPreconditionError(carddav.PreconditionNoUIDConflict)
```

which triggers the following HTTP response:

```
HTTP/1.1 409 Conflict.
Content-Type: text/xml; charset=utf-8.
Date: Thu, 10 Mar 2022 10:28:56 GMT.
Content-Length: 141.
Connection: close.

<?xml version="1.0" encoding="UTF-8"?>
<error xmlns="DAV:"><no-uid-conflict
xmlns="urn:ietf:params:xml:ns:carddav"></no-uid-conflict></error>
```

This response gets correctly recognized by e.g. Evolution (though it's
handling is not great).

The added error type is generic enough to be used for other stuff also.
As it is not exported (internal package), new functions for creating
such errors would have to be added.
2022-03-10 16:48:11 +01:00
caldav caldav: add Client.MultiGetCalendar 2020-05-13 16:45:25 +02:00
carddav Add error type representing DAV/XML errors 2022-03-10 16:48:11 +01:00
cmd/webdav-server cmd/webdav-server: new command 2020-01-22 13:17:52 +01:00
internal Add error type representing DAV/XML errors 2022-03-10 16:48:11 +01:00
.build.yml ci: add .build.yml 2020-04-02 16:50:41 +02:00
.gitignore Initial commit 2017-08-26 14:46:44 +02:00
client.go Include ModTime for directories if available 2021-08-11 11:08:03 +02:00
fs_local.go webdav: add COPY support to server 2020-01-22 13:00:42 +01:00
go.mod caldav: upgrade to latest go-ical API 2020-02-24 21:16:45 +01:00
go.sum caldav: upgrade to latest go-ical API 2020-02-24 21:16:45 +01:00
LICENSE Start from scratch 2020-01-14 17:51:33 +01:00
README.md readme: update badges 2022-02-02 13:54:40 +01:00
server.go internal: add ETag 2020-02-03 21:48:31 +01:00
webdav.go webdav: add support for ETag to client & server 2020-01-22 12:03:58 +01:00

go-webdav

godocs.io builds.sr.ht status

A Go library for WebDAV, CalDAV and CardDAV.

License

MIT