New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

github.com/nrdcg/dnspod-go

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/nrdcg/dnspod-go

  • v0.4.0
  • Source
  • Go
  • Socket score

Version published
Created
Source

DNSPod Go API client

Build Status GoDoc Go Report Card

A Go client for the DNSPod API.

Originally inspired by dnsimple

Getting Started

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

package main

import (
	"fmt"
	"log"

	"github.com/nrdcg/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, _, err := client.Domains.List()
	if err != nil {
		log.Fatalln(err)
	}
	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.

FAQs

Package last updated on 09 Jan 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc