https://github.com/iij/doapi
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/iij/doapi
- Owner: iij
- License: apache-2.0
- Created: 2018-07-24T07:56:20.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-05-04T05:41:27.000Z (almost 6 years ago)
- Last Synced: 2024-06-19T02:07:56.048Z (10 months ago)
- Language: Go
- Size: 16.6 KB
- Stars: 1
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Golang binding for DO API
DO is IIJ DNS outsource service.
## Install
- go get -u github.com/iij/doapi
# Usage for Golang users
```go
package main// Usage:
// export IIJAPI_ACCESS_KEY=
// export IIJAPI_SECRET_KEY=
// export DOSERVICECODE=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)
}
}
}
```