-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
178 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
internal/gengapic/testdata/shared_helpers_default_scope.want
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import ( | ||
"context" | ||
|
||
"google.golang.org/api/option" | ||
) | ||
|
||
// For more information on implementing a client constructor hook, see | ||
// https://github.com/googleapis/google-cloud-go/wiki/Customizing-constructors. | ||
type clientHookParams struct{} | ||
type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) | ||
|
||
var versionClient string | ||
|
||
func getVersionClient() string { | ||
if versionClient == "" { | ||
return "UNKNOWN" | ||
} | ||
return versionClient | ||
} | ||
|
||
// DefaultAuthScopes reports the default set of authentication scopes to use with this package. | ||
func DefaultAuthScopes() []string { | ||
return []string{ | ||
"https://www.googleapis.com/auth/cloud-platform", | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
internal/gengapic/testdata/shared_helpers_multiple_scopes.want
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import ( | ||
"context" | ||
|
||
"google.golang.org/api/option" | ||
) | ||
|
||
// For more information on implementing a client constructor hook, see | ||
// https://github.com/googleapis/google-cloud-go/wiki/Customizing-constructors. | ||
type clientHookParams struct{} | ||
type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) | ||
|
||
var versionClient string | ||
|
||
func getVersionClient() string { | ||
if versionClient == "" { | ||
return "UNKNOWN" | ||
} | ||
return versionClient | ||
} | ||
|
||
// DefaultAuthScopes reports the default set of authentication scopes to use with this package. | ||
func DefaultAuthScopes() []string { | ||
return []string{ | ||
"scope-a", | ||
"scope-b", | ||
"scope-c", | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import ( | ||
"context" | ||
|
||
"google.golang.org/api/option" | ||
) | ||
|
||
// For more information on implementing a client constructor hook, see | ||
// https://github.com/googleapis/google-cloud-go/wiki/Customizing-constructors. | ||
type clientHookParams struct{} | ||
type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) | ||
|
||
var versionClient string | ||
|
||
func getVersionClient() string { | ||
if versionClient == "" { | ||
return "UNKNOWN" | ||
} | ||
return versionClient | ||
} | ||
|