carddav: rename Address to AddressObject

This commit is contained in:
Simon Ser 2020-01-17 16:20:05 +01:00
parent 883dafaf41
commit 13d70be046
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48
2 changed files with 6 additions and 6 deletions

View File

@ -24,7 +24,7 @@ type AddressBookMultiGet struct {
Props []string
}
type Address struct {
type AddressObject struct {
Href string
Card vcard.Card
}

View File

@ -89,8 +89,8 @@ func (c *Client) FindAddressBooks(addressBookHomeSet string) ([]AddressBook, err
return l, nil
}
func decodeAddressList(ms *internal.Multistatus) ([]Address, error) {
addrs := make([]Address, 0, len(ms.Responses))
func decodeAddressList(ms *internal.Multistatus) ([]AddressObject, error) {
addrs := make([]AddressObject, 0, len(ms.Responses))
for _, resp := range ms.Responses {
href, err := resp.Href()
if err != nil {
@ -108,7 +108,7 @@ func decodeAddressList(ms *internal.Multistatus) ([]Address, error) {
return nil, err
}
addrs = append(addrs, Address{
addrs = append(addrs, AddressObject{
Href: href,
Card: card,
})
@ -117,7 +117,7 @@ func decodeAddressList(ms *internal.Multistatus) ([]Address, error) {
return addrs, nil
}
func (c *Client) QueryAddressBook(addressBook string, query *AddressBookQuery) ([]Address, error) {
func (c *Client) QueryAddressBook(addressBook string, query *AddressBookQuery) ([]AddressObject, error) {
var addrDataReq addressDataReq
if query != nil {
for _, name := range query.Props {
@ -147,7 +147,7 @@ func (c *Client) QueryAddressBook(addressBook string, query *AddressBookQuery) (
return decodeAddressList(ms)
}
func (c *Client) MultiGetAddressBook(href string, multiGet *AddressBookMultiGet) ([]Address, error) {
func (c *Client) MultiGetAddressBook(href string, multiGet *AddressBookMultiGet) ([]AddressObject, error) {
var addrDataReq addressDataReq
if multiGet != nil {
for _, name := range multiGet.Props {