Coder Social home page Coder Social logo

timwangmusic / google-maps-services-go Goto Github PK

View Code? Open in Web Editor NEW

This project forked from googlemaps/google-maps-services-go

0.0 0.0 0.0 722 KB

Go client library for Google Maps API Web Services

Home Page: https://pkg.go.dev/googlemaps.github.io/maps

License: Apache License 2.0

Go 100.00%

google-maps-services-go's Introduction

Go Client for Google Maps Services

GoDoc Go Report Card GitHub go.mod Go version License

Description

Use Go? This library brings many Google Maps Platform Web Services APIs to your Go application.

The Go Client for Google Maps Services is a Go Client library for the following Google Maps Platform APIs:

Tip

See the Google Maps Platform Cloud Client Library for Go for our newer APIs including Address Validation API, Datasets API, Fleet Engine, new Places API, and Routes API.

Requirements

  • Go 1.7 or later.
  • A Google Maps Platform API key from a project with the APIs below enabled.

Important

This key should be kept secret on your server.

Installation

To install the Go Client for Google Maps Services, please execute the following go get command.

go get googlemaps.github.io/maps

Documentation

View the reference documentation.

Additional documentation about the APIs is available at:

Usage

Sample usage of the Directions API with an API key:

package main

import (
	"context"
	"log"

	"github.com/kr/pretty"
	"googlemaps.github.io/maps"
)

func main() {
	c, err := maps.NewClient(maps.WithAPIKey("Insert-API-Key-Here"))
	if err != nil {
		log.Fatalf("fatal error: %s", err)
	}
	r := &maps.DirectionsRequest{
		Origin:      "Sydney",
		Destination: "Perth",
	}
	route, _, err := c.Directions(context.Background(), r)
	if err != nil {
		log.Fatalf("fatal error: %s", err)
	}

	pretty.Println(route)
}

Features

Rate limiting

Never sleep between requests again! By default, requests are sent at the expected rate limits for each web service, typically 50 queries per second for free users. If you want to speed up or slow down requests, you can do that too, using maps.NewClient(maps.WithAPIKey(apiKey), maps.WithRateLimit(qps)).

Native types

Native objects for each of the API responses.

Monitoring

It's possible to get metrics for status counts and latency histograms for monitoring. Use maps.WithMetricReporter(metrics.OpenCensusReporter{}) to log metrics to OpenCensus, and metrics.RegisterViews() to make the metrics available to be exported. OpenCensus can export these metrics to a variety of monitoring services. You can also implement your own metric reporter instead of using the provided one.

Terms of Service

This library uses Google Maps Platform services, and any use of Google Maps Platform is subject to the Terms of Service.

For clarity, this library, and each underlying component, is not a Google Maps Platform Core Service.

Support

This library is offered via an open source license. It is not governed by the Google Maps Platform Support Technical Support Services Guidelines, the SLA, or the Deprecation Policy (however, any Google Maps Platform services used by the library remain subject to the Google Maps Platform Terms of Service).

This library adheres to semantic versioning to indicate when backwards-incompatible changes are introduced.

If you find a bug, or have a feature request, please file an issue on GitHub. If you would like to get answers to technical questions from other Google Maps Platform developers, ask through one of our developer community channels. If you'd like to contribute, please check the Contributing guide.

You can also discuss this library on our Discord server.

google-maps-services-go's People

Contributors

alphawong avatar amuramoto avatar arriolac avatar broady avatar cristaloleg avatar deuteu avatar domesticmouse avatar ebati avatar encobrain avatar googlemaps-bot avatar jpoehnelt avatar markmcd avatar marksonghurst avatar mekegi avatar mgmcintyre avatar oanogin avatar oscarzhou avatar peergynt avatar pranas avatar requilence avatar rgaquino avatar ryankurte avatar samthor avatar sarahmaddox avatar savolro avatar scheca avatar shaunmitchellve avatar stephenmcd avatar wangela avatar wexder avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.