🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

github.com/iij/doapi

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/iij/doapi

v0.0.0-20190504054126-0bbf12d6d7df
Source
Go
Version published
Created
Source

Golang binding for DO API

DO is IIJ DNS outsource service.

Install

  • go get -u github.com/iij/doapi

Usage for Golang users

package main

// Usage:
//   export IIJAPI_ACCESS_KEY=<YOUR ACCESSS KEY>
//   export IIJAPI_SECRET_KEY=<YOUR SECRET KEY>
//   export DOSERVICECODE=<YOUR DO CODE>

import (
	"log"
	"os"

	"github.com/iij/doapi"
	"github.com/iij/doapi/protocol"
)

func main() {
	api := doapi.NewAPI(os.Getenv("IIJAPI_ACCESS_KEY"), os.Getenv("IIJAPI_SECRET_KEY"))

    // List zones
	request := protocol.ZoneListGet{ DoServiceCode: os.Getenv("DOSERVICECODE"), }
	response := protocol.ZoneListGetResponse{}
	if err := doapi.Call(*api, request, &response); err == nil {
		for _, zone := range response.ZoneList { 
			log.Println("zone", zone)
		}
	}
}

FAQs

Package last updated on 04 May 2019

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