File: README.md

package info (click to toggle)
golang-github-mimuret-golang-iij-dpf 0.9.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,340 kB
  • sloc: makefile: 55
file content (34 lines) | stat: -rw-r--r-- 854 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# IIJ DNS Platform Service API for Go
[![codecov](https://codecov.io/gh/mimuret/golang-iij-dpf/branch/main/graph/badge.svg?token=CTIBL2M5YD)](https://codecov.io/gh/mimuret/golang-iij-dpf)

- API Library for [IIJ DNS Platform Service](https://www.iij.ad.jp/en/biz/dns-pfm/).
- This is not an official IIJ software.

## Usage
```
package main

import (
	"fmt"
	"os"

	"github.com/mimuret/golang-iij-dpf/pkg/api"
	"github.com/mimuret/golang-iij-dpf/pkg/apis/dpf/v1/core"
)

func main() {
	token := os.Getenv("DPF_TOKEN")
	cl := api.NewClient(token, "", nil)

	zoneList := &core.ZoneList{}
	searchParam := &core.ZoneListSearchKeywords{Name: api.KeywordsString{"example.jp"}}
	req, err := cl.ListAll(zoneList, searchParam)
	if err != nil {
		panic(err)
	}
	fmt.Printf("RequestID: %s\n", req)
	for _, item := range zoneList.Items {
		fmt.Println(item)
	}
}
```