!!DO NOT USE THIS!!
This library was created to represent an implementation idea. It is not yet fully functional, so please do not use it.
-> It is already archived and no maintenance is planned.
go 1.14~
$ go get github.com/micheam/go-gmbapi
package main
import (
"encoding/json"
"fmt"
"net/url"
"os"
gmbapi "github.com/micheam/go-gmbapi"
)
// The following environment variables must be set
//
// - GMB_CLIENT_ID string
// - GMB_CLIENT_SECRET string
// - GMB_REFRESH_TOKEN string
func main() {
ctx := context.Background()
client, _ := gmbapi.New()
accounts, _ := client.AccountAccess().List(ctx, url.Values{})
for acc := range accounts {
acc := acc
locs, _ := client.LocationAccess(acc).List(ctx, url.Values{})
for loc := range locs {
b, _ := json.Marshal(loc)
fmt.Println(string(b))
}
}
}
The following directory contains other use examples.
TBD
TBD