Introduce HTTPClient, remove Client.SetBasicAuth
This commit is contained in:
@@ -3,7 +3,6 @@ package caldav
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/emersion/go-webdav"
|
||||
@@ -18,7 +17,7 @@ type Client struct {
|
||||
ic *internal.Client
|
||||
}
|
||||
|
||||
func NewClient(c *http.Client, endpoint string) (*Client, error) {
|
||||
func NewClient(c webdav.HTTPClient, endpoint string) (*Client, error) {
|
||||
wc, err := webdav.NewClient(c, endpoint)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -30,11 +29,6 @@ func NewClient(c *http.Client, endpoint string) (*Client, error) {
|
||||
return &Client{wc, ic}, nil
|
||||
}
|
||||
|
||||
func (c *Client) SetBasicAuth(username, password string) {
|
||||
c.Client.SetBasicAuth(username, password)
|
||||
c.ic.SetBasicAuth(username, password)
|
||||
}
|
||||
|
||||
func (c *Client) FindCalendarHomeSet(principal string) (string, error) {
|
||||
propfind := internal.NewPropNamePropfind(calendarHomeSetName)
|
||||
resp, err := c.ic.PropfindFlat(principal, propfind)
|
||||
|
Reference in New Issue
Block a user