forked from remote/oauth2
more nits
This commit is contained in:
@@ -11,7 +11,7 @@ type localTokenSource struct {
|
||||
|
||||
func (localTokenSource) Token() (*oauth2.Token, error) {
|
||||
var remoteToken oauth2.Token
|
||||
// retrieve remoteToken, an oauth2.Token, from token broker
|
||||
// Retrieve remoteToken, an oauth2.Token, from token broker
|
||||
return &remoteToken, nil
|
||||
}
|
||||
|
||||
@@ -26,13 +26,13 @@ func Example() {
|
||||
brokerURL: "yourURL.com/internal/broker",
|
||||
}
|
||||
|
||||
// Wrap the TokenSource in an oauth2.ReuseTokenSource to enable automatic refreshing
|
||||
// Wrap the TokenSource in an oauth2.ReuseTokenSource to enable automatic refreshing.
|
||||
refreshableTS := oauth2.ReuseTokenSource(nil, thisTokenSource)
|
||||
|
||||
// You can now use the token source to access Google Cloud Storage resources as follows.
|
||||
|
||||
// storageClient, err := storage.NewClient(ctx, option.WithTokenSource(refreshableTS))
|
||||
// bkt := storageClient.Bucket("foo"")
|
||||
// bkt := storageClient.Bucket("foo")
|
||||
// obj := bkt.Object(objectName)
|
||||
// rc, err := obj.NewReader(ctx)
|
||||
// defer rc.Close()
|
||||
|
||||
Reference in New Issue
Block a user