All Projects → decker502 → dnspod-go

decker502 / dnspod-go

Licence: MIT license
dnspod api

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to dnspod-go

dnspod-api-php-web
DNSPod API PHP Web Example
Stars: ✭ 88 (+633.33%)
Mutual labels:  dnspod, dnspod-api
DynamicDNS
基于DNSPod构建的DDNS软件
Stars: ✭ 21 (+75%)
Mutual labels:  dnspod
dnspod-httpdns-proxy
使用dnspod httpdns来防止劫持的一个小轮子,仅支持A IN标准查询
Stars: ✭ 32 (+166.67%)
Mutual labels:  dnspod
Ddns
🚩 自动更新域名解析到本机IP(支持dnspod,阿里DNS,CloudFlare,华为云,DNSCOM...)
Stars: ✭ 2,582 (+21416.67%)
Mutual labels:  dnspod
letsencrypt-www
Probably the easiest way to create | renew | deploy certificate
Stars: ✭ 27 (+125%)
Mutual labels:  dnspod
HTTPDNS-OC
HTTPDNS 库 Objdctive-C 实现(使用DNSPod 、AliyunDNS、 Google ...)
Stars: ✭ 33 (+175%)
Mutual labels:  dnspod
ddns
a multiple providers ddns script without dependencies
Stars: ✭ 47 (+291.67%)
Mutual labels:  dnspod

停更通知

由于本项目维护不及时, lego 项目作者已经fork了本项目,单独维护了,建议使用 https://github.com/nrdcg/dnspod-go

dnspod-go

A Go client for the DNSPod API.

Borrowed from : dnsimple

Installation

$ go get github.com/decker502/dnspod-go

Getting Started

This library is a Go client you can use to interact with the DNSPod API. Here are some examples.

package main

import (
	"fmt"
	"log"

	"github.com/decker502/dnspod-go"
)

func main() {
	apiToken := "xxxxx"

	params := dnspod.CommonParams{LoginToken: apiToken, Format: "json"}
	client := dnspod.NewClient(params)

	// Get a list of your domains
	domains, _, _ := client.Domains.List()
	for _, domain := range domains {
		fmt.Printf("Domain: %s (id: %d)\n", domain.Name, domain.ID)
	}

	// Get a list of your domains (with error management)
	domains, _, error := client.Domains.List()
	if error != nil {
		log.Fatalln(error)
	}
	for _, domain := range domains {
		fmt.Printf("Domain: %s (id: %d)\n", domain.Name, domain.ID)
	}

	// Create a new Domain
	newDomain := dnspod.Domain{Name: "example.com"}
	domain, _, _ := client.Domains.Create(newDomain)
	fmt.Printf("Domain: %s\n (id: %d)", domain.Name, domain.ID)
}

License

This is Free Software distributed under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].