mirror of
https://github.com/1f349/go-webdav.git
synced 2024-12-23 00:34:23 +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
|
Props []string
|
||||||
}
|
}
|
||||||
|
|
||||||
type Address struct {
|
type AddressObject struct {
|
||||||
Href string
|
Href string
|
||||||
Card vcard.Card
|
Card vcard.Card
|
||||||
}
|
}
|
||||||
|
@ -89,8 +89,8 @@ func (c *Client) FindAddressBooks(addressBookHomeSet string) ([]AddressBook, err
|
|||||||
return l, nil
|
return l, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func decodeAddressList(ms *internal.Multistatus) ([]Address, error) {
|
func decodeAddressList(ms *internal.Multistatus) ([]AddressObject, error) {
|
||||||
addrs := make([]Address, 0, len(ms.Responses))
|
addrs := make([]AddressObject, 0, len(ms.Responses))
|
||||||
for _, resp := range ms.Responses {
|
for _, resp := range ms.Responses {
|
||||||
href, err := resp.Href()
|
href, err := resp.Href()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -108,7 +108,7 @@ func decodeAddressList(ms *internal.Multistatus) ([]Address, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
addrs = append(addrs, Address{
|
addrs = append(addrs, AddressObject{
|
||||||
Href: href,
|
Href: href,
|
||||||
Card: card,
|
Card: card,
|
||||||
})
|
})
|
||||||
@ -117,7 +117,7 @@ func decodeAddressList(ms *internal.Multistatus) ([]Address, error) {
|
|||||||
return addrs, nil
|
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
|
var addrDataReq addressDataReq
|
||||||
if query != nil {
|
if query != nil {
|
||||||
for _, name := range query.Props {
|
for _, name := range query.Props {
|
||||||
@ -147,7 +147,7 @@ func (c *Client) QueryAddressBook(addressBook string, query *AddressBookQuery) (
|
|||||||
return decodeAddressList(ms)
|
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
|
var addrDataReq addressDataReq
|
||||||
if multiGet != nil {
|
if multiGet != nil {
|
||||||
for _, name := range multiGet.Props {
|
for _, name := range multiGet.Props {
|
||||||
|
Loading…
Reference in New Issue
Block a user