go-kenall
About
Unofficially kenall (ケンオール) client written by Go.
Install
$ go get github.com/osamingo/[email protected]
Usage
package main
import (
"context"
"fmt"
"log"
"os"
"github.com/osamingo/go-kenall"
)
func main() {
cli, err := kenall.NewClient(os.Getenv("KENALL_AUTHORIZATION_TOKEN"))
if err != nil {
log.Fatal(err)
}
resAddr, err := cli.GetAddress(context.Background(), "1000001")
if err != nil {
log.Fatal(err)
}
addr := resAddr.Addresses[0]
fmt.Println(addr.Prefecture, addr.City, addr.Town)
// Output: 東京都 千代田区 千代田
resCity, err := cli.GetCity(context.Background(), "13")
if err != nil {
log.Fatal(err)
}
city := resCity.Cities[0]
fmt.Println(city.Prefecture, city.City)
// Output: 東京都 千代田区
}
Articles
- ケンオール通信第1号
- This library has been featured on the official blog
🎉
- This library has been featured on the official blog
License
Released under the MIT License.