GithubHelp home page GithubHelp logo

qpc-github / google-api-go-client Goto Github PK

View Code? Open in Web Editor NEW

This project forked from googleapis/google-api-go-client

1.0 2.0 1.0 1.27 GB

Auto-generated Google APIs for Go.

Home Page: https://pkg.go.dev/google.golang.org/api

License: BSD 3-Clause "New" or "Revised" License

Shell 2.11% Go 97.69% Makefile 0.20%

google-api-go-client's Introduction

Google APIs Client Library for Go

Getting Started

$ go get google.golang.org/api/tasks/v1
$ go get google.golang.org/api/moderator/v1
$ go get google.golang.org/api/urlshortener/v1
... etc ...

and using:

package main

import (
        "context"
        "net/http"

        "google.golang.org/api/urlshortener/v1"
)

func main() {
        ctx := context.Background()
        svc, err := urlshortener.NewService(ctx)
        // ...
}

Status

Go Reference

These are auto-generated Go libraries from the Google Discovery Service's JSON description files.

Due to the auto-generated nature of this collection of libraries they may contain breaking changes from one release to the next. The generator itself and the code it produces are considered beta for this reason.

These client libraries are officially supported by Google. However, the libraries are considered complete and are in maintenance mode. This means that we will address critical bugs and security issues but will not add any new features.

If you're working with Google Cloud Platform APIs such as Datastore or Pub/Sub, please use the Cloud Client Libraries for Go instead. These are the new and idiomatic Go libraries targeted specifically at Google Cloud Platform Services.

Authorization

By default, each API will use Google Application Default Credentials for authorization credentials used in calling the API endpoints. This will allow your application to run in many environments without requiring explicit configuration.

// import "google.golang.org/api/sheets/v4"
client, err := sheets.NewService(ctx)

To authorize using a JSON key file, pass option.WithCredentialsFile to the NewService function of the desired package. For example:

client, err := sheets.NewService(ctx, option.WithCredentialsFile("path/to/keyfile.json"))

You can exert more control over authorization by using the golang.org/x/oauth2 package to create an oauth2.TokenSource. Then pass option.WithTokenSource to the NewService function:

tokenSource := ...
svc, err := sheets.NewService(ctx, option.WithTokenSource(tokenSource))

More information

For some more information related to all of the generated clients please read through our package documentation.

google-api-go-client's People

Contributors

yoshi-automation avatar googleapis-publisher avatar codyoss avatar gmlewis avatar bradfitz avatar jba avatar jeanbza avatar renovate-bot avatar release-please[bot] avatar mcgreevy avatar broady avatar okdave avatar tritone avatar andyrzhao avatar shollyman avatar mohanli-ml avatar campoy avatar zombiezen avatar shinfan avatar enocom avatar dsymonds avatar quartzmo avatar proppy avatar mattwhisenhunt avatar brennaepp avatar vchudnov-g avatar rakyll avatar marineam avatar namusyaka avatar saicheems avatar

Stargazers

 avatar

Watchers

 avatar  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.