mirror of
https://github.com/1f349/go-webdav.git
synced 2024-12-22 16:24:14 +00:00
carddav: rename Address to AddressObject
This commit is contained in:
parent
883dafaf41
commit
13d70be046
@ -24,7 +24,7 @@ type AddressBookMultiGet struct {
|
||||
Props []string
|
||||
}
|
||||
|
||||
type Address struct {
|
||||
type AddressObject struct {
|
||||
Href string
|
||||
Card vcard.Card
|
||||
}
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user