mirror of
https://git.sr.ht/~sircmpwn/tokidoki
synced 2025-12-12 14:17:21 +01:00
Add CalDAV support, refactor
The filesystem storage backend now implements the required functions to act as a basic CalDAV server. Some refactoring was done based on the go-webdav development: introduce a UserPrincipalBackend, a new function to serve the user principal URL, and more. See this PR for lots of details: https://github.com/emersion/go-webdav/pull/62 Also adds a simple facility for debug output.
This commit is contained in:
parent
5728f1ee27
commit
001917295d
7 changed files with 487 additions and 85 deletions
|
|
@ -4,6 +4,7 @@ import (
|
|||
"context"
|
||||
|
||||
"github.com/emersion/go-vcard"
|
||||
"github.com/emersion/go-webdav/caldav"
|
||||
"github.com/emersion/go-webdav/carddav"
|
||||
)
|
||||
|
||||
|
|
@ -11,8 +12,16 @@ type psqlBackend struct{}
|
|||
|
||||
var _ carddav.Backend = (*psqlBackend)(nil)
|
||||
|
||||
func NewPostgreSQL() carddav.Backend {
|
||||
return &psqlBackend{}
|
||||
func NewPostgreSQL() (caldav.Backend, carddav.Backend, error) {
|
||||
return nil, &psqlBackend{}, nil
|
||||
}
|
||||
|
||||
func (*psqlBackend) CurrentUserPrincipal(ctx context.Context) (string, error) {
|
||||
panic("TODO")
|
||||
}
|
||||
|
||||
func (*psqlBackend) AddressbookHomeSetPath(ctx context.Context) (string, error) {
|
||||
panic("TODO")
|
||||
}
|
||||
|
||||
func (*psqlBackend) AddressBook(ctx context.Context) (*carddav.AddressBook, error) {
|
||||
|
|
@ -31,7 +40,7 @@ func (*psqlBackend) QueryAddressObjects(ctx context.Context, query *carddav.Addr
|
|||
panic("TODO")
|
||||
}
|
||||
|
||||
func (*psqlBackend) PutAddressObject(ctx context.Context, path string, card vcard.Card) (loc string, err error) {
|
||||
func (*psqlBackend) PutAddressObject(ctx context.Context, path string, card vcard.Card, opts *carddav.PutAddressObjectOptions) (loc string, err error) {
|
||||
panic("TODO")
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue