goong

package module
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2023 License: MIT Imports: 2 Imported by: 0

README

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)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Places *places.Places
	// contains filtered or unexported fields
}

Client may be used to make requests to the Goong API

func NewClient

func NewClient(apiKey string) (*Client, error)

NewClient constructs a new Client Goong API

Directories

Path Synopsis
lib

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL