Switch to new interfaces with context

See https://github.com/emersion/go-webdav/pull/53
This commit is contained in:
Conrad Hoffmann 2022-02-23 13:36:51 +01:00
parent 6051fec4c4
commit 3281b1d32b
3 changed files with 17 additions and 14 deletions

13
go.mod
View File

@ -3,10 +3,11 @@ module git.sr.ht/~sircmpwn/tokidoki
go 1.17 go 1.17
require ( require (
github.com/emersion/go-imap v1.2.0 // indirect github.com/emersion/go-imap v1.2.0
github.com/emersion/go-sasl v0.0.0-20211008083017-0b9dcfb154ac // indirect github.com/emersion/go-sasl v0.0.0-20211008083017-0b9dcfb154ac
github.com/emersion/go-vcard v0.0.0-20210521075357-3445b9171995 // indirect github.com/emersion/go-vcard v0.0.0-20210521075357-3445b9171995
github.com/emersion/go-webdav v0.3.1 // indirect github.com/emersion/go-webdav v0.3.2-0.20220223110113-0f6744ede83c
github.com/go-chi/chi/v5 v5.0.7 // indirect github.com/go-chi/chi/v5 v5.0.7
golang.org/x/text v0.3.7 // indirect
) )
require golang.org/x/text v0.3.7 // indirect

4
go.sum
View File

@ -9,8 +9,8 @@ github.com/emersion/go-textwrapper v0.0.0-20200911093747-65d896831594/go.mod h1:
github.com/emersion/go-vcard v0.0.0-20191221110513-5f81fa0d3cc7/go.mod h1:HMJKR5wlh/ziNp+sHEDV2ltblO4JD2+IdDOWtGcQBTM= github.com/emersion/go-vcard v0.0.0-20191221110513-5f81fa0d3cc7/go.mod h1:HMJKR5wlh/ziNp+sHEDV2ltblO4JD2+IdDOWtGcQBTM=
github.com/emersion/go-vcard v0.0.0-20210521075357-3445b9171995 h1:DpVfmcoBs6o9VYcccNWbuKFQxuHCgt25/y4q9H8AUvc= github.com/emersion/go-vcard v0.0.0-20210521075357-3445b9171995 h1:DpVfmcoBs6o9VYcccNWbuKFQxuHCgt25/y4q9H8AUvc=
github.com/emersion/go-vcard v0.0.0-20210521075357-3445b9171995/go.mod h1:HMJKR5wlh/ziNp+sHEDV2ltblO4JD2+IdDOWtGcQBTM= github.com/emersion/go-vcard v0.0.0-20210521075357-3445b9171995/go.mod h1:HMJKR5wlh/ziNp+sHEDV2ltblO4JD2+IdDOWtGcQBTM=
github.com/emersion/go-webdav v0.3.1 h1:8ISu6AlBwu7DKg9RQE3iRpE3CPM8Bfpfz7L3bi/xlGI= github.com/emersion/go-webdav v0.3.2-0.20220223110113-0f6744ede83c h1:HOnawYumt/OFrlda12w+TKS/3m0eqsET7nJbgrAS/fI=
github.com/emersion/go-webdav v0.3.1/go.mod h1:uSM1VveeKtogBVWaYccTksToczooJ0rrVGNsgnDsr4Q= github.com/emersion/go-webdav v0.3.2-0.20220223110113-0f6744ede83c/go.mod h1:uSM1VveeKtogBVWaYccTksToczooJ0rrVGNsgnDsr4Q=
github.com/go-chi/chi/v5 v5.0.7 h1:rDTPXLDHGATaeHvVlLcR4Qe0zftYethFucbjVQ1PxU8= github.com/go-chi/chi/v5 v5.0.7 h1:rDTPXLDHGATaeHvVlLcR4Qe0zftYethFucbjVQ1PxU8=
github.com/go-chi/chi/v5 v5.0.7/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= github.com/go-chi/chi/v5 v5.0.7/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=

View File

@ -1,6 +1,8 @@
package storage package storage
import ( import (
"context"
"github.com/emersion/go-vcard" "github.com/emersion/go-vcard"
"github.com/emersion/go-webdav/carddav" "github.com/emersion/go-webdav/carddav"
) )
@ -13,26 +15,26 @@ func NewPostgreSQL() carddav.Backend {
return &psqlBackend{} return &psqlBackend{}
} }
func (*psqlBackend) AddressBook() (*carddav.AddressBook, error) { func (*psqlBackend) AddressBook(ctx context.Context) (*carddav.AddressBook, error) {
panic("TODO") panic("TODO")
} }
func (*psqlBackend) GetAddressObject(path string, req *carddav.AddressDataRequest) (*carddav.AddressObject, error) { func (*psqlBackend) GetAddressObject(ctx context.Context, path string, req *carddav.AddressDataRequest) (*carddav.AddressObject, error) {
panic("TODO") panic("TODO")
} }
func (*psqlBackend) ListAddressObjects(req *carddav.AddressDataRequest) ([]carddav.AddressObject, error) { func (*psqlBackend) ListAddressObjects(ctx context.Context, req *carddav.AddressDataRequest) ([]carddav.AddressObject, error) {
panic("TODO") panic("TODO")
} }
func (*psqlBackend) QueryAddressObjects(query *carddav.AddressBookQuery) ([]carddav.AddressObject, error) { func (*psqlBackend) QueryAddressObjects(ctx context.Context, query *carddav.AddressBookQuery) ([]carddav.AddressObject, error) {
panic("TODO") panic("TODO")
} }
func (*psqlBackend) PutAddressObject(path string, card vcard.Card) (loc string, err error) { func (*psqlBackend) PutAddressObject(ctx context.Context, path string, card vcard.Card) (loc string, err error) {
panic("TODO") panic("TODO")
} }
func (*psqlBackend) DeleteAddressObject(path string) error { func (*psqlBackend) DeleteAddressObject(ctx context.Context, path string) error {
panic("TODO") panic("TODO")
} }