~ghost08/j5l

23957e3b5c7c204ebe28543da10f028ef7d0aa8e — VladimĂ­r Magyar 7 months ago d6d3e92 master
chore: just some refactoring
1 files changed, 9 insertions(+), 2 deletions(-)

M journal/client.go
M journal/client.go => journal/client.go +9 -2
@@ 24,11 24,18 @@ type Client struct {
}

type Settings struct {
	Endpoint, Username, Password, PasswordCmd, Calendar string
	Endpoint    string
	Username    string
	Password    string
	PasswordCmd string
	Calendar    string
}

func NewClient(cs Settings) (*Client, error) {
	password, err := getPassword(cs.Password, cs.PasswordCmd)
	if err != nil {
		return nil, fmt.Errorf("getting password: %w", err)
	}
	httpClient := webdav.HTTPClientWithBasicAuth(nil, cs.Username, password)
	cd, err := caldav.NewClient(httpClient, cs.Endpoint)
	if err != nil {


@@ 40,7 47,7 @@ func NewClient(cs Settings) (*Client, error) {
		calendar: cs.Calendar,
	}
	if err := c.getCalendarPath(); err != nil {
		return nil, err
		return nil, fmt.Errorf("getting calendar path: %w", err)
	}
	return c, nil
}