在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):googleapis/google-api-go-client开源软件地址(OpenSource Url):https://github.com/googleapis/google-api-go-client开源编程语言(OpenSource Language):Go 100.0%开源软件介绍(OpenSource Introduction):Google APIs Client Library for GoGetting 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)
// ...
}
StatusThese 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. AuthorizationBy 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
client, err := sheets.NewService(ctx, option.WithCredentialsFile("path/to/keyfile.json")) You can exert more control over authorization by using the tokenSource := ...
svc, err := sheets.NewService(ctx, option.WithTokenSource(tokenSource)) More informationFor some more information related to all of the generated clients please read through our package documentation. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论