Categorygithub.com/micheam/go-gmbapi
repositorypackage
0.1.0
Repository: https://github.com/micheam/go-gmbapi.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# README

go-gmbapi

!!DO NOT USE THIS!!

This library was created to represent the idea of implementation. It is not yet feature ready and should not be used.

Requirements

go 1.14~

Installation

$ go get github.com/micheam/go-gmbapi

Usage

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.

License

TBD

Author

TBD