Skip to content

laofun/go-goong

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-goong

goong.io API wrappers for Golang

Modules

  • Places
  • Geocoding
  • Directions

Important: This key should be kept secret on your server.

Installation

To install the Go Client for Goong API, please execute the following go get command.

    go get github.com/laofun/go-goong

Developer Documentation

View the reference documentation for for API information.

Requirements

  • Go 1.14 or later.
  • A Goong API key.

Usage

package main

import (
	"log"
  "context"

	"github.com/kr/pretty"
	"github.com/laofun/go-goong"
	"github.com/laofun/go-goong/lib/places"
)

func main() {
	client, err := goong.NewClient("Insert-API-Key-Here")
	if err != nil {
		log.Fatalf("fatal error: %s", err)
	}

	r := &places.AutoCompleteOpts{
		Input: "quan 1",
	}
	resp, err := client.Places.Autocomplete(context.Background(),r)

	if err != nil {
		log.Fatalf("fatal error: %s", err)
	}

	pretty.Println(resp)
}