2022-02-21 10:39:57 +00:00
|
|
|
package storage
|
|
|
|
|
|
|
|
import (
|
2022-02-23 12:36:51 +00:00
|
|
|
"context"
|
|
|
|
|
2022-02-21 10:39:57 +00:00
|
|
|
"github.com/emersion/go-vcard"
|
2022-03-23 09:38:14 +00:00
|
|
|
"github.com/emersion/go-webdav/caldav"
|
2022-02-21 10:39:57 +00:00
|
|
|
"github.com/emersion/go-webdav/carddav"
|
|
|
|
)
|
|
|
|
|
|
|
|
type psqlBackend struct{}
|
|
|
|
|
|
|
|
var _ carddav.Backend = (*psqlBackend)(nil)
|
|
|
|
|
2022-03-23 09:38:14 +00:00
|
|
|
func NewPostgreSQL() (caldav.Backend, carddav.Backend, error) {
|
|
|
|
return nil, &psqlBackend{}, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (*psqlBackend) CurrentUserPrincipal(ctx context.Context) (string, error) {
|
|
|
|
panic("TODO")
|
|
|
|
}
|
|
|
|
|
2024-02-02 21:19:36 +00:00
|
|
|
func (*psqlBackend) AddressBookHomeSetPath(ctx context.Context) (string, error) {
|
2022-03-23 09:38:14 +00:00
|
|
|
panic("TODO")
|
2022-02-21 10:39:57 +00:00
|
|
|
}
|
|
|
|
|
2024-02-02 21:19:36 +00:00
|
|
|
func (*psqlBackend) ListAddressBooks(ctx context.Context) ([]carddav.AddressBook, error) {
|
|
|
|
panic("TODO")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (*psqlBackend) GetAddressBook(ctx context.Context, path string) (*carddav.AddressBook, error) {
|
2022-02-21 10:39:57 +00:00
|
|
|
panic("TODO")
|
|
|
|
}
|
|
|
|
|
2024-02-21 14:01:47 +00:00
|
|
|
func (*psqlBackend) CreateAddressBook(ctx context.Context, ab *carddav.AddressBook) error {
|
|
|
|
panic("TODO")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (*psqlBackend) UpdateAddressBook(ctx context.Context, ab *carddav.AddressBook) error {
|
|
|
|
panic("TODO")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (*psqlBackend) DeleteAddressBook(ctx context.Context, path string) error {
|
|
|
|
panic("TODO")
|
|
|
|
}
|
|
|
|
|
2022-02-23 12:36:51 +00:00
|
|
|
func (*psqlBackend) GetAddressObject(ctx context.Context, path string, req *carddav.AddressDataRequest) (*carddav.AddressObject, error) {
|
2022-02-21 10:39:57 +00:00
|
|
|
panic("TODO")
|
|
|
|
}
|
|
|
|
|
2024-02-02 21:19:36 +00:00
|
|
|
func (*psqlBackend) ListAddressObjects(ctx context.Context, path string, req *carddav.AddressDataRequest) ([]carddav.AddressObject, error) {
|
2022-02-21 10:39:57 +00:00
|
|
|
panic("TODO")
|
|
|
|
}
|
|
|
|
|
2024-02-02 21:19:36 +00:00
|
|
|
func (*psqlBackend) QueryAddressObjects(ctx context.Context, path string, query *carddav.AddressBookQuery) ([]carddav.AddressObject, error) {
|
2022-02-21 10:39:57 +00:00
|
|
|
panic("TODO")
|
|
|
|
}
|
|
|
|
|
2024-02-21 14:01:47 +00:00
|
|
|
func (*psqlBackend) PutAddressObject(ctx context.Context, path string, card vcard.Card, opts *carddav.PutAddressObjectOptions) (*carddav.AddressObject, error) {
|
2022-02-21 10:39:57 +00:00
|
|
|
panic("TODO")
|
|
|
|
}
|
|
|
|
|
2022-02-23 12:36:51 +00:00
|
|
|
func (*psqlBackend) DeleteAddressObject(ctx context.Context, path string) error {
|
2022-02-21 10:39:57 +00:00
|
|
|
panic("TODO")
|
|
|
|
}
|