improve porkbun credentials loading
This commit is contained in:
parent
ec94e6ad46
commit
4b92d2e7c4
3 changed files with 112 additions and 77 deletions
27
internal/porkbun/client.go
Normal file
27
internal/porkbun/client.go
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
package porkbun
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
const BaseURL = "https://api.porkbun.com/api/json/v3"
|
||||
|
||||
type Client struct {
|
||||
APIKey string
|
||||
SecretAPIKey string
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
func New(apiKey, secretKey string) *Client {
|
||||
return &Client{
|
||||
APIKey: apiKey,
|
||||
SecretAPIKey: secretKey,
|
||||
HTTPClient: &http.Client{
|
||||
Timeout: 10 * time.Second,
|
||||
},
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue