Categorygithub.com/iij/doapi
modulepackage
0.0.0-20190504054126-0bbf12d6d7df
Repository: https://github.com/iij/doapi.git
Documentation: pkg.go.dev

# README

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)
		}
	}
}

# Packages

No description provided by the author

# Functions

ArgumentList API引数のリストを求める。必須とオプションに分類.
ArgumentListType API引数のリストを求める。URI埋め込み、クエリストリング、JSONに分類.
Call API呼び出しを実行し、レスポンスを得る.
CallWithMap API呼び出しを実行する。引数と戻り値が構造体ではなくmap.
CustomEscape escape string.
GetBody API呼び出しのリクエストボディ(JSON文字列)を求める.
GetParam APIのクエリストリング部分を求める.
GetPath APIのURIのパス部分を求める.
NewAPI API構造体のコンストラクタ.
String2Sign get string to calculate signature.
Validate APIの必須引数が入っているかどうかをチェック.
ValidateMap APIの必須引数が入っているかどうかをチェック.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
EndpointJSON = "http://localhost:9999/".

# Structs

API の呼び出し先に関連する構造.