a74c76857d
Thanks to the latest version of go-webdav, this is now a thing. A lot of operations (like creating a calendar) are not yet supported. But the basics work fine. Note that multi-calendar means that different users can each have their own calenders. Resource sharing is not yet implemented either. Includes the adding of a lot of debug logs, as issues are otherwise pretty hard to figure out. The logging still needs to be made more consistent, and probably cleaned up a bit in some places.
54 lines
1.5 KiB
Go
54 lines
1.5 KiB
Go
package storage
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/emersion/go-vcard"
|
|
"github.com/emersion/go-webdav/caldav"
|
|
"github.com/emersion/go-webdav/carddav"
|
|
)
|
|
|
|
type psqlBackend struct{}
|
|
|
|
var _ carddav.Backend = (*psqlBackend)(nil)
|
|
|
|
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) ListAddressBooks(ctx context.Context) ([]carddav.AddressBook, error) {
|
|
panic("TODO")
|
|
}
|
|
|
|
func (*psqlBackend) GetAddressBook(ctx context.Context, path string) (*carddav.AddressBook, error) {
|
|
panic("TODO")
|
|
}
|
|
|
|
func (*psqlBackend) GetAddressObject(ctx context.Context, path string, req *carddav.AddressDataRequest) (*carddav.AddressObject, error) {
|
|
panic("TODO")
|
|
}
|
|
|
|
func (*psqlBackend) ListAddressObjects(ctx context.Context, path string, req *carddav.AddressDataRequest) ([]carddav.AddressObject, error) {
|
|
panic("TODO")
|
|
}
|
|
|
|
func (*psqlBackend) QueryAddressObjects(ctx context.Context, path string, query *carddav.AddressBookQuery) ([]carddav.AddressObject, error) {
|
|
panic("TODO")
|
|
}
|
|
|
|
func (*psqlBackend) PutAddressObject(ctx context.Context, path string, card vcard.Card, opts *carddav.PutAddressObjectOptions) (loc string, err error) {
|
|
panic("TODO")
|
|
}
|
|
|
|
func (*psqlBackend) DeleteAddressObject(ctx context.Context, path string) error {
|
|
panic("TODO")
|
|
}
|