Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alyx/go-daddy
Unofficial GoDaddy API client for Golang
https://github.com/alyx/go-daddy
Last synced: 12 days ago
JSON representation
Unofficial GoDaddy API client for Golang
- Host: GitHub
- URL: https://github.com/alyx/go-daddy
- Owner: alyx
- License: other
- Created: 2019-12-09T09:21:46.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-08-19T23:32:48.000Z (3 months ago)
- Last Synced: 2024-09-03T09:26:04.666Z (3 months ago)
- Language: Go
- Homepage:
- Size: 63.5 KB
- Stars: 6
- Watchers: 2
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Unofficial GoDaddy API Client for Go
[![GoDoc](https://godoc.org/github.com/alyx/go-daddy/github?status.svg)](https://pkg.go.dev/github.com/alyx/go-daddy)
[![Go Report Card](https://goreportcard.com/badge/github.com/alyx/go-daddy)](https://goreportcard.com/report/github.com/alyx/go-daddy)`go-daddy` provides a GoDaddy API client for the Go language. This package
provides a `net/http`-based wrapper around the [GoDaddy Developer API](https://developer.godaddy.com/).## Requirements
This package is currently verified against the most recent version of the Go
compiler. At time of publishing, December 2019, the most recent version is
**1.13**.## Installation
`go-daddy` can be installed via `go get`:
```bash
$ go get github.com/alyx/go-daddy/daddy
```## Configuration
Before use, please visit the [GoDaddy Getting Started](https://developer.godaddy.com/getstarted)
developer page, which walks you through getting access to the API, using the API as a self-serve user vs a reseller, and informs you of the terms of use.You will need to generate a [GoDaddy API key](https://developer.godaddy.com/keys) to use `go-daddy`.
After importing the core `go-daddy` package, you will need to initialize a
client with `godaddy.NewClient(APIKey, SecretKey, OTE)` where `APIKey` is your
GoDaddy API key, `SecretKey` is the secret key generated with it, and `OTE`
is a value declaring if your API calls should point to the GoDaddy _OTE_
(Test Environment) or the Production environment -- setting `OTE` to `true`
specifies that you do wish to use the test environment, and `false` is the
Production environment.## Usage
```
import "github.com/alyx/go-daddy/daddy"
```Construct a new GoDaddy client, then use the various services on the client to
access different parts of the GoDaddy API. For example:```
client := daddy.NewClient("API Key", "Secret Key", true)// list all domains owned by the owner of the API key
domains, err := client.Domains.List(nil, nil, 0, "", nil, "")
```The services of a client divide the API into chunks corresponding to the
structure of the GoDaddy API documentation at https://developer.godaddy.com/docThe current available client services are:
`.Abuse, .Aftermarket, .Agreements, .Certificates, .Countries, .Domains, .Orders, .Shoppers, .Subscriptions`### Example
This is a basic example showing how to generate a self-serve client and
retrieve a list of all domains owned by the account.```go
package mainimport (
"log""github.com/alyx/go-daddy"
)func main() {
client, _ := daddy.NewClient("abc", "def", false)myDomains, err := client.Domains.List(nil, nil, 0, "", nil, "")
if err != nil {
log.Fatal(err)
}for _, value := range myDomains {
log.Println(value.Domain)
}
}
```## License
This package is licensed under the ISC license, see `LICENSE`