modulepackage
1.2.0
Repository: https://github.com/pananames/go-api-client.git
Documentation: pkg.go.dev
# README
pananames-go-client
Pananames API v2 Golang Client
Developer Documentation
The actual API Documentation available on this link.
Usage
import "github.com/pananames/go-api-client"
pnClient, err := pananames.NewClient("token")
if err != nil {
log.Fatalf("Failed to create client: %v", err)
}
// get all domains; default limit per_page is 30
domainsInfo, _, err := pnClient.GetDomains(nil)
if err != nil {
log.Fatalf("Failed to get domains info: %v", err)
}
// get only domains with 'suspended' status
listOptions := &pananames.GetDomainsOptions{Status: "suspended"}
domainsInfo, _, err = pnClient.GetDomains(listOptions)
if err != nil {
log.Fatalf("Failed to get domains info: %v", err)
}
for _,d := range domainsInfo {
fmt.Println(d.Domain)
}
Examples
The examples directory contains serveral examples of using this library.
# Packages
No description provided by the author
# Functions
Checks the API response for errors.
Creates a new instance of api client.
WithBaseURL Set BaseURL for api client.
Run API request with provided context.
WithHTTPClient Set configured http.Client for api client.
WithUserAgent Set user agent for api client.
# Structs
Represents an auto renew info.
Represents a balance info.
Available options for CancelTransferIn().
Available options for CheckDomainsBulk().
Represents a child name server info.
Represents a claim info.
Represents a claim contact info.
Represents api client.
Represents a contact info.
Available options for DeleteChildNameServer().
Available options for DeleteNameServerRecords().
Represents a DNSSec info.
Represents a domain info.
Represents a domain check info.
Represents a domain redirect info.
Represents a domain status info.
Represents an Email info.
Available option for EnableBulkDomainRedirect().
Available options for UpdateDNSSec().
Represents error api response with Response struct.
Available options for GetAccountPayments().
Available options for GetDomains().
Available GetEmails() options.
Available options for GetTransfersIn().
Available options for GetWhoisInfo().
Available options for InitTransferIn().
Represents pagination options.
Represents meta field from response.
Represents a name server record info.
Represents pagination info.
Represents a payment info.
Custom type for DateTime data, inherits time.Time Needs to avoid JSON unmarshall error when DateTime in JSON returns as empty string "".
Represents prices info.
Represents a promo for multi years prices.
Represents a redirect info.
Represents a redirect bulk info.
Available options for RegisterDomain().
Represents a domain renew info.
Available options for RenewDomain().
Represents api response.
Available options for SetNameServers().
Represents a TLD info.
Represents a TLD notice info.
Represents a transfer in info.
Available options for UpdateWhoisInfo().
Represents a whois info.
Represents a whois privacy info.
# Type aliases
Available options for AddChildNameServer() and UpdateChildNameServer().
Available options for EnableDomainRedirect().
Represents a list of name servers.
Represents option func to customize api client.
Represents a domain redeem info.
Represents option func to customize API request.