aboutsummaryrefslogtreecommitdiff
path: root/client.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-12-12 22:10:09 +0100
committerDimitri Sokolyuk <demon@dim13.org>2015-12-12 22:10:09 +0100
commitb0aa5a6da8f5426e83c9fb8be0d7c344e40c3363 (patch)
tree71d9992229234870d0f0a44acd2dffabba4f53e7 /client.go
parent0f28bef66af6696d2f7c7ccca3e9e9993af46ee5 (diff)
kiss
Diffstat (limited to 'client.go')
-rw-r--r--client.go24
1 files changed, 6 insertions, 18 deletions
diff --git a/client.go b/client.go
index 8efa32c..e2d8492 100644
--- a/client.go
+++ b/client.go
@@ -146,22 +146,18 @@ func replyNonce(r *http.Response) string {
challenge cert-chain
*/
-func (c *Client) Register(a *Account) error {
+func (c *Client) Register(a *Account) (RegistrationResp, error) {
rq := Registration{
Resource: ResNewReg,
Contact: a.Contact,
}
re := RegistrationResp{}
err := c.request(c.Dir.NewReg, a, rq, &re)
- if err != nil {
- return err
- }
- log.Println(re)
- return err
+ return re, err
}
// Agree to TOS
-func (c *Client) Agree(a *Account) error {
+func (c *Client) Agree(a *Account) (RegistrationResp, error) {
rq := Registration{
Resource: ResRegister,
Contact: a.Contact,
@@ -169,14 +165,10 @@ func (c *Client) Agree(a *Account) error {
}
re := RegistrationResp{}
err := c.request(c.Location, a, rq, &re)
- if err != nil {
- return err
- }
- log.Println(re)
- return err
+ return re, err
}
-func (c *Client) Authorize(a *Account, domain string) error {
+func (c *Client) Authorize(a *Account, domain string) (AuthorizationResp, error) {
rq := Authorization{
Resource: ResNewAuthz,
Identifier: Identifier{
@@ -186,9 +178,5 @@ func (c *Client) Authorize(a *Account, domain string) error {
}
re := AuthorizationResp{}
err := c.request(c.Dir.NewAuthz, a, rq, &re)
- if err != nil {
- return err
- }
- log.Println(re)
- return err
+ return re, err
}