Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/go-dnspod/dnspod
DNSPod API 1.0
https://github.com/go-dnspod/dnspod
api ddns dnspod go golang
Last synced: 3 months ago
JSON representation
DNSPod API 1.0
- Host: GitHub
- URL: https://github.com/go-dnspod/dnspod
- Owner: go-dnspod
- License: apache-2.0
- Created: 2017-06-01T05:07:28.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-11-30T06:24:14.000Z (almost 5 years ago)
- Last Synced: 2024-06-20T11:50:00.622Z (5 months ago)
- Topics: api, ddns, dnspod, go, golang
- Language: Go
- Size: 1.89 MB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-golang-repositories - dnspod
README
# dnspod
Golang bindings for DNSPOD API## Install
go get go-dnspod/dnspod
## Usage```
package mainimport (
"fmt"
"go-dnspod/dnspod"
)func main() {
argToken := "YOU_DNSPOD_API_TOKEN"
myDomain:="yourdomain.com"
dns := dnspod.NewDnspod(argToken)
//List all your domain
myDomainList, err := dns.Domain.List()
if err != nil {
panic(err)
}
fmt.Println("MyDomains:", myDomainList)
//Create a new A record test.yourdomain.com -> 1.2.3.4
recordID, err := dns.Record.Create(
myDomain,
dnspod.RTypeA,
"1.2.3.4",
dnspod.RecordOpt{SubDomain: "test"},
)
if err != nil {
panic(err)
}
fmt.Printf("Create success! Record ID:%d\r\n", recordID)
}
```
## More Examples
You can find a complete DDNS client source code in **example/ddns** directory.
## License
This library is under the [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0)