Skip to content

Commit

Permalink
Fix type and deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
ihmels committed Apr 18, 2024
1 parent 4288b3a commit 55c7aa8
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net/http"
"net/http/cookiejar"
"time"
Expand Down Expand Up @@ -40,7 +40,7 @@ type nameserverInfoRequest struct {
Type string `json:"type,omitempty"`
Content string `json:"content,omitempty"`
TTL int `json:"ttl,omitempty"`
Priority int `json:"prio,omitempty"`
Priority uint `json:"prio,omitempty"`
}

type nameserverInfoResponse struct {
Expand All @@ -57,7 +57,7 @@ type nameserverCreateRecordRequest struct {
Type string `json:"type"`
Content string `json:"content"`
TTL int `json:"ttl"`
Priority int `json:"prio"`
Priority uint `json:"prio"`
}

type nameserverCreateRecordResponse struct {
Expand All @@ -70,7 +70,7 @@ type nameserverUpdateRecordRequest struct {
Type string `json:"type"`
Content string `json:"content"`
TTL int `json:"ttl"`
Priority int `json:"prio"`
Priority uint `json:"prio"`
}

type nameserverDeleteRecordRequest struct {
Expand All @@ -83,7 +83,7 @@ type nameserverRecord struct {
Type string `mapstructure:"type"`
Content string `mapstructure:"content"`
TTL int `mapstructure:"ttl"`
Priority int `mapstructure:"prio"`
Priority uint `mapstructure:"prio"`
}

type nameserverCreateRequest struct {
Expand Down Expand Up @@ -308,7 +308,7 @@ func (c *client) call(ctx context.Context, method string, params any) (any, erro
return nil, err
}

responseBody, err := ioutil.ReadAll(httpResponse.Body)
responseBody, err := io.ReadAll(httpResponse.Body)
if err != nil {
return nil, err
}
Expand All @@ -319,10 +319,6 @@ func (c *client) call(ctx context.Context, method string, params any) (any, erro
return nil, err
}

if err != nil {
return nil, err
}

return response.ResponseData, checkResponse(response)
}

Expand Down

0 comments on commit 55c7aa8

Please sign in to comment.