Update dependencies

This commit is contained in:
github-actions
2024-07-19 06:06:26 +00:00
parent 369020d878
commit c0bccb7c76
143 changed files with 3122 additions and 2499 deletions
+41
View File
@@ -1,5 +1,46 @@
# Changelog
## [0.7.0](https://github.com/googleapis/google-cloud-go/compare/auth/v0.6.1...auth/v0.7.0) (2024-07-09)
### Features
* **auth:** Add workload X509 cert provider as a default cert provider ([#10479](https://github.com/googleapis/google-cloud-go/issues/10479)) ([c51ee6c](https://github.com/googleapis/google-cloud-go/commit/c51ee6cf65ce05b4d501083e49d468c75ac1ea63))
### Bug Fixes
* **auth/oauth2adapt:** Bump google.golang.org/api@v0.187.0 ([8fa9e39](https://github.com/googleapis/google-cloud-go/commit/8fa9e398e512fd8533fd49060371e61b5725a85b))
* **auth:** Bump google.golang.org/api@v0.187.0 ([8fa9e39](https://github.com/googleapis/google-cloud-go/commit/8fa9e398e512fd8533fd49060371e61b5725a85b))
* **auth:** Check len of slices, not non-nil ([#10483](https://github.com/googleapis/google-cloud-go/issues/10483)) ([0a966a1](https://github.com/googleapis/google-cloud-go/commit/0a966a183e5f0e811977216d736d875b7233e942))
## [0.6.1](https://github.com/googleapis/google-cloud-go/compare/auth/v0.6.0...auth/v0.6.1) (2024-07-01)
### Bug Fixes
* **auth:** Support gRPC API keys ([#10460](https://github.com/googleapis/google-cloud-go/issues/10460)) ([daa6646](https://github.com/googleapis/google-cloud-go/commit/daa6646d2af5d7fb5b30489f4934c7db89868c7c))
* **auth:** Update http and grpc transports to support token exchange over mTLS ([#10397](https://github.com/googleapis/google-cloud-go/issues/10397)) ([c6dfdcf](https://github.com/googleapis/google-cloud-go/commit/c6dfdcf893c3f971eba15026c12db0a960ae81f2))
## [0.6.0](https://github.com/googleapis/google-cloud-go/compare/auth/v0.5.2...auth/v0.6.0) (2024-06-25)
### Features
* **auth:** Add non-blocking token refresh for compute MDS ([#10263](https://github.com/googleapis/google-cloud-go/issues/10263)) ([9ac350d](https://github.com/googleapis/google-cloud-go/commit/9ac350da11a49b8e2174d3fc5b1a5070fec78b4e))
### Bug Fixes
* **auth:** Return error if envvar detected file returns an error ([#10431](https://github.com/googleapis/google-cloud-go/issues/10431)) ([e52b9a7](https://github.com/googleapis/google-cloud-go/commit/e52b9a7c45468827f5d220ab00965191faeb9d05))
## [0.5.2](https://github.com/googleapis/google-cloud-go/compare/auth/v0.5.1...auth/v0.5.2) (2024-06-24)
### Bug Fixes
* **auth:** Fetch initial token when CachedTokenProviderOptions.DisableAutoRefresh is true ([#10415](https://github.com/googleapis/google-cloud-go/issues/10415)) ([3266763](https://github.com/googleapis/google-cloud-go/commit/32667635ca2efad05cd8c087c004ca07d7406913)), refs [#10414](https://github.com/googleapis/google-cloud-go/issues/10414)
## [0.5.1](https://github.com/googleapis/google-cloud-go/compare/auth/v0.5.0...auth/v0.5.1) (2024-05-31)
+133 -18
View File
@@ -44,6 +44,21 @@ const (
universeDomainDefault = "googleapis.com"
)
// tokenState represents different states for a [Token].
type tokenState int
const (
// fresh indicates that the [Token] is valid. It is not expired or close to
// expired, or the token has no expiry.
fresh tokenState = iota
// stale indicates that the [Token] is close to expired, and should be
// refreshed. The token can be used normally.
stale
// invalid indicates that the [Token] is expired or invalid. The token
// cannot be used for a normal operation.
invalid
)
var (
defaultGrantType = "urn:ietf:params:oauth:grant-type:jwt-bearer"
defaultHeader = &jwt.Header{Algorithm: jwt.HeaderAlgRSA256, Type: jwt.HeaderType}
@@ -81,13 +96,13 @@ type Token struct {
// IsValid reports that a [Token] is non-nil, has a [Token.Value], and has not
// expired. A token is considered expired if [Token.Expiry] has passed or will
// pass in the next 10 seconds.
// pass in the next 225 seconds.
func (t *Token) IsValid() bool {
return t.isValidWithEarlyExpiry(defaultExpiryDelta)
}
func (t *Token) isValidWithEarlyExpiry(earlyExpiry time.Duration) bool {
if t == nil || t.Value == "" {
if t.isEmpty() {
return false
}
if t.Expiry.IsZero() {
@@ -96,6 +111,10 @@ func (t *Token) isValidWithEarlyExpiry(earlyExpiry time.Duration) bool {
return !t.Expiry.Round(0).Add(-earlyExpiry).Before(timeNow())
}
func (t *Token) isEmpty() bool {
return t == nil || t.Value == ""
}
// Credentials holds Google credentials, including
// [Application Default Credentials](https://developers.google.com/accounts/docs/application-default-credentials).
type Credentials struct {
@@ -206,11 +225,15 @@ func NewCredentials(opts *CredentialsOptions) *Credentials {
// CachedTokenProvider.
type CachedTokenProviderOptions struct {
// DisableAutoRefresh makes the TokenProvider always return the same token,
// even if it is expired.
// even if it is expired. The default is false. Optional.
DisableAutoRefresh bool
// ExpireEarly configures the amount of time before a token expires, that it
// should be refreshed. If unset, the default value is 10 seconds.
// should be refreshed. If unset, the default value is 3 minutes and 45
// seconds. Optional.
ExpireEarly time.Duration
// DisableAsyncRefresh configures a synchronous workflow that refreshes
// stale tokens while blocking. The default is false. Optional.
DisableAsyncRefresh bool
}
func (ctpo *CachedTokenProviderOptions) autoRefresh() bool {
@@ -227,34 +250,126 @@ func (ctpo *CachedTokenProviderOptions) expireEarly() time.Duration {
return ctpo.ExpireEarly
}
func (ctpo *CachedTokenProviderOptions) blockingRefresh() bool {
if ctpo == nil {
return false
}
return ctpo.DisableAsyncRefresh
}
// NewCachedTokenProvider wraps a [TokenProvider] to cache the tokens returned
// by the underlying provider. By default it will refresh tokens ten seconds
// before they expire, but this time can be configured with the optional
// options.
// by the underlying provider. By default it will refresh tokens asynchronously
// (non-blocking mode) within a window that starts 3 minutes and 45 seconds
// before they expire. The asynchronous (non-blocking) refresh can be changed to
// a synchronous (blocking) refresh using the
// CachedTokenProviderOptions.DisableAsyncRefresh option. The time-before-expiry
// duration can be configured using the CachedTokenProviderOptions.ExpireEarly
// option.
func NewCachedTokenProvider(tp TokenProvider, opts *CachedTokenProviderOptions) TokenProvider {
if ctp, ok := tp.(*cachedTokenProvider); ok {
return ctp
}
return &cachedTokenProvider{
tp: tp,
autoRefresh: opts.autoRefresh(),
expireEarly: opts.expireEarly(),
tp: tp,
autoRefresh: opts.autoRefresh(),
expireEarly: opts.expireEarly(),
blockingRefresh: opts.blockingRefresh(),
}
}
type cachedTokenProvider struct {
tp TokenProvider
autoRefresh bool
expireEarly time.Duration
tp TokenProvider
autoRefresh bool
expireEarly time.Duration
blockingRefresh bool
mu sync.Mutex
cachedToken *Token
// isRefreshRunning ensures that the non-blocking refresh will only be
// attempted once, even if multiple callers enter the Token method.
isRefreshRunning bool
// isRefreshErr ensures that the non-blocking refresh will only be attempted
// once per refresh window if an error is encountered.
isRefreshErr bool
}
func (c *cachedTokenProvider) Token(ctx context.Context) (*Token, error) {
if c.blockingRefresh {
return c.tokenBlocking(ctx)
}
return c.tokenNonBlocking(ctx)
}
func (c *cachedTokenProvider) tokenNonBlocking(ctx context.Context) (*Token, error) {
switch c.tokenState() {
case fresh:
c.mu.Lock()
defer c.mu.Unlock()
return c.cachedToken, nil
case stale:
c.tokenAsync(ctx)
// Return the stale token immediately to not block customer requests to Cloud services.
c.mu.Lock()
defer c.mu.Unlock()
return c.cachedToken, nil
default: // invalid
return c.tokenBlocking(ctx)
}
}
// tokenState reports the token's validity.
func (c *cachedTokenProvider) tokenState() tokenState {
c.mu.Lock()
defer c.mu.Unlock()
if c.cachedToken.IsValid() || !c.autoRefresh {
t := c.cachedToken
if t == nil || t.Value == "" {
return invalid
} else if t.Expiry.IsZero() {
return fresh
} else if timeNow().After(t.Expiry.Round(0)) {
return invalid
} else if timeNow().After(t.Expiry.Round(0).Add(-c.expireEarly)) {
return stale
}
return fresh
}
// tokenAsync uses a bool to ensure that only one non-blocking token refresh
// happens at a time, even if multiple callers have entered this function
// concurrently. This avoids creating an arbitrary number of concurrent
// goroutines. Retries should be attempted and managed within the Token method.
// If the refresh attempt fails, no further attempts are made until the refresh
// window expires and the token enters the invalid state, at which point the
// blocking call to Token should likely return the same error on the main goroutine.
func (c *cachedTokenProvider) tokenAsync(ctx context.Context) {
fn := func() {
c.mu.Lock()
c.isRefreshRunning = true
c.mu.Unlock()
t, err := c.tp.Token(ctx)
c.mu.Lock()
defer c.mu.Unlock()
c.isRefreshRunning = false
if err != nil {
// Discard errors from the non-blocking refresh, but prevent further
// attempts.
c.isRefreshErr = true
return
}
c.cachedToken = t
}
c.mu.Lock()
defer c.mu.Unlock()
if !c.isRefreshRunning && !c.isRefreshErr {
go fn()
}
}
func (c *cachedTokenProvider) tokenBlocking(ctx context.Context) (*Token, error) {
c.mu.Lock()
defer c.mu.Unlock()
c.isRefreshErr = false
if c.cachedToken.IsValid() || (!c.autoRefresh && !c.cachedToken.isEmpty()) {
return c.cachedToken, nil
}
t, err := c.tp.Token(ctx)
@@ -423,12 +538,12 @@ func (tp tokenProvider2LO) Token(ctx context.Context) (*Token, error) {
v := url.Values{}
v.Set("grant_type", defaultGrantType)
v.Set("assertion", payload)
resp, err := tp.Client.PostForm(tp.opts.TokenURL, v)
req, err := http.NewRequestWithContext(ctx, "POST", tp.opts.TokenURL, strings.NewReader(v.Encode()))
if err != nil {
return nil, fmt.Errorf("auth: cannot fetch token: %w", err)
return nil, err
}
defer resp.Body.Close()
body, err := internal.ReadAll(resp.Body)
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
resp, body, err := internal.DoRequest(tp.Client, req)
if err != nil {
return nil, fmt.Errorf("auth: cannot fetch token: %w", err)
}
+4 -3
View File
@@ -37,9 +37,10 @@ var (
// computeTokenProvider creates a [cloud.google.com/go/auth.TokenProvider] that
// uses the metadata service to retrieve tokens.
func computeTokenProvider(earlyExpiry time.Duration, scope ...string) auth.TokenProvider {
return auth.NewCachedTokenProvider(computeProvider{scopes: scope}, &auth.CachedTokenProviderOptions{
ExpireEarly: earlyExpiry,
func computeTokenProvider(opts *DetectOptions) auth.TokenProvider {
return auth.NewCachedTokenProvider(computeProvider{scopes: opts.Scopes}, &auth.CachedTokenProviderOptions{
ExpireEarly: opts.EarlyTokenRefresh,
DisableAsyncRefresh: opts.DisableAsyncRefresh,
})
}
+15 -5
View File
@@ -37,6 +37,9 @@ const (
googleAuthURL = "https://accounts.google.com/o/oauth2/auth"
googleTokenURL = "https://oauth2.googleapis.com/token"
// GoogleMTLSTokenURL is Google's default OAuth2.0 mTLS endpoint.
GoogleMTLSTokenURL = "https://oauth2.mtls.googleapis.com/token"
// Help on default credentials
adcSetupURL = "https://cloud.google.com/docs/authentication/external/set-up-adc"
)
@@ -73,16 +76,18 @@ func DetectDefault(opts *DetectOptions) (*auth.Credentials, error) {
if err := opts.validate(); err != nil {
return nil, err
}
if opts.CredentialsJSON != nil {
if len(opts.CredentialsJSON) > 0 {
return readCredentialsFileJSON(opts.CredentialsJSON, opts)
}
if opts.CredentialsFile != "" {
return readCredentialsFile(opts.CredentialsFile, opts)
}
if filename := os.Getenv(credsfile.GoogleAppCredsEnvVar); filename != "" {
if creds, err := readCredentialsFile(filename, opts); err == nil {
return creds, err
creds, err := readCredentialsFile(filename, opts)
if err != nil {
return nil, err
}
return creds, nil
}
fileName := credsfile.GetWellKnownFileName()
@@ -92,7 +97,7 @@ func DetectDefault(opts *DetectOptions) (*auth.Credentials, error) {
if OnGCE() {
return auth.NewCredentials(&auth.CredentialsOptions{
TokenProvider: computeTokenProvider(opts.EarlyTokenRefresh, opts.Scopes...),
TokenProvider: computeTokenProvider(opts),
ProjectIDProvider: auth.CredentialsPropertyFunc(func(context.Context) (string, error) {
return metadata.ProjectID()
}),
@@ -116,8 +121,13 @@ type DetectOptions struct {
// Optional.
Subject string
// EarlyTokenRefresh configures how early before a token expires that it
// should be refreshed.
// should be refreshed. Once the tokens time until expiration has entered
// this refresh window the token is considered valid but stale. If unset,
// the default value is 3 minutes and 45 seconds. Optional.
EarlyTokenRefresh time.Duration
// DisableAsyncRefresh configures a synchronous workflow that refreshes
// stale tokens while blocking. The default is false. Optional.
DisableAsyncRefresh bool
// AuthHandlerOptions configures an authorization handler and other options
// for 3LO flows. It is required, and only used, for client credential
// flows.
@@ -122,7 +122,7 @@ func (sp *awsSubjectProvider) subjectToken(ctx context.Context) (string, error)
// Generate the signed request to AWS STS GetCallerIdentity API.
// Use the required regional endpoint. Otherwise, the request will fail.
req, err := http.NewRequest("POST", strings.Replace(sp.RegionalCredVerificationURL, "{region}", sp.region, 1), nil)
req, err := http.NewRequestWithContext(ctx, "POST", strings.Replace(sp.RegionalCredVerificationURL, "{region}", sp.region, 1), nil)
if err != nil {
return "", err
}
@@ -194,20 +194,14 @@ func (sp *awsSubjectProvider) getAWSSessionToken(ctx context.Context) (string, e
}
req.Header.Set(awsIMDSv2SessionTTLHeader, awsIMDSv2SessionTTL)
resp, err := sp.Client.Do(req)
if err != nil {
return "", err
}
defer resp.Body.Close()
respBody, err := internal.ReadAll(resp.Body)
resp, body, err := internal.DoRequest(sp.Client, req)
if err != nil {
return "", err
}
if resp.StatusCode != http.StatusOK {
return "", fmt.Errorf("credentials: unable to retrieve AWS session token: %s", respBody)
return "", fmt.Errorf("credentials: unable to retrieve AWS session token: %s", body)
}
return string(respBody), nil
return string(body), nil
}
func (sp *awsSubjectProvider) getRegion(ctx context.Context, headers map[string]string) (string, error) {
@@ -233,29 +227,21 @@ func (sp *awsSubjectProvider) getRegion(ctx context.Context, headers map[string]
for name, value := range headers {
req.Header.Add(name, value)
}
resp, err := sp.Client.Do(req)
resp, body, err := internal.DoRequest(sp.Client, req)
if err != nil {
return "", err
}
defer resp.Body.Close()
respBody, err := internal.ReadAll(resp.Body)
if err != nil {
return "", err
}
if resp.StatusCode != http.StatusOK {
return "", fmt.Errorf("credentials: unable to retrieve AWS region - %s", respBody)
return "", fmt.Errorf("credentials: unable to retrieve AWS region - %s", body)
}
// This endpoint will return the region in format: us-east-2b.
// Only the us-east-2 part should be used.
bodyLen := len(respBody)
bodyLen := len(body)
if bodyLen == 0 {
return "", nil
}
return string(respBody[:bodyLen-1]), nil
return string(body[:bodyLen-1]), nil
}
func (sp *awsSubjectProvider) getSecurityCredentials(ctx context.Context, headers map[string]string) (result *AwsSecurityCredentials, err error) {
@@ -299,22 +285,17 @@ func (sp *awsSubjectProvider) getMetadataSecurityCredentials(ctx context.Context
for name, value := range headers {
req.Header.Add(name, value)
}
resp, err := sp.Client.Do(req)
if err != nil {
return result, err
}
defer resp.Body.Close()
respBody, err := internal.ReadAll(resp.Body)
resp, body, err := internal.DoRequest(sp.Client, req)
if err != nil {
return result, err
}
if resp.StatusCode != http.StatusOK {
return result, fmt.Errorf("credentials: unable to retrieve AWS security credentials - %s", respBody)
return result, fmt.Errorf("credentials: unable to retrieve AWS security credentials - %s", body)
}
err = json.Unmarshal(respBody, &result)
return result, err
if err := json.Unmarshal(body, &result); err != nil {
return nil, err
}
return result, nil
}
func (sp *awsSubjectProvider) getMetadataRoleName(ctx context.Context, headers map[string]string) (string, error) {
@@ -329,20 +310,14 @@ func (sp *awsSubjectProvider) getMetadataRoleName(ctx context.Context, headers m
req.Header.Add(name, value)
}
resp, err := sp.Client.Do(req)
if err != nil {
return "", err
}
defer resp.Body.Close()
respBody, err := internal.ReadAll(resp.Body)
resp, body, err := internal.DoRequest(sp.Client, req)
if err != nil {
return "", err
}
if resp.StatusCode != http.StatusOK {
return "", fmt.Errorf("credentials: unable to retrieve AWS role name - %s", respBody)
return "", fmt.Errorf("credentials: unable to retrieve AWS role name - %s", body)
}
return string(respBody), nil
return string(body), nil
}
// awsRequestSigner is a utility class to sign http requests using a AWS V4 signature.
@@ -48,27 +48,21 @@ func (sp *urlSubjectProvider) subjectToken(ctx context.Context) (string, error)
for key, val := range sp.Headers {
req.Header.Add(key, val)
}
resp, err := sp.Client.Do(req)
resp, body, err := internal.DoRequest(sp.Client, req)
if err != nil {
return "", fmt.Errorf("credentials: invalid response when retrieving subject token: %w", err)
}
defer resp.Body.Close()
respBody, err := internal.ReadAll(resp.Body)
if err != nil {
return "", fmt.Errorf("credentials: invalid body in subject token URL query: %w", err)
}
if c := resp.StatusCode; c < http.StatusOK || c >= http.StatusMultipleChoices {
return "", fmt.Errorf("credentials: status code %d: %s", c, respBody)
return "", fmt.Errorf("credentials: status code %d: %s", c, body)
}
if sp.Format == nil {
return string(respBody), nil
return string(body), nil
}
switch sp.Format.Type {
case "json":
jsonData := make(map[string]interface{})
err = json.Unmarshal(respBody, &jsonData)
err = json.Unmarshal(body, &jsonData)
if err != nil {
return "", fmt.Errorf("credentials: failed to unmarshal subject token file: %w", err)
}
@@ -82,7 +76,7 @@ func (sp *urlSubjectProvider) subjectToken(ctx context.Context) (string, error)
}
return token, nil
case fileTypeText:
return string(respBody), nil
return string(body), nil
default:
return "", errors.New("credentials: invalid credential_source file format type: " + sp.Format.Type)
}
+6 -4
View File
@@ -25,6 +25,7 @@ import (
"net/http"
"net/url"
"os"
"strings"
"time"
"cloud.google.com/go/auth"
@@ -129,12 +130,13 @@ func (g gdchProvider) Token(ctx context.Context) (*auth.Token, error) {
v.Set("requested_token_type", requestTokenType)
v.Set("subject_token", payload)
v.Set("subject_token_type", subjectTokenType)
resp, err := g.client.PostForm(g.tokenURL, v)
req, err := http.NewRequestWithContext(ctx, "POST", g.tokenURL, strings.NewReader(v.Encode()))
if err != nil {
return nil, fmt.Errorf("credentials: cannot fetch token: %w", err)
return nil, err
}
defer resp.Body.Close()
body, err := internal.ReadAll(resp.Body)
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
resp, body, err := internal.DoRequest(g.client, req)
if err != nil {
return nil, fmt.Errorf("credentials: cannot fetch token: %w", err)
}
@@ -109,15 +109,10 @@ func (o *Options) Token(ctx context.Context) (*auth.Token, error) {
if err := setAuthHeader(ctx, o.Tp, req); err != nil {
return nil, err
}
resp, err := o.Client.Do(req)
resp, body, err := internal.DoRequest(o.Client, req)
if err != nil {
return nil, fmt.Errorf("credentials: unable to generate access token: %w", err)
}
defer resp.Body.Close()
body, err := internal.ReadAll(resp.Body)
if err != nil {
return nil, fmt.Errorf("credentials: unable to read body: %w", err)
}
if c := resp.StatusCode; c < http.StatusOK || c >= http.StatusMultipleChoices {
return nil, fmt.Errorf("credentials: status code %d: %s", c, body)
}
@@ -93,16 +93,10 @@ func doRequest(ctx context.Context, opts *Options, data url.Values) (*TokenRespo
}
req.Header.Set("Content-Length", strconv.Itoa(len(encodedData)))
resp, err := opts.Client.Do(req)
resp, body, err := internal.DoRequest(opts.Client, req)
if err != nil {
return nil, fmt.Errorf("credentials: invalid response from Secure Token Server: %w", err)
}
defer resp.Body.Close()
body, err := internal.ReadAll(resp.Body)
if err != nil {
return nil, err
}
if c := resp.StatusCode; c < http.StatusOK || c > http.StatusMultipleChoices {
return nil, fmt.Errorf("credentials: status code %d: %s", c, body)
}
+61 -6
View File
@@ -16,6 +16,7 @@ package grpctransport
import (
"context"
"crypto/tls"
"errors"
"fmt"
"net/http"
@@ -45,6 +46,11 @@ var (
timeoutDialerOption grpc.DialOption
)
// ClientCertProvider is a function that returns a TLS client certificate to be
// used when opening TLS connections. It follows the same semantics as
// [crypto/tls.Config.GetClientCertificate].
type ClientCertProvider = func(*tls.CertificateRequestInfo) (*tls.Certificate, error)
// Options used to configure a [GRPCClientConnPool] from [Dial].
type Options struct {
// DisableTelemetry disables default telemetry (OpenTelemetry). An example
@@ -69,6 +75,10 @@ type Options struct {
// Credentials used to add Authorization metadata to all requests. If set
// DetectOpts are ignored.
Credentials *auth.Credentials
// ClientCertProvider is a function that returns a TLS client certificate to
// be used when opening TLS connections. It follows the same semantics as
// crypto/tls.Config.GetClientCertificate.
ClientCertProvider ClientCertProvider
// DetectOpts configures settings for detect Application Default
// Credentials.
DetectOpts *credentials.DetectOptions
@@ -77,6 +87,9 @@ type Options struct {
// configured for the client, which will be compared to the universe domain
// that is separately configured for the credentials.
UniverseDomain string
// APIKey specifies an API key to be used as the basis for authentication.
// If set DetectOpts are ignored.
APIKey string
// InternalOptions are NOT meant to be set directly by consumers of this
// package, they should only be set by generated client code.
@@ -99,7 +112,8 @@ func (o *Options) validate() error {
if o.InternalOptions != nil && o.InternalOptions.SkipValidation {
return nil
}
hasCreds := o.Credentials != nil ||
hasCreds := o.APIKey != "" ||
o.Credentials != nil ||
(o.DetectOpts != nil && len(o.DetectOpts.CredentialsJSON) > 0) ||
(o.DetectOpts != nil && o.DetectOpts.CredentialsFile != "")
if o.DisableAuthentication && hasCreds {
@@ -125,6 +139,13 @@ func (o *Options) resolveDetectOptions() *credentials.DetectOptions {
if len(do.Scopes) == 0 && do.Audience == "" && io != nil {
do.Audience = o.InternalOptions.DefaultAudience
}
if o.ClientCertProvider != nil {
tlsConfig := &tls.Config{
GetClientCertificate: o.ClientCertProvider,
}
do.Client = transport.DefaultHTTPClientWithTLS(tlsConfig)
do.TokenURL = credentials.GoogleMTLSTokenURL
}
return do
}
@@ -189,9 +210,10 @@ func Dial(ctx context.Context, secure bool, opts *Options) (GRPCClientConnPool,
// return a GRPCClientConnPool if pool == 1 or else a pool of of them if >1
func dial(ctx context.Context, secure bool, opts *Options) (*grpc.ClientConn, error) {
tOpts := &transport.Options{
Endpoint: opts.Endpoint,
Client: opts.client(),
UniverseDomain: opts.UniverseDomain,
Endpoint: opts.Endpoint,
ClientCertProvider: opts.ClientCertProvider,
Client: opts.client(),
UniverseDomain: opts.UniverseDomain,
}
if io := opts.InternalOptions; io != nil {
tOpts.DefaultEndpointTemplate = io.DefaultEndpointTemplate
@@ -213,8 +235,21 @@ func dial(ctx context.Context, secure bool, opts *Options) (*grpc.ClientConn, er
grpc.WithTransportCredentials(transportCreds),
}
// Authentication can only be sent when communicating over a secure connection.
if !opts.DisableAuthentication {
// Ensure the token exchange HTTP transport uses the same ClientCertProvider as the GRPC API transport.
opts.ClientCertProvider, err = transport.GetClientCertificateProvider(tOpts)
if err != nil {
return nil, err
}
if opts.APIKey != "" {
grpcOpts = append(grpcOpts,
grpc.WithPerRPCCredentials(&grpcKeyProvider{
apiKey: opts.APIKey,
metadata: opts.Metadata,
secure: secure,
}),
)
} else if !opts.DisableAuthentication {
metadata := opts.Metadata
var creds *auth.Credentials
@@ -259,6 +294,26 @@ func dial(ctx context.Context, secure bool, opts *Options) (*grpc.ClientConn, er
return grpc.DialContext(ctx, endpoint, grpcOpts...)
}
// grpcKeyProvider satisfies https://pkg.go.dev/google.golang.org/grpc/credentials#PerRPCCredentials.
type grpcKeyProvider struct {
apiKey string
metadata map[string]string
secure bool
}
func (g *grpcKeyProvider) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) {
metadata := make(map[string]string, len(g.metadata)+1)
metadata["X-goog-api-key"] = g.apiKey
for k, v := range g.metadata {
metadata[k] = v
}
return metadata, nil
}
func (g *grpcKeyProvider) RequireTransportSecurity() bool {
return g.secure
}
// grpcCredentialsProvider satisfies https://pkg.go.dev/google.golang.org/grpc/credentials#PerRPCCredentials.
type grpcCredentialsProvider struct {
creds *auth.Credentials
+9
View File
@@ -116,6 +116,13 @@ func (o *Options) resolveDetectOptions() *detect.DetectOptions {
if len(do.Scopes) == 0 && do.Audience == "" && io != nil {
do.Audience = o.InternalOptions.DefaultAudience
}
if o.ClientCertProvider != nil {
tlsConfig := &tls.Config{
GetClientCertificate: o.ClientCertProvider,
}
do.Client = transport.DefaultHTTPClientWithTLS(tlsConfig)
do.TokenURL = detect.GoogleMTLSTokenURL
}
return do
}
@@ -195,6 +202,8 @@ func NewClient(opts *Options) (*http.Client, error) {
if baseRoundTripper == nil {
baseRoundTripper = defaultBaseTransport(clientCertProvider, dialTLSContext)
}
// Ensure the token exchange transport uses the same ClientCertProvider as the API transport.
opts.ClientCertProvider = clientCertProvider
trans, err := newTransport(baseRoundTripper, opts)
if err != nil {
return nil, err
+16 -2
View File
@@ -124,6 +124,21 @@ func GetProjectID(b []byte, override string) string {
return v.Project
}
// DoRequest executes the provided req with the client. It reads the response
// body, closes it, and returns it.
func DoRequest(client *http.Client, req *http.Request) (*http.Response, []byte, error) {
resp, err := client.Do(req)
if err != nil {
return nil, nil, err
}
defer resp.Body.Close()
body, err := ReadAll(io.LimitReader(resp.Body, maxBodySize))
if err != nil {
return nil, nil, err
}
return resp, body, nil
}
// ReadAll consumes the whole reader and safely reads the content of its body
// with some overflow protection.
func ReadAll(r io.Reader) ([]byte, error) {
@@ -167,8 +182,7 @@ func (c *ComputeUniverseDomainProvider) GetProperty(ctx context.Context) (string
// httpGetMetadataUniverseDomain is a package var for unit test substitution.
var httpGetMetadataUniverseDomain = func(ctx context.Context) (string, error) {
client := metadata.NewClient(&http.Client{Timeout: time.Second})
// TODO(quartzmo): set ctx on request
return client.Get("universe/universe_domain")
return client.GetWithContext(ctx, "universe/universe_domain")
}
func getMetadataUniverseDomain(ctx context.Context) (string, error) {
+3 -3
View File
@@ -176,7 +176,7 @@ func GetHTTPTransportConfig(opts *Options) (cert.Provider, func(context.Context,
}
func getTransportConfig(opts *Options) (*transportConfig, error) {
clientCertSource, err := getClientCertificateSource(opts)
clientCertSource, err := GetClientCertificateProvider(opts)
if err != nil {
return nil, err
}
@@ -210,13 +210,13 @@ func getTransportConfig(opts *Options) (*transportConfig, error) {
}, nil
}
// getClientCertificateSource returns a default client certificate source, if
// GetClientCertificateProvider returns a default client certificate source, if
// not provided by the user.
//
// A nil default source can be returned if the source does not exist. Any exceptions
// encountered while initializing the default source will be reported as client
// error (ex. corrupt metadata file).
func getClientCertificateSource(opts *Options) (cert.Provider, error) {
func GetClientCertificateProvider(opts *Options) (cert.Provider, error) {
if !isClientCertificateEnabled(opts) {
return nil, nil
} else if opts.ClientCertProvider != nil {
+6 -3
View File
@@ -50,11 +50,14 @@ var errSourceUnavailable = errors.New("certificate source is unavailable")
// returned to indicate that a default certificate source is unavailable.
func DefaultProvider() (Provider, error) {
defaultCert.once.Do(func() {
defaultCert.provider, defaultCert.err = NewEnterpriseCertificateProxyProvider("")
defaultCert.provider, defaultCert.err = NewWorkloadX509CertProvider("")
if errors.Is(defaultCert.err, errSourceUnavailable) {
defaultCert.provider, defaultCert.err = NewSecureConnectProvider("")
defaultCert.provider, defaultCert.err = NewEnterpriseCertificateProxyProvider("")
if errors.Is(defaultCert.err, errSourceUnavailable) {
defaultCert.provider, defaultCert.err = nil, nil
defaultCert.provider, defaultCert.err = NewSecureConnectProvider("")
if errors.Is(defaultCert.err, errSourceUnavailable) {
defaultCert.provider, defaultCert.err = nil, nil
}
}
}
})
+1 -1
View File
@@ -99,7 +99,7 @@ func getCertAndKeyFiles(configFilePath string) (string, string, error) {
}
if config.CertConfigs.Workload == nil {
return "", "", errors.New("no Workload Identity Federation certificate information found in the certificate configuration file")
return "", "", errSourceUnavailable
}
certFile := config.CertConfigs.Workload.CertPath
+29 -2
View File
@@ -17,7 +17,11 @@
package transport
import (
"crypto/tls"
"fmt"
"net"
"net/http"
"time"
"cloud.google.com/go/auth/credentials"
)
@@ -49,11 +53,11 @@ func CloneDetectOptions(oldDo *credentials.DetectOptions) *credentials.DetectOpt
}
// Smartly size this memory and copy below.
if oldDo.CredentialsJSON != nil {
if len(oldDo.CredentialsJSON) > 0 {
newDo.CredentialsJSON = make([]byte, len(oldDo.CredentialsJSON))
copy(newDo.CredentialsJSON, oldDo.CredentialsJSON)
}
if oldDo.Scopes != nil {
if len(oldDo.Scopes) > 0 {
newDo.Scopes = make([]string, len(oldDo.Scopes))
copy(newDo.Scopes, oldDo.Scopes)
}
@@ -74,3 +78,26 @@ func ValidateUniverseDomain(clientUniverseDomain, credentialsUniverseDomain stri
}
return nil
}
// DefaultHTTPClientWithTLS constructs an HTTPClient using the provided tlsConfig, to support mTLS.
func DefaultHTTPClientWithTLS(tlsConfig *tls.Config) *http.Client {
trans := baseTransport()
trans.TLSClientConfig = tlsConfig
return &http.Client{Transport: trans}
}
func baseTransport() *http.Transport {
return &http.Transport{
Proxy: http.ProxyFromEnvironment,
DialContext: (&net.Dialer{
Timeout: 30 * time.Second,
KeepAlive: 30 * time.Second,
DualStack: true,
}).DialContext,
MaxIdleConns: 100,
MaxIdleConnsPerHost: 100,
IdleConnTimeout: 90 * time.Second,
TLSHandshakeTimeout: 10 * time.Second,
ExpectContinueTimeout: 1 * time.Second,
}
}
+7 -12
View File
@@ -62,7 +62,8 @@ type Options3LO struct {
// Optional.
Client *http.Client
// EarlyTokenExpiry is the time before the token expires that it should be
// refreshed. If not set the default value is 10 seconds. Optional.
// refreshed. If not set the default value is 3 minutes and 45 seconds.
// Optional.
EarlyTokenExpiry time.Duration
// AuthHandlerOpts provides a set of options for doing a
@@ -284,7 +285,7 @@ func fetchToken(ctx context.Context, o *Options3LO, v url.Values) (*Token, strin
v.Set("client_secret", o.ClientSecret)
}
}
req, err := http.NewRequest("POST", o.TokenURL, strings.NewReader(v.Encode()))
req, err := http.NewRequestWithContext(ctx, "POST", o.TokenURL, strings.NewReader(v.Encode()))
if err != nil {
return nil, refreshToken, err
}
@@ -294,25 +295,19 @@ func fetchToken(ctx context.Context, o *Options3LO, v url.Values) (*Token, strin
}
// Make request
r, err := o.client().Do(req.WithContext(ctx))
resp, body, err := internal.DoRequest(o.client(), req)
if err != nil {
return nil, refreshToken, err
}
body, err := internal.ReadAll(r.Body)
r.Body.Close()
if err != nil {
return nil, refreshToken, fmt.Errorf("auth: cannot fetch token: %w", err)
}
failureStatus := r.StatusCode < 200 || r.StatusCode > 299
failureStatus := resp.StatusCode < 200 || resp.StatusCode > 299
tokError := &Error{
Response: r,
Response: resp,
Body: body,
}
var token *Token
// errors ignored because of default switch on content
content, _, _ := mime.ParseMediaType(r.Header.Get("Content-Type"))
content, _, _ := mime.ParseMediaType(resp.Header.Get("Content-Type"))
switch content {
case "application/x-www-form-urlencoded", "text/plain":
// some endpoints return a query string
+19
View File
@@ -1,5 +1,24 @@
# Changes
## [0.5.0](https://github.com/googleapis/google-cloud-go/compare/compute/metadata/v0.4.0...compute/metadata/v0.5.0) (2024-07-10)
### Features
* **compute/metadata:** Add sys check for windows OnGCE ([#10521](https://github.com/googleapis/google-cloud-go/issues/10521)) ([3b9a830](https://github.com/googleapis/google-cloud-go/commit/3b9a83063960d2a2ac20beb47cc15818a68bd302))
## [0.4.0](https://github.com/googleapis/google-cloud-go/compare/compute/metadata/v0.3.0...compute/metadata/v0.4.0) (2024-07-01)
### Features
* **compute/metadata:** Add context for all functions/methods ([#10370](https://github.com/googleapis/google-cloud-go/issues/10370)) ([66b8efe](https://github.com/googleapis/google-cloud-go/commit/66b8efe7ad877e052b2987bb4475477e38c67bb3))
### Documentation
* **compute/metadata:** Update OnGCE description ([#10408](https://github.com/googleapis/google-cloud-go/issues/10408)) ([6a46dca](https://github.com/googleapis/google-cloud-go/commit/6a46dca4eae4f88ec6f88822e01e5bf8aeca787f))
## [0.3.0](https://github.com/googleapis/google-cloud-go/compare/compute/metadata/v0.2.3...compute/metadata/v0.3.0) (2024-04-15)
+319 -62
View File
@@ -28,7 +28,6 @@ import (
"net/http"
"net/url"
"os"
"runtime"
"strings"
"sync"
"time"
@@ -88,16 +87,16 @@ func (suffix NotDefinedError) Error() string {
return fmt.Sprintf("metadata: GCE metadata %q not defined", string(suffix))
}
func (c *cachedValue) get(cl *Client) (v string, err error) {
func (c *cachedValue) get(ctx context.Context, cl *Client) (v string, err error) {
defer c.mu.Unlock()
c.mu.Lock()
if c.v != "" {
return c.v, nil
}
if c.trim {
v, err = cl.getTrimmed(context.Background(), c.k)
v, err = cl.getTrimmed(ctx, c.k)
} else {
v, err = cl.GetWithContext(context.Background(), c.k)
v, err = cl.GetWithContext(ctx, c.k)
}
if err == nil {
c.v = v
@@ -110,7 +109,9 @@ var (
onGCE bool
)
// OnGCE reports whether this process is running on Google Compute Engine.
// OnGCE reports whether this process is running on Google Compute Platforms.
// NOTE: True returned from `OnGCE` does not guarantee that the metadata server
// is accessible from this process and have all the metadata defined.
func OnGCE() bool {
onGCEOnce.Do(initOnGCE)
return onGCE
@@ -188,21 +189,9 @@ func testOnGCE() bool {
return <-resc
}
// systemInfoSuggestsGCE reports whether the local system (without
// doing network requests) suggests that we're running on GCE. If this
// returns true, testOnGCE tries a bit harder to reach its metadata
// server.
func systemInfoSuggestsGCE() bool {
if runtime.GOOS != "linux" {
// We don't have any non-Linux clues available, at least yet.
return false
}
slurp, _ := os.ReadFile("/sys/class/dmi/id/product_name")
name := strings.TrimSpace(string(slurp))
return name == "Google" || name == "Google Compute Engine"
}
// Subscribe calls Client.SubscribeWithContext on the default client.
//
// Deprecated: Please use the context aware variant [SubscribeWithContext].
func Subscribe(suffix string, fn func(v string, ok bool) error) error {
return defaultClient.SubscribeWithContext(context.Background(), suffix, func(ctx context.Context, v string, ok bool) error { return fn(v, ok) })
}
@@ -225,55 +214,188 @@ func GetWithContext(ctx context.Context, suffix string) (string, error) {
}
// ProjectID returns the current instance's project ID string.
func ProjectID() (string, error) { return defaultClient.ProjectID() }
//
// Deprecated: Please use the context aware variant [ProjectIDWithContext].
func ProjectID() (string, error) {
return defaultClient.ProjectIDWithContext(context.Background())
}
// ProjectIDWithContext returns the current instance's project ID string.
func ProjectIDWithContext(ctx context.Context) (string, error) {
return defaultClient.ProjectIDWithContext(ctx)
}
// NumericProjectID returns the current instance's numeric project ID.
func NumericProjectID() (string, error) { return defaultClient.NumericProjectID() }
//
// Deprecated: Please use the context aware variant [NumericProjectIDWithContext].
func NumericProjectID() (string, error) {
return defaultClient.NumericProjectIDWithContext(context.Background())
}
// NumericProjectIDWithContext returns the current instance's numeric project ID.
func NumericProjectIDWithContext(ctx context.Context) (string, error) {
return defaultClient.NumericProjectIDWithContext(ctx)
}
// InternalIP returns the instance's primary internal IP address.
func InternalIP() (string, error) { return defaultClient.InternalIP() }
//
// Deprecated: Please use the context aware variant [InternalIPWithContext].
func InternalIP() (string, error) {
return defaultClient.InternalIPWithContext(context.Background())
}
// InternalIPWithContext returns the instance's primary internal IP address.
func InternalIPWithContext(ctx context.Context) (string, error) {
return defaultClient.InternalIPWithContext(ctx)
}
// ExternalIP returns the instance's primary external (public) IP address.
func ExternalIP() (string, error) { return defaultClient.ExternalIP() }
//
// Deprecated: Please use the context aware variant [ExternalIPWithContext].
func ExternalIP() (string, error) {
return defaultClient.ExternalIPWithContext(context.Background())
}
// Email calls Client.Email on the default client.
func Email(serviceAccount string) (string, error) { return defaultClient.Email(serviceAccount) }
// ExternalIPWithContext returns the instance's primary external (public) IP address.
func ExternalIPWithContext(ctx context.Context) (string, error) {
return defaultClient.ExternalIPWithContext(ctx)
}
// Email calls Client.EmailWithContext on the default client.
//
// Deprecated: Please use the context aware variant [EmailWithContext].
func Email(serviceAccount string) (string, error) {
return defaultClient.EmailWithContext(context.Background(), serviceAccount)
}
// EmailWithContext calls Client.EmailWithContext on the default client.
func EmailWithContext(ctx context.Context, serviceAccount string) (string, error) {
return defaultClient.EmailWithContext(ctx, serviceAccount)
}
// Hostname returns the instance's hostname. This will be of the form
// "<instanceID>.c.<projID>.internal".
func Hostname() (string, error) { return defaultClient.Hostname() }
//
// Deprecated: Please use the context aware variant [HostnameWithContext].
func Hostname() (string, error) {
return defaultClient.HostnameWithContext(context.Background())
}
// HostnameWithContext returns the instance's hostname. This will be of the form
// "<instanceID>.c.<projID>.internal".
func HostnameWithContext(ctx context.Context) (string, error) {
return defaultClient.HostnameWithContext(ctx)
}
// InstanceTags returns the list of user-defined instance tags,
// assigned when initially creating a GCE instance.
func InstanceTags() ([]string, error) { return defaultClient.InstanceTags() }
//
// Deprecated: Please use the context aware variant [InstanceTagsWithContext].
func InstanceTags() ([]string, error) {
return defaultClient.InstanceTagsWithContext(context.Background())
}
// InstanceTagsWithContext returns the list of user-defined instance tags,
// assigned when initially creating a GCE instance.
func InstanceTagsWithContext(ctx context.Context) ([]string, error) {
return defaultClient.InstanceTagsWithContext(ctx)
}
// InstanceID returns the current VM's numeric instance ID.
func InstanceID() (string, error) { return defaultClient.InstanceID() }
//
// Deprecated: Please use the context aware variant [InstanceIDWithContext].
func InstanceID() (string, error) {
return defaultClient.InstanceIDWithContext(context.Background())
}
// InstanceIDWithContext returns the current VM's numeric instance ID.
func InstanceIDWithContext(ctx context.Context) (string, error) {
return defaultClient.InstanceIDWithContext(ctx)
}
// InstanceName returns the current VM's instance ID string.
func InstanceName() (string, error) { return defaultClient.InstanceName() }
//
// Deprecated: Please use the context aware variant [InstanceNameWithContext].
func InstanceName() (string, error) {
return defaultClient.InstanceNameWithContext(context.Background())
}
// InstanceNameWithContext returns the current VM's instance ID string.
func InstanceNameWithContext(ctx context.Context) (string, error) {
return defaultClient.InstanceNameWithContext(ctx)
}
// Zone returns the current VM's zone, such as "us-central1-b".
func Zone() (string, error) { return defaultClient.Zone() }
//
// Deprecated: Please use the context aware variant [ZoneWithContext].
func Zone() (string, error) {
return defaultClient.ZoneWithContext(context.Background())
}
// InstanceAttributes calls Client.InstanceAttributes on the default client.
func InstanceAttributes() ([]string, error) { return defaultClient.InstanceAttributes() }
// ZoneWithContext returns the current VM's zone, such as "us-central1-b".
func ZoneWithContext(ctx context.Context) (string, error) {
return defaultClient.ZoneWithContext(ctx)
}
// ProjectAttributes calls Client.ProjectAttributes on the default client.
func ProjectAttributes() ([]string, error) { return defaultClient.ProjectAttributes() }
// InstanceAttributes calls Client.InstanceAttributesWithContext on the default client.
//
// Deprecated: Please use the context aware variant [InstanceAttributesWithContext.
func InstanceAttributes() ([]string, error) {
return defaultClient.InstanceAttributesWithContext(context.Background())
}
// InstanceAttributeValue calls Client.InstanceAttributeValue on the default client.
// InstanceAttributesWithContext calls Client.ProjectAttributesWithContext on the default client.
func InstanceAttributesWithContext(ctx context.Context) ([]string, error) {
return defaultClient.InstanceAttributesWithContext(ctx)
}
// ProjectAttributes calls Client.ProjectAttributesWithContext on the default client.
//
// Deprecated: Please use the context aware variant [ProjectAttributesWithContext].
func ProjectAttributes() ([]string, error) {
return defaultClient.ProjectAttributesWithContext(context.Background())
}
// ProjectAttributesWithContext calls Client.ProjectAttributesWithContext on the default client.
func ProjectAttributesWithContext(ctx context.Context) ([]string, error) {
return defaultClient.ProjectAttributesWithContext(ctx)
}
// InstanceAttributeValue calls Client.InstanceAttributeValueWithContext on the default client.
//
// Deprecated: Please use the context aware variant [InstanceAttributeValueWithContext].
func InstanceAttributeValue(attr string) (string, error) {
return defaultClient.InstanceAttributeValue(attr)
return defaultClient.InstanceAttributeValueWithContext(context.Background(), attr)
}
// ProjectAttributeValue calls Client.ProjectAttributeValue on the default client.
// InstanceAttributeValueWithContext calls Client.InstanceAttributeValueWithContext on the default client.
func InstanceAttributeValueWithContext(ctx context.Context, attr string) (string, error) {
return defaultClient.InstanceAttributeValueWithContext(ctx, attr)
}
// ProjectAttributeValue calls Client.ProjectAttributeValueWithContext on the default client.
//
// Deprecated: Please use the context aware variant [ProjectAttributeValueWithContext].
func ProjectAttributeValue(attr string) (string, error) {
return defaultClient.ProjectAttributeValue(attr)
return defaultClient.ProjectAttributeValueWithContext(context.Background(), attr)
}
// Scopes calls Client.Scopes on the default client.
func Scopes(serviceAccount string) ([]string, error) { return defaultClient.Scopes(serviceAccount) }
// ProjectAttributeValueWithContext calls Client.ProjectAttributeValueWithContext on the default client.
func ProjectAttributeValueWithContext(ctx context.Context, attr string) (string, error) {
return defaultClient.ProjectAttributeValueWithContext(ctx, attr)
}
// Scopes calls Client.ScopesWithContext on the default client.
//
// Deprecated: Please use the context aware variant [ScopesWithContext].
func Scopes(serviceAccount string) ([]string, error) {
return defaultClient.ScopesWithContext(context.Background(), serviceAccount)
}
// ScopesWithContext calls Client.ScopesWithContext on the default client.
func ScopesWithContext(ctx context.Context, serviceAccount string) ([]string, error) {
return defaultClient.ScopesWithContext(ctx, serviceAccount)
}
func strsContains(ss []string, s string) bool {
for _, v := range ss {
@@ -296,7 +418,6 @@ func NewClient(c *http.Client) *Client {
if c == nil {
return defaultClient
}
return &Client{hc: c}
}
@@ -381,6 +502,10 @@ func (c *Client) Get(suffix string) (string, error) {
//
// If the requested metadata is not defined, the returned error will
// be of type NotDefinedError.
//
// NOTE: Without an extra deadline in the context this call can take in the
// worst case, with internal backoff retries, up to 15 seconds (e.g. when server
// is responding slowly). Pass context with additional timeouts when needed.
func (c *Client) GetWithContext(ctx context.Context, suffix string) (string, error) {
val, _, err := c.getETag(ctx, suffix)
return val, err
@@ -392,8 +517,8 @@ func (c *Client) getTrimmed(ctx context.Context, suffix string) (s string, err e
return
}
func (c *Client) lines(suffix string) ([]string, error) {
j, err := c.GetWithContext(context.Background(), suffix)
func (c *Client) lines(ctx context.Context, suffix string) ([]string, error) {
j, err := c.GetWithContext(ctx, suffix)
if err != nil {
return nil, err
}
@@ -405,45 +530,104 @@ func (c *Client) lines(suffix string) ([]string, error) {
}
// ProjectID returns the current instance's project ID string.
func (c *Client) ProjectID() (string, error) { return projID.get(c) }
//
// Deprecated: Please use the context aware variant [Client.ProjectIDWithContext].
func (c *Client) ProjectID() (string, error) { return c.ProjectIDWithContext(context.Background()) }
// ProjectIDWithContext returns the current instance's project ID string.
func (c *Client) ProjectIDWithContext(ctx context.Context) (string, error) { return projID.get(ctx, c) }
// NumericProjectID returns the current instance's numeric project ID.
func (c *Client) NumericProjectID() (string, error) { return projNum.get(c) }
//
// Deprecated: Please use the context aware variant [Client.NumericProjectIDWithContext].
func (c *Client) NumericProjectID() (string, error) {
return c.NumericProjectIDWithContext(context.Background())
}
// NumericProjectIDWithContext returns the current instance's numeric project ID.
func (c *Client) NumericProjectIDWithContext(ctx context.Context) (string, error) {
return projNum.get(ctx, c)
}
// InstanceID returns the current VM's numeric instance ID.
func (c *Client) InstanceID() (string, error) { return instID.get(c) }
//
// Deprecated: Please use the context aware variant [Client.InstanceIDWithContext].
func (c *Client) InstanceID() (string, error) {
return c.InstanceIDWithContext(context.Background())
}
// InstanceIDWithContext returns the current VM's numeric instance ID.
func (c *Client) InstanceIDWithContext(ctx context.Context) (string, error) {
return instID.get(ctx, c)
}
// InternalIP returns the instance's primary internal IP address.
//
// Deprecated: Please use the context aware variant [Client.InternalIPWithContext].
func (c *Client) InternalIP() (string, error) {
return c.getTrimmed(context.Background(), "instance/network-interfaces/0/ip")
return c.InternalIPWithContext(context.Background())
}
// InternalIPWithContext returns the instance's primary internal IP address.
func (c *Client) InternalIPWithContext(ctx context.Context) (string, error) {
return c.getTrimmed(ctx, "instance/network-interfaces/0/ip")
}
// Email returns the email address associated with the service account.
// The account may be empty or the string "default" to use the instance's
// main account.
//
// Deprecated: Please use the context aware variant [Client.EmailWithContext].
func (c *Client) Email(serviceAccount string) (string, error) {
return c.EmailWithContext(context.Background(), serviceAccount)
}
// EmailWithContext returns the email address associated with the service account.
// The serviceAccount parameter default value (empty string or "default" value)
// will use the instance's main account.
func (c *Client) EmailWithContext(ctx context.Context, serviceAccount string) (string, error) {
if serviceAccount == "" {
serviceAccount = "default"
}
return c.getTrimmed(context.Background(), "instance/service-accounts/"+serviceAccount+"/email")
return c.getTrimmed(ctx, "instance/service-accounts/"+serviceAccount+"/email")
}
// ExternalIP returns the instance's primary external (public) IP address.
//
// Deprecated: Please use the context aware variant [Client.ExternalIPWithContext].
func (c *Client) ExternalIP() (string, error) {
return c.getTrimmed(context.Background(), "instance/network-interfaces/0/access-configs/0/external-ip")
return c.ExternalIPWithContext(context.Background())
}
// ExternalIPWithContext returns the instance's primary external (public) IP address.
func (c *Client) ExternalIPWithContext(ctx context.Context) (string, error) {
return c.getTrimmed(ctx, "instance/network-interfaces/0/access-configs/0/external-ip")
}
// Hostname returns the instance's hostname. This will be of the form
// "<instanceID>.c.<projID>.internal".
//
// Deprecated: Please use the context aware variant [Client.HostnameWithContext].
func (c *Client) Hostname() (string, error) {
return c.getTrimmed(context.Background(), "instance/hostname")
return c.HostnameWithContext(context.Background())
}
// InstanceTags returns the list of user-defined instance tags,
// assigned when initially creating a GCE instance.
// HostnameWithContext returns the instance's hostname. This will be of the form
// "<instanceID>.c.<projID>.internal".
func (c *Client) HostnameWithContext(ctx context.Context) (string, error) {
return c.getTrimmed(ctx, "instance/hostname")
}
// InstanceTags returns the list of user-defined instance tags.
//
// Deprecated: Please use the context aware variant [Client.InstanceTagsWithContext].
func (c *Client) InstanceTags() ([]string, error) {
return c.InstanceTagsWithContext(context.Background())
}
// InstanceTagsWithContext returns the list of user-defined instance tags,
// assigned when initially creating a GCE instance.
func (c *Client) InstanceTagsWithContext(ctx context.Context) ([]string, error) {
var s []string
j, err := c.GetWithContext(context.Background(), "instance/tags")
j, err := c.GetWithContext(ctx, "instance/tags")
if err != nil {
return nil, err
}
@@ -454,13 +638,27 @@ func (c *Client) InstanceTags() ([]string, error) {
}
// InstanceName returns the current VM's instance ID string.
//
// Deprecated: Please use the context aware variant [Client.InstanceNameWithContext].
func (c *Client) InstanceName() (string, error) {
return c.getTrimmed(context.Background(), "instance/name")
return c.InstanceNameWithContext(context.Background())
}
// InstanceNameWithContext returns the current VM's instance ID string.
func (c *Client) InstanceNameWithContext(ctx context.Context) (string, error) {
return c.getTrimmed(ctx, "instance/name")
}
// Zone returns the current VM's zone, such as "us-central1-b".
//
// Deprecated: Please use the context aware variant [Client.ZoneWithContext].
func (c *Client) Zone() (string, error) {
zone, err := c.getTrimmed(context.Background(), "instance/zone")
return c.ZoneWithContext(context.Background())
}
// ZoneWithContext returns the current VM's zone, such as "us-central1-b".
func (c *Client) ZoneWithContext(ctx context.Context) (string, error) {
zone, err := c.getTrimmed(ctx, "instance/zone")
// zone is of the form "projects/<projNum>/zones/<zoneName>".
if err != nil {
return "", err
@@ -471,12 +669,34 @@ func (c *Client) Zone() (string, error) {
// InstanceAttributes returns the list of user-defined attributes,
// assigned when initially creating a GCE VM instance. The value of an
// attribute can be obtained with InstanceAttributeValue.
func (c *Client) InstanceAttributes() ([]string, error) { return c.lines("instance/attributes/") }
//
// Deprecated: Please use the context aware variant [Client.InstanceAttributesWithContext].
func (c *Client) InstanceAttributes() ([]string, error) {
return c.InstanceAttributesWithContext(context.Background())
}
// InstanceAttributesWithContext returns the list of user-defined attributes,
// assigned when initially creating a GCE VM instance. The value of an
// attribute can be obtained with InstanceAttributeValue.
func (c *Client) InstanceAttributesWithContext(ctx context.Context) ([]string, error) {
return c.lines(ctx, "instance/attributes/")
}
// ProjectAttributes returns the list of user-defined attributes
// applying to the project as a whole, not just this VM. The value of
// an attribute can be obtained with ProjectAttributeValue.
func (c *Client) ProjectAttributes() ([]string, error) { return c.lines("project/attributes/") }
//
// Deprecated: Please use the context aware variant [Client.ProjectAttributesWithContext].
func (c *Client) ProjectAttributes() ([]string, error) {
return c.ProjectAttributesWithContext(context.Background())
}
// ProjectAttributesWithContext returns the list of user-defined attributes
// applying to the project as a whole, not just this VM. The value of
// an attribute can be obtained with ProjectAttributeValue.
func (c *Client) ProjectAttributesWithContext(ctx context.Context) ([]string, error) {
return c.lines(ctx, "project/attributes/")
}
// InstanceAttributeValue returns the value of the provided VM
// instance attribute.
@@ -486,8 +706,22 @@ func (c *Client) ProjectAttributes() ([]string, error) { return c.lines("project
//
// InstanceAttributeValue may return ("", nil) if the attribute was
// defined to be the empty string.
//
// Deprecated: Please use the context aware variant [Client.InstanceAttributeValueWithContext].
func (c *Client) InstanceAttributeValue(attr string) (string, error) {
return c.GetWithContext(context.Background(), "instance/attributes/"+attr)
return c.InstanceAttributeValueWithContext(context.Background(), attr)
}
// InstanceAttributeValueWithContext returns the value of the provided VM
// instance attribute.
//
// If the requested attribute is not defined, the returned error will
// be of type NotDefinedError.
//
// InstanceAttributeValue may return ("", nil) if the attribute was
// defined to be the empty string.
func (c *Client) InstanceAttributeValueWithContext(ctx context.Context, attr string) (string, error) {
return c.GetWithContext(ctx, "instance/attributes/"+attr)
}
// ProjectAttributeValue returns the value of the provided
@@ -498,18 +732,41 @@ func (c *Client) InstanceAttributeValue(attr string) (string, error) {
//
// ProjectAttributeValue may return ("", nil) if the attribute was
// defined to be the empty string.
//
// Deprecated: Please use the context aware variant [Client.ProjectAttributeValueWithContext].
func (c *Client) ProjectAttributeValue(attr string) (string, error) {
return c.GetWithContext(context.Background(), "project/attributes/"+attr)
return c.ProjectAttributeValueWithContext(context.Background(), attr)
}
// ProjectAttributeValueWithContext returns the value of the provided
// project attribute.
//
// If the requested attribute is not defined, the returned error will
// be of type NotDefinedError.
//
// ProjectAttributeValue may return ("", nil) if the attribute was
// defined to be the empty string.
func (c *Client) ProjectAttributeValueWithContext(ctx context.Context, attr string) (string, error) {
return c.GetWithContext(ctx, "project/attributes/"+attr)
}
// Scopes returns the service account scopes for the given account.
// The account may be empty or the string "default" to use the instance's
// main account.
//
// Deprecated: Please use the context aware variant [Client.ScopesWithContext].
func (c *Client) Scopes(serviceAccount string) ([]string, error) {
return c.ScopesWithContext(context.Background(), serviceAccount)
}
// ScopesWithContext returns the service account scopes for the given account.
// The account may be empty or the string "default" to use the instance's
// main account.
func (c *Client) ScopesWithContext(ctx context.Context, serviceAccount string) ([]string, error) {
if serviceAccount == "" {
serviceAccount = "default"
}
return c.lines("instance/service-accounts/" + serviceAccount + "/scopes")
return c.lines(ctx, "instance/service-accounts/"+serviceAccount+"/scopes")
}
// Subscribe subscribes to a value from the metadata service.
+26
View File
@@ -0,0 +1,26 @@
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !windows && !linux
package metadata
// systemInfoSuggestsGCE reports whether the local system (without
// doing network requests) suggests that we're running on GCE. If this
// returns true, testOnGCE tries a bit harder to reach its metadata
// server.
func systemInfoSuggestsGCE() bool {
// We don't currently have checks for other GOOS
return false
}
+28
View File
@@ -0,0 +1,28 @@
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build linux
package metadata
import (
"os"
"strings"
)
func systemInfoSuggestsGCE() bool {
b, _ := os.ReadFile("/sys/class/dmi/id/product_name")
name := strings.TrimSpace(string(b))
return name == "Google" || name == "Google Compute Engine"
}
+38
View File
@@ -0,0 +1,38 @@
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build windows
package metadata
import (
"strings"
"golang.org/x/sys/windows/registry"
)
func systemInfoSuggestsGCE() bool {
k, err := registry.OpenKey(registry.LOCAL_MACHINE, `SYSTEM\HardwareConfig\Current`, registry.QUERY_VALUE)
if err != nil {
return false
}
defer k.Close()
s, _, err := k.GetStringValue("SystemProductName")
if err != nil {
return false
}
s = strings.TrimSpace(s)
return strings.HasPrefix(s, "Google")
}
+4 -1
View File
@@ -54,6 +54,7 @@ func defaultAlertPolicyGRPCClientOptions() []option.ClientOption {
internaloption.WithDefaultAudience("https://monitoring.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
internaloption.EnableJwtWithScope(),
internaloption.EnableNewAuthLibrary(),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
}
@@ -272,7 +273,9 @@ func (c *alertPolicyGRPCClient) Connection() *grpc.ClientConn {
func (c *alertPolicyGRPCClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version)
c.xGoogHeaders = []string{"x-goog-api-client", gax.XGoogHeader(kv...)}
c.xGoogHeaders = []string{
"x-goog-api-client", gax.XGoogHeader(kv...),
}
}
// Close closes the connection to the API service. The user should invoke this when
+4 -1
View File
@@ -56,6 +56,7 @@ func defaultGroupGRPCClientOptions() []option.ClientOption {
internaloption.WithDefaultAudience("https://monitoring.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
internaloption.EnableJwtWithScope(),
internaloption.EnableNewAuthLibrary(),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
}
@@ -293,7 +294,9 @@ func (c *groupGRPCClient) Connection() *grpc.ClientConn {
func (c *groupGRPCClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version)
c.xGoogHeaders = []string{"x-goog-api-client", gax.XGoogHeader(kv...)}
c.xGoogHeaders = []string{
"x-goog-api-client", gax.XGoogHeader(kv...),
}
}
// Close closes the connection to the API service. The user should invoke this when
+4 -1
View File
@@ -60,6 +60,7 @@ func defaultMetricGRPCClientOptions() []option.ClientOption {
internaloption.WithDefaultAudience("https://monitoring.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
internaloption.EnableJwtWithScope(),
internaloption.EnableNewAuthLibrary(),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
}
@@ -331,7 +332,9 @@ func (c *metricGRPCClient) Connection() *grpc.ClientConn {
func (c *metricGRPCClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version)
c.xGoogHeaders = []string{"x-goog-api-client", gax.XGoogHeader(kv...)}
c.xGoogHeaders = []string{
"x-goog-api-client", gax.XGoogHeader(kv...),
}
}
// Close closes the connection to the API service. The user should invoke this when
File diff suppressed because it is too large Load Diff
@@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.33.0
// protoc-gen-go v1.34.2
// protoc v4.25.3
// source: google/monitoring/v3/alert_service.proto
@@ -647,7 +647,7 @@ func file_google_monitoring_v3_alert_service_proto_rawDescGZIP() []byte {
}
var file_google_monitoring_v3_alert_service_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_google_monitoring_v3_alert_service_proto_goTypes = []interface{}{
var file_google_monitoring_v3_alert_service_proto_goTypes = []any{
(*CreateAlertPolicyRequest)(nil), // 0: google.monitoring.v3.CreateAlertPolicyRequest
(*GetAlertPolicyRequest)(nil), // 1: google.monitoring.v3.GetAlertPolicyRequest
(*ListAlertPoliciesRequest)(nil), // 2: google.monitoring.v3.ListAlertPoliciesRequest
@@ -687,7 +687,7 @@ func file_google_monitoring_v3_alert_service_proto_init() {
}
file_google_monitoring_v3_alert_proto_init()
if !protoimpl.UnsafeEnabled {
file_google_monitoring_v3_alert_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_alert_service_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*CreateAlertPolicyRequest); i {
case 0:
return &v.state
@@ -699,7 +699,7 @@ func file_google_monitoring_v3_alert_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_alert_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_alert_service_proto_msgTypes[1].Exporter = func(v any, i int) any {
switch v := v.(*GetAlertPolicyRequest); i {
case 0:
return &v.state
@@ -711,7 +711,7 @@ func file_google_monitoring_v3_alert_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_alert_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_alert_service_proto_msgTypes[2].Exporter = func(v any, i int) any {
switch v := v.(*ListAlertPoliciesRequest); i {
case 0:
return &v.state
@@ -723,7 +723,7 @@ func file_google_monitoring_v3_alert_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_alert_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_alert_service_proto_msgTypes[3].Exporter = func(v any, i int) any {
switch v := v.(*ListAlertPoliciesResponse); i {
case 0:
return &v.state
@@ -735,7 +735,7 @@ func file_google_monitoring_v3_alert_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_alert_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_alert_service_proto_msgTypes[4].Exporter = func(v any, i int) any {
switch v := v.(*UpdateAlertPolicyRequest); i {
case 0:
return &v.state
@@ -747,7 +747,7 @@ func file_google_monitoring_v3_alert_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_alert_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_alert_service_proto_msgTypes[5].Exporter = func(v any, i int) any {
switch v := v.(*DeleteAlertPolicyRequest); i {
case 0:
return &v.state
+7 -7
View File
@@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.33.0
// protoc-gen-go v1.34.2
// protoc v4.25.3
// source: google/monitoring/v3/common.proto
@@ -1067,7 +1067,7 @@ func file_google_monitoring_v3_common_proto_rawDescGZIP() []byte {
var file_google_monitoring_v3_common_proto_enumTypes = make([]protoimpl.EnumInfo, 4)
var file_google_monitoring_v3_common_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_google_monitoring_v3_common_proto_goTypes = []interface{}{
var file_google_monitoring_v3_common_proto_goTypes = []any{
(ComparisonType)(0), // 0: google.monitoring.v3.ComparisonType
(ServiceTier)(0), // 1: google.monitoring.v3.ServiceTier
(Aggregation_Aligner)(0), // 2: google.monitoring.v3.Aggregation.Aligner
@@ -1099,7 +1099,7 @@ func file_google_monitoring_v3_common_proto_init() {
return
}
if !protoimpl.UnsafeEnabled {
file_google_monitoring_v3_common_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_common_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*TypedValue); i {
case 0:
return &v.state
@@ -1111,7 +1111,7 @@ func file_google_monitoring_v3_common_proto_init() {
return nil
}
}
file_google_monitoring_v3_common_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_common_proto_msgTypes[1].Exporter = func(v any, i int) any {
switch v := v.(*TimeInterval); i {
case 0:
return &v.state
@@ -1123,7 +1123,7 @@ func file_google_monitoring_v3_common_proto_init() {
return nil
}
}
file_google_monitoring_v3_common_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_common_proto_msgTypes[2].Exporter = func(v any, i int) any {
switch v := v.(*Aggregation); i {
case 0:
return &v.state
@@ -1136,7 +1136,7 @@ func file_google_monitoring_v3_common_proto_init() {
}
}
}
file_google_monitoring_v3_common_proto_msgTypes[0].OneofWrappers = []interface{}{
file_google_monitoring_v3_common_proto_msgTypes[0].OneofWrappers = []any{
(*TypedValue_BoolValue)(nil),
(*TypedValue_Int64Value)(nil),
(*TypedValue_DoubleValue)(nil),
@@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.33.0
// protoc-gen-go v1.34.2
// protoc v4.25.3
// source: google/monitoring/v3/dropped_labels.proto
@@ -144,7 +144,7 @@ func file_google_monitoring_v3_dropped_labels_proto_rawDescGZIP() []byte {
}
var file_google_monitoring_v3_dropped_labels_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_google_monitoring_v3_dropped_labels_proto_goTypes = []interface{}{
var file_google_monitoring_v3_dropped_labels_proto_goTypes = []any{
(*DroppedLabels)(nil), // 0: google.monitoring.v3.DroppedLabels
nil, // 1: google.monitoring.v3.DroppedLabels.LabelEntry
}
@@ -163,7 +163,7 @@ func file_google_monitoring_v3_dropped_labels_proto_init() {
return
}
if !protoimpl.UnsafeEnabled {
file_google_monitoring_v3_dropped_labels_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_dropped_labels_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*DroppedLabels); i {
case 0:
return &v.state
+4 -4
View File
@@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.33.0
// protoc-gen-go v1.34.2
// protoc v4.25.3
// source: google/monitoring/v3/group.proto
@@ -214,7 +214,7 @@ func file_google_monitoring_v3_group_proto_rawDescGZIP() []byte {
}
var file_google_monitoring_v3_group_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_google_monitoring_v3_group_proto_goTypes = []interface{}{
var file_google_monitoring_v3_group_proto_goTypes = []any{
(*Group)(nil), // 0: google.monitoring.v3.Group
}
var file_google_monitoring_v3_group_proto_depIdxs = []int32{
@@ -231,7 +231,7 @@ func file_google_monitoring_v3_group_proto_init() {
return
}
if !protoimpl.UnsafeEnabled {
file_google_monitoring_v3_group_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_group_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*Group); i {
case 0:
return &v.state
@@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.33.0
// protoc-gen-go v1.34.2
// protoc v4.25.3
// source: google/monitoring/v3/group_service.proto
@@ -875,7 +875,7 @@ func file_google_monitoring_v3_group_service_proto_rawDescGZIP() []byte {
}
var file_google_monitoring_v3_group_service_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
var file_google_monitoring_v3_group_service_proto_goTypes = []interface{}{
var file_google_monitoring_v3_group_service_proto_goTypes = []any{
(*ListGroupsRequest)(nil), // 0: google.monitoring.v3.ListGroupsRequest
(*ListGroupsResponse)(nil), // 1: google.monitoring.v3.ListGroupsResponse
(*GetGroupRequest)(nil), // 2: google.monitoring.v3.GetGroupRequest
@@ -922,7 +922,7 @@ func file_google_monitoring_v3_group_service_proto_init() {
file_google_monitoring_v3_common_proto_init()
file_google_monitoring_v3_group_proto_init()
if !protoimpl.UnsafeEnabled {
file_google_monitoring_v3_group_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_group_service_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*ListGroupsRequest); i {
case 0:
return &v.state
@@ -934,7 +934,7 @@ func file_google_monitoring_v3_group_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_group_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_group_service_proto_msgTypes[1].Exporter = func(v any, i int) any {
switch v := v.(*ListGroupsResponse); i {
case 0:
return &v.state
@@ -946,7 +946,7 @@ func file_google_monitoring_v3_group_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_group_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_group_service_proto_msgTypes[2].Exporter = func(v any, i int) any {
switch v := v.(*GetGroupRequest); i {
case 0:
return &v.state
@@ -958,7 +958,7 @@ func file_google_monitoring_v3_group_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_group_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_group_service_proto_msgTypes[3].Exporter = func(v any, i int) any {
switch v := v.(*CreateGroupRequest); i {
case 0:
return &v.state
@@ -970,7 +970,7 @@ func file_google_monitoring_v3_group_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_group_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_group_service_proto_msgTypes[4].Exporter = func(v any, i int) any {
switch v := v.(*UpdateGroupRequest); i {
case 0:
return &v.state
@@ -982,7 +982,7 @@ func file_google_monitoring_v3_group_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_group_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_group_service_proto_msgTypes[5].Exporter = func(v any, i int) any {
switch v := v.(*DeleteGroupRequest); i {
case 0:
return &v.state
@@ -994,7 +994,7 @@ func file_google_monitoring_v3_group_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_group_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_group_service_proto_msgTypes[6].Exporter = func(v any, i int) any {
switch v := v.(*ListGroupMembersRequest); i {
case 0:
return &v.state
@@ -1006,7 +1006,7 @@ func file_google_monitoring_v3_group_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_group_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_group_service_proto_msgTypes[7].Exporter = func(v any, i int) any {
switch v := v.(*ListGroupMembersResponse); i {
case 0:
return &v.state
@@ -1019,7 +1019,7 @@ func file_google_monitoring_v3_group_service_proto_init() {
}
}
}
file_google_monitoring_v3_group_service_proto_msgTypes[0].OneofWrappers = []interface{}{
file_google_monitoring_v3_group_service_proto_msgTypes[0].OneofWrappers = []any{
(*ListGroupsRequest_ChildrenOfGroup)(nil),
(*ListGroupsRequest_AncestorsOfGroup)(nil),
(*ListGroupsRequest_DescendantsOfGroup)(nil),
+14 -14
View File
@@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.33.0
// protoc-gen-go v1.34.2
// protoc v4.25.3
// source: google/monitoring/v3/metric.proto
@@ -992,7 +992,7 @@ func file_google_monitoring_v3_metric_proto_rawDescGZIP() []byte {
}
var file_google_monitoring_v3_metric_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
var file_google_monitoring_v3_metric_proto_goTypes = []interface{}{
var file_google_monitoring_v3_metric_proto_goTypes = []any{
(*Point)(nil), // 0: google.monitoring.v3.Point
(*TimeSeries)(nil), // 1: google.monitoring.v3.TimeSeries
(*TimeSeriesDescriptor)(nil), // 2: google.monitoring.v3.TimeSeriesDescriptor
@@ -1047,7 +1047,7 @@ func file_google_monitoring_v3_metric_proto_init() {
}
file_google_monitoring_v3_common_proto_init()
if !protoimpl.UnsafeEnabled {
file_google_monitoring_v3_metric_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_metric_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*Point); i {
case 0:
return &v.state
@@ -1059,7 +1059,7 @@ func file_google_monitoring_v3_metric_proto_init() {
return nil
}
}
file_google_monitoring_v3_metric_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_metric_proto_msgTypes[1].Exporter = func(v any, i int) any {
switch v := v.(*TimeSeries); i {
case 0:
return &v.state
@@ -1071,7 +1071,7 @@ func file_google_monitoring_v3_metric_proto_init() {
return nil
}
}
file_google_monitoring_v3_metric_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_metric_proto_msgTypes[2].Exporter = func(v any, i int) any {
switch v := v.(*TimeSeriesDescriptor); i {
case 0:
return &v.state
@@ -1083,7 +1083,7 @@ func file_google_monitoring_v3_metric_proto_init() {
return nil
}
}
file_google_monitoring_v3_metric_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_metric_proto_msgTypes[3].Exporter = func(v any, i int) any {
switch v := v.(*TimeSeriesData); i {
case 0:
return &v.state
@@ -1095,7 +1095,7 @@ func file_google_monitoring_v3_metric_proto_init() {
return nil
}
}
file_google_monitoring_v3_metric_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_metric_proto_msgTypes[4].Exporter = func(v any, i int) any {
switch v := v.(*LabelValue); i {
case 0:
return &v.state
@@ -1107,7 +1107,7 @@ func file_google_monitoring_v3_metric_proto_init() {
return nil
}
}
file_google_monitoring_v3_metric_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_metric_proto_msgTypes[5].Exporter = func(v any, i int) any {
switch v := v.(*QueryError); i {
case 0:
return &v.state
@@ -1119,7 +1119,7 @@ func file_google_monitoring_v3_metric_proto_init() {
return nil
}
}
file_google_monitoring_v3_metric_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_metric_proto_msgTypes[6].Exporter = func(v any, i int) any {
switch v := v.(*TextLocator); i {
case 0:
return &v.state
@@ -1131,7 +1131,7 @@ func file_google_monitoring_v3_metric_proto_init() {
return nil
}
}
file_google_monitoring_v3_metric_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_metric_proto_msgTypes[7].Exporter = func(v any, i int) any {
switch v := v.(*TimeSeriesDescriptor_ValueDescriptor); i {
case 0:
return &v.state
@@ -1143,7 +1143,7 @@ func file_google_monitoring_v3_metric_proto_init() {
return nil
}
}
file_google_monitoring_v3_metric_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_metric_proto_msgTypes[8].Exporter = func(v any, i int) any {
switch v := v.(*TimeSeriesData_PointData); i {
case 0:
return &v.state
@@ -1155,7 +1155,7 @@ func file_google_monitoring_v3_metric_proto_init() {
return nil
}
}
file_google_monitoring_v3_metric_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_metric_proto_msgTypes[9].Exporter = func(v any, i int) any {
switch v := v.(*TextLocator_Position); i {
case 0:
return &v.state
@@ -1168,7 +1168,7 @@ func file_google_monitoring_v3_metric_proto_init() {
}
}
}
file_google_monitoring_v3_metric_proto_msgTypes[4].OneofWrappers = []interface{}{
file_google_monitoring_v3_metric_proto_msgTypes[4].OneofWrappers = []any{
(*LabelValue_BoolValue)(nil),
(*LabelValue_Int64Value)(nil),
(*LabelValue_StringValue)(nil),
@@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.33.0
// protoc-gen-go v1.34.2
// protoc v4.25.3
// source: google/monitoring/v3/metric_service.proto
@@ -1765,7 +1765,7 @@ func file_google_monitoring_v3_metric_service_proto_rawDescGZIP() []byte {
var file_google_monitoring_v3_metric_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_google_monitoring_v3_metric_service_proto_msgTypes = make([]protoimpl.MessageInfo, 17)
var file_google_monitoring_v3_metric_service_proto_goTypes = []interface{}{
var file_google_monitoring_v3_metric_service_proto_goTypes = []any{
(ListTimeSeriesRequest_TimeSeriesView)(0), // 0: google.monitoring.v3.ListTimeSeriesRequest.TimeSeriesView
(*ListMonitoredResourceDescriptorsRequest)(nil), // 1: google.monitoring.v3.ListMonitoredResourceDescriptorsRequest
(*ListMonitoredResourceDescriptorsResponse)(nil), // 2: google.monitoring.v3.ListMonitoredResourceDescriptorsResponse
@@ -1847,7 +1847,7 @@ func file_google_monitoring_v3_metric_service_proto_init() {
file_google_monitoring_v3_common_proto_init()
file_google_monitoring_v3_metric_proto_init()
if !protoimpl.UnsafeEnabled {
file_google_monitoring_v3_metric_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_metric_service_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*ListMonitoredResourceDescriptorsRequest); i {
case 0:
return &v.state
@@ -1859,7 +1859,7 @@ func file_google_monitoring_v3_metric_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_metric_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_metric_service_proto_msgTypes[1].Exporter = func(v any, i int) any {
switch v := v.(*ListMonitoredResourceDescriptorsResponse); i {
case 0:
return &v.state
@@ -1871,7 +1871,7 @@ func file_google_monitoring_v3_metric_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_metric_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_metric_service_proto_msgTypes[2].Exporter = func(v any, i int) any {
switch v := v.(*GetMonitoredResourceDescriptorRequest); i {
case 0:
return &v.state
@@ -1883,7 +1883,7 @@ func file_google_monitoring_v3_metric_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_metric_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_metric_service_proto_msgTypes[3].Exporter = func(v any, i int) any {
switch v := v.(*ListMetricDescriptorsRequest); i {
case 0:
return &v.state
@@ -1895,7 +1895,7 @@ func file_google_monitoring_v3_metric_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_metric_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_metric_service_proto_msgTypes[4].Exporter = func(v any, i int) any {
switch v := v.(*ListMetricDescriptorsResponse); i {
case 0:
return &v.state
@@ -1907,7 +1907,7 @@ func file_google_monitoring_v3_metric_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_metric_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_metric_service_proto_msgTypes[5].Exporter = func(v any, i int) any {
switch v := v.(*GetMetricDescriptorRequest); i {
case 0:
return &v.state
@@ -1919,7 +1919,7 @@ func file_google_monitoring_v3_metric_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_metric_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_metric_service_proto_msgTypes[6].Exporter = func(v any, i int) any {
switch v := v.(*CreateMetricDescriptorRequest); i {
case 0:
return &v.state
@@ -1931,7 +1931,7 @@ func file_google_monitoring_v3_metric_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_metric_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_metric_service_proto_msgTypes[7].Exporter = func(v any, i int) any {
switch v := v.(*DeleteMetricDescriptorRequest); i {
case 0:
return &v.state
@@ -1943,7 +1943,7 @@ func file_google_monitoring_v3_metric_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_metric_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_metric_service_proto_msgTypes[8].Exporter = func(v any, i int) any {
switch v := v.(*ListTimeSeriesRequest); i {
case 0:
return &v.state
@@ -1955,7 +1955,7 @@ func file_google_monitoring_v3_metric_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_metric_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_metric_service_proto_msgTypes[9].Exporter = func(v any, i int) any {
switch v := v.(*ListTimeSeriesResponse); i {
case 0:
return &v.state
@@ -1967,7 +1967,7 @@ func file_google_monitoring_v3_metric_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_metric_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_metric_service_proto_msgTypes[10].Exporter = func(v any, i int) any {
switch v := v.(*CreateTimeSeriesRequest); i {
case 0:
return &v.state
@@ -1979,7 +1979,7 @@ func file_google_monitoring_v3_metric_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_metric_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_metric_service_proto_msgTypes[11].Exporter = func(v any, i int) any {
switch v := v.(*CreateTimeSeriesError); i {
case 0:
return &v.state
@@ -1991,7 +1991,7 @@ func file_google_monitoring_v3_metric_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_metric_service_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_metric_service_proto_msgTypes[12].Exporter = func(v any, i int) any {
switch v := v.(*CreateTimeSeriesSummary); i {
case 0:
return &v.state
@@ -2003,7 +2003,7 @@ func file_google_monitoring_v3_metric_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_metric_service_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_metric_service_proto_msgTypes[13].Exporter = func(v any, i int) any {
switch v := v.(*QueryTimeSeriesRequest); i {
case 0:
return &v.state
@@ -2015,7 +2015,7 @@ func file_google_monitoring_v3_metric_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_metric_service_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_metric_service_proto_msgTypes[14].Exporter = func(v any, i int) any {
switch v := v.(*QueryTimeSeriesResponse); i {
case 0:
return &v.state
@@ -2027,7 +2027,7 @@ func file_google_monitoring_v3_metric_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_metric_service_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_metric_service_proto_msgTypes[15].Exporter = func(v any, i int) any {
switch v := v.(*QueryErrorList); i {
case 0:
return &v.state
@@ -2039,7 +2039,7 @@ func file_google_monitoring_v3_metric_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_metric_service_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_metric_service_proto_msgTypes[16].Exporter = func(v any, i int) any {
switch v := v.(*CreateTimeSeriesSummary_Error); i {
case 0:
return &v.state
@@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.33.0
// protoc-gen-go v1.34.2
// protoc v4.25.3
// source: google/monitoring/v3/mutation_record.proto
@@ -139,7 +139,7 @@ func file_google_monitoring_v3_mutation_record_proto_rawDescGZIP() []byte {
}
var file_google_monitoring_v3_mutation_record_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_google_monitoring_v3_mutation_record_proto_goTypes = []interface{}{
var file_google_monitoring_v3_mutation_record_proto_goTypes = []any{
(*MutationRecord)(nil), // 0: google.monitoring.v3.MutationRecord
(*timestamppb.Timestamp)(nil), // 1: google.protobuf.Timestamp
}
@@ -158,7 +158,7 @@ func file_google_monitoring_v3_mutation_record_proto_init() {
return
}
if !protoimpl.UnsafeEnabled {
file_google_monitoring_v3_mutation_record_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_mutation_record_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*MutationRecord); i {
case 0:
return &v.state
@@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.33.0
// protoc-gen-go v1.34.2
// protoc v4.25.3
// source: google/monitoring/v3/notification.proto
@@ -563,7 +563,7 @@ func file_google_monitoring_v3_notification_proto_rawDescGZIP() []byte {
var file_google_monitoring_v3_notification_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_google_monitoring_v3_notification_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_google_monitoring_v3_notification_proto_goTypes = []interface{}{
var file_google_monitoring_v3_notification_proto_goTypes = []any{
(NotificationChannel_VerificationStatus)(0), // 0: google.monitoring.v3.NotificationChannel.VerificationStatus
(*NotificationChannelDescriptor)(nil), // 1: google.monitoring.v3.NotificationChannelDescriptor
(*NotificationChannel)(nil), // 2: google.monitoring.v3.NotificationChannel
@@ -600,7 +600,7 @@ func file_google_monitoring_v3_notification_proto_init() {
file_google_monitoring_v3_common_proto_init()
file_google_monitoring_v3_mutation_record_proto_init()
if !protoimpl.UnsafeEnabled {
file_google_monitoring_v3_notification_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_notification_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*NotificationChannelDescriptor); i {
case 0:
return &v.state
@@ -612,7 +612,7 @@ func file_google_monitoring_v3_notification_proto_init() {
return nil
}
}
file_google_monitoring_v3_notification_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_notification_proto_msgTypes[1].Exporter = func(v any, i int) any {
switch v := v.(*NotificationChannel); i {
case 0:
return &v.state
@@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.33.0
// protoc-gen-go v1.34.2
// protoc v4.25.3
// source: google/monitoring/v3/notification_service.proto
@@ -1242,7 +1242,7 @@ func file_google_monitoring_v3_notification_service_proto_rawDescGZIP() []byte {
}
var file_google_monitoring_v3_notification_service_proto_msgTypes = make([]protoimpl.MessageInfo, 13)
var file_google_monitoring_v3_notification_service_proto_goTypes = []interface{}{
var file_google_monitoring_v3_notification_service_proto_goTypes = []any{
(*ListNotificationChannelDescriptorsRequest)(nil), // 0: google.monitoring.v3.ListNotificationChannelDescriptorsRequest
(*ListNotificationChannelDescriptorsResponse)(nil), // 1: google.monitoring.v3.ListNotificationChannelDescriptorsResponse
(*GetNotificationChannelDescriptorRequest)(nil), // 2: google.monitoring.v3.GetNotificationChannelDescriptorRequest
@@ -1304,7 +1304,7 @@ func file_google_monitoring_v3_notification_service_proto_init() {
}
file_google_monitoring_v3_notification_proto_init()
if !protoimpl.UnsafeEnabled {
file_google_monitoring_v3_notification_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_notification_service_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*ListNotificationChannelDescriptorsRequest); i {
case 0:
return &v.state
@@ -1316,7 +1316,7 @@ func file_google_monitoring_v3_notification_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_notification_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_notification_service_proto_msgTypes[1].Exporter = func(v any, i int) any {
switch v := v.(*ListNotificationChannelDescriptorsResponse); i {
case 0:
return &v.state
@@ -1328,7 +1328,7 @@ func file_google_monitoring_v3_notification_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_notification_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_notification_service_proto_msgTypes[2].Exporter = func(v any, i int) any {
switch v := v.(*GetNotificationChannelDescriptorRequest); i {
case 0:
return &v.state
@@ -1340,7 +1340,7 @@ func file_google_monitoring_v3_notification_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_notification_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_notification_service_proto_msgTypes[3].Exporter = func(v any, i int) any {
switch v := v.(*CreateNotificationChannelRequest); i {
case 0:
return &v.state
@@ -1352,7 +1352,7 @@ func file_google_monitoring_v3_notification_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_notification_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_notification_service_proto_msgTypes[4].Exporter = func(v any, i int) any {
switch v := v.(*ListNotificationChannelsRequest); i {
case 0:
return &v.state
@@ -1364,7 +1364,7 @@ func file_google_monitoring_v3_notification_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_notification_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_notification_service_proto_msgTypes[5].Exporter = func(v any, i int) any {
switch v := v.(*ListNotificationChannelsResponse); i {
case 0:
return &v.state
@@ -1376,7 +1376,7 @@ func file_google_monitoring_v3_notification_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_notification_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_notification_service_proto_msgTypes[6].Exporter = func(v any, i int) any {
switch v := v.(*GetNotificationChannelRequest); i {
case 0:
return &v.state
@@ -1388,7 +1388,7 @@ func file_google_monitoring_v3_notification_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_notification_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_notification_service_proto_msgTypes[7].Exporter = func(v any, i int) any {
switch v := v.(*UpdateNotificationChannelRequest); i {
case 0:
return &v.state
@@ -1400,7 +1400,7 @@ func file_google_monitoring_v3_notification_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_notification_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_notification_service_proto_msgTypes[8].Exporter = func(v any, i int) any {
switch v := v.(*DeleteNotificationChannelRequest); i {
case 0:
return &v.state
@@ -1412,7 +1412,7 @@ func file_google_monitoring_v3_notification_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_notification_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_notification_service_proto_msgTypes[9].Exporter = func(v any, i int) any {
switch v := v.(*SendNotificationChannelVerificationCodeRequest); i {
case 0:
return &v.state
@@ -1424,7 +1424,7 @@ func file_google_monitoring_v3_notification_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_notification_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_notification_service_proto_msgTypes[10].Exporter = func(v any, i int) any {
switch v := v.(*GetNotificationChannelVerificationCodeRequest); i {
case 0:
return &v.state
@@ -1436,7 +1436,7 @@ func file_google_monitoring_v3_notification_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_notification_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_notification_service_proto_msgTypes[11].Exporter = func(v any, i int) any {
switch v := v.(*GetNotificationChannelVerificationCodeResponse); i {
case 0:
return &v.state
@@ -1448,7 +1448,7 @@ func file_google_monitoring_v3_notification_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_notification_service_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_notification_service_proto_msgTypes[12].Exporter = func(v any, i int) any {
switch v := v.(*VerifyNotificationChannelRequest); i {
case 0:
return &v.state
@@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.33.0
// protoc-gen-go v1.34.2
// protoc v4.25.3
// source: google/monitoring/v3/query_service.proto
@@ -90,7 +90,7 @@ var file_google_monitoring_v3_query_service_proto_rawDesc = []byte{
0x56, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var file_google_monitoring_v3_query_service_proto_goTypes = []interface{}{
var file_google_monitoring_v3_query_service_proto_goTypes = []any{
(*QueryTimeSeriesRequest)(nil), // 0: google.monitoring.v3.QueryTimeSeriesRequest
(*QueryTimeSeriesResponse)(nil), // 1: google.monitoring.v3.QueryTimeSeriesResponse
}
+35 -35
View File
@@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.33.0
// protoc-gen-go v1.34.2
// protoc v4.25.3
// source: google/monitoring/v3/service.proto
@@ -2664,7 +2664,7 @@ func file_google_monitoring_v3_service_proto_rawDescGZIP() []byte {
var file_google_monitoring_v3_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_google_monitoring_v3_service_proto_msgTypes = make([]protoimpl.MessageInfo, 28)
var file_google_monitoring_v3_service_proto_goTypes = []interface{}{
var file_google_monitoring_v3_service_proto_goTypes = []any{
(ServiceLevelObjective_View)(0), // 0: google.monitoring.v3.ServiceLevelObjective.View
(*Service)(nil), // 1: google.monitoring.v3.Service
(*ServiceLevelObjective)(nil), // 2: google.monitoring.v3.ServiceLevelObjective
@@ -2745,7 +2745,7 @@ func file_google_monitoring_v3_service_proto_init() {
return
}
if !protoimpl.UnsafeEnabled {
file_google_monitoring_v3_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_service_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*Service); i {
case 0:
return &v.state
@@ -2757,7 +2757,7 @@ func file_google_monitoring_v3_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_service_proto_msgTypes[1].Exporter = func(v any, i int) any {
switch v := v.(*ServiceLevelObjective); i {
case 0:
return &v.state
@@ -2769,7 +2769,7 @@ func file_google_monitoring_v3_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_service_proto_msgTypes[2].Exporter = func(v any, i int) any {
switch v := v.(*ServiceLevelIndicator); i {
case 0:
return &v.state
@@ -2781,7 +2781,7 @@ func file_google_monitoring_v3_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_service_proto_msgTypes[3].Exporter = func(v any, i int) any {
switch v := v.(*BasicSli); i {
case 0:
return &v.state
@@ -2793,7 +2793,7 @@ func file_google_monitoring_v3_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_service_proto_msgTypes[4].Exporter = func(v any, i int) any {
switch v := v.(*Range); i {
case 0:
return &v.state
@@ -2805,7 +2805,7 @@ func file_google_monitoring_v3_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_service_proto_msgTypes[5].Exporter = func(v any, i int) any {
switch v := v.(*RequestBasedSli); i {
case 0:
return &v.state
@@ -2817,7 +2817,7 @@ func file_google_monitoring_v3_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_service_proto_msgTypes[6].Exporter = func(v any, i int) any {
switch v := v.(*TimeSeriesRatio); i {
case 0:
return &v.state
@@ -2829,7 +2829,7 @@ func file_google_monitoring_v3_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_service_proto_msgTypes[7].Exporter = func(v any, i int) any {
switch v := v.(*DistributionCut); i {
case 0:
return &v.state
@@ -2841,7 +2841,7 @@ func file_google_monitoring_v3_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_service_proto_msgTypes[8].Exporter = func(v any, i int) any {
switch v := v.(*WindowsBasedSli); i {
case 0:
return &v.state
@@ -2853,7 +2853,7 @@ func file_google_monitoring_v3_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_service_proto_msgTypes[9].Exporter = func(v any, i int) any {
switch v := v.(*Service_Custom); i {
case 0:
return &v.state
@@ -2865,7 +2865,7 @@ func file_google_monitoring_v3_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_service_proto_msgTypes[10].Exporter = func(v any, i int) any {
switch v := v.(*Service_AppEngine); i {
case 0:
return &v.state
@@ -2877,7 +2877,7 @@ func file_google_monitoring_v3_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_service_proto_msgTypes[11].Exporter = func(v any, i int) any {
switch v := v.(*Service_CloudEndpoints); i {
case 0:
return &v.state
@@ -2889,7 +2889,7 @@ func file_google_monitoring_v3_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_service_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_service_proto_msgTypes[12].Exporter = func(v any, i int) any {
switch v := v.(*Service_ClusterIstio); i {
case 0:
return &v.state
@@ -2901,7 +2901,7 @@ func file_google_monitoring_v3_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_service_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_service_proto_msgTypes[13].Exporter = func(v any, i int) any {
switch v := v.(*Service_MeshIstio); i {
case 0:
return &v.state
@@ -2913,7 +2913,7 @@ func file_google_monitoring_v3_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_service_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_service_proto_msgTypes[14].Exporter = func(v any, i int) any {
switch v := v.(*Service_IstioCanonicalService); i {
case 0:
return &v.state
@@ -2925,7 +2925,7 @@ func file_google_monitoring_v3_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_service_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_service_proto_msgTypes[15].Exporter = func(v any, i int) any {
switch v := v.(*Service_CloudRun); i {
case 0:
return &v.state
@@ -2937,7 +2937,7 @@ func file_google_monitoring_v3_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_service_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_service_proto_msgTypes[16].Exporter = func(v any, i int) any {
switch v := v.(*Service_GkeNamespace); i {
case 0:
return &v.state
@@ -2949,7 +2949,7 @@ func file_google_monitoring_v3_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_service_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_service_proto_msgTypes[17].Exporter = func(v any, i int) any {
switch v := v.(*Service_GkeWorkload); i {
case 0:
return &v.state
@@ -2961,7 +2961,7 @@ func file_google_monitoring_v3_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_service_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_service_proto_msgTypes[18].Exporter = func(v any, i int) any {
switch v := v.(*Service_GkeService); i {
case 0:
return &v.state
@@ -2973,7 +2973,7 @@ func file_google_monitoring_v3_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_service_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_service_proto_msgTypes[19].Exporter = func(v any, i int) any {
switch v := v.(*Service_BasicService); i {
case 0:
return &v.state
@@ -2985,7 +2985,7 @@ func file_google_monitoring_v3_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_service_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_service_proto_msgTypes[20].Exporter = func(v any, i int) any {
switch v := v.(*Service_Telemetry); i {
case 0:
return &v.state
@@ -2997,7 +2997,7 @@ func file_google_monitoring_v3_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_service_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_service_proto_msgTypes[24].Exporter = func(v any, i int) any {
switch v := v.(*BasicSli_AvailabilityCriteria); i {
case 0:
return &v.state
@@ -3009,7 +3009,7 @@ func file_google_monitoring_v3_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_service_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_service_proto_msgTypes[25].Exporter = func(v any, i int) any {
switch v := v.(*BasicSli_LatencyCriteria); i {
case 0:
return &v.state
@@ -3021,7 +3021,7 @@ func file_google_monitoring_v3_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_service_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_service_proto_msgTypes[26].Exporter = func(v any, i int) any {
switch v := v.(*WindowsBasedSli_PerformanceThreshold); i {
case 0:
return &v.state
@@ -3033,7 +3033,7 @@ func file_google_monitoring_v3_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_service_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_service_proto_msgTypes[27].Exporter = func(v any, i int) any {
switch v := v.(*WindowsBasedSli_MetricRange); i {
case 0:
return &v.state
@@ -3046,7 +3046,7 @@ func file_google_monitoring_v3_service_proto_init() {
}
}
}
file_google_monitoring_v3_service_proto_msgTypes[0].OneofWrappers = []interface{}{
file_google_monitoring_v3_service_proto_msgTypes[0].OneofWrappers = []any{
(*Service_Custom_)(nil),
(*Service_AppEngine_)(nil),
(*Service_CloudEndpoints_)(nil),
@@ -3058,30 +3058,30 @@ func file_google_monitoring_v3_service_proto_init() {
(*Service_GkeWorkload_)(nil),
(*Service_GkeService_)(nil),
}
file_google_monitoring_v3_service_proto_msgTypes[1].OneofWrappers = []interface{}{
file_google_monitoring_v3_service_proto_msgTypes[1].OneofWrappers = []any{
(*ServiceLevelObjective_RollingPeriod)(nil),
(*ServiceLevelObjective_CalendarPeriod)(nil),
}
file_google_monitoring_v3_service_proto_msgTypes[2].OneofWrappers = []interface{}{
file_google_monitoring_v3_service_proto_msgTypes[2].OneofWrappers = []any{
(*ServiceLevelIndicator_BasicSli)(nil),
(*ServiceLevelIndicator_RequestBased)(nil),
(*ServiceLevelIndicator_WindowsBased)(nil),
}
file_google_monitoring_v3_service_proto_msgTypes[3].OneofWrappers = []interface{}{
file_google_monitoring_v3_service_proto_msgTypes[3].OneofWrappers = []any{
(*BasicSli_Availability)(nil),
(*BasicSli_Latency)(nil),
}
file_google_monitoring_v3_service_proto_msgTypes[5].OneofWrappers = []interface{}{
file_google_monitoring_v3_service_proto_msgTypes[5].OneofWrappers = []any{
(*RequestBasedSli_GoodTotalRatio)(nil),
(*RequestBasedSli_DistributionCut)(nil),
}
file_google_monitoring_v3_service_proto_msgTypes[8].OneofWrappers = []interface{}{
file_google_monitoring_v3_service_proto_msgTypes[8].OneofWrappers = []any{
(*WindowsBasedSli_GoodBadMetricFilter)(nil),
(*WindowsBasedSli_GoodTotalRatioThreshold)(nil),
(*WindowsBasedSli_MetricMeanInRange)(nil),
(*WindowsBasedSli_MetricSumInRange)(nil),
}
file_google_monitoring_v3_service_proto_msgTypes[26].OneofWrappers = []interface{}{
file_google_monitoring_v3_service_proto_msgTypes[26].OneofWrappers = []any{
(*WindowsBasedSli_PerformanceThreshold_Performance)(nil),
(*WindowsBasedSli_PerformanceThreshold_BasicSliPerformance)(nil),
}
@@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.33.0
// protoc-gen-go v1.34.2
// protoc v4.25.3
// source: google/monitoring/v3/service_service.proto
@@ -1142,7 +1142,7 @@ func file_google_monitoring_v3_service_service_proto_rawDescGZIP() []byte {
}
var file_google_monitoring_v3_service_service_proto_msgTypes = make([]protoimpl.MessageInfo, 12)
var file_google_monitoring_v3_service_service_proto_goTypes = []interface{}{
var file_google_monitoring_v3_service_service_proto_goTypes = []any{
(*CreateServiceRequest)(nil), // 0: google.monitoring.v3.CreateServiceRequest
(*GetServiceRequest)(nil), // 1: google.monitoring.v3.GetServiceRequest
(*ListServicesRequest)(nil), // 2: google.monitoring.v3.ListServicesRequest
@@ -1206,7 +1206,7 @@ func file_google_monitoring_v3_service_service_proto_init() {
}
file_google_monitoring_v3_service_proto_init()
if !protoimpl.UnsafeEnabled {
file_google_monitoring_v3_service_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_service_service_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*CreateServiceRequest); i {
case 0:
return &v.state
@@ -1218,7 +1218,7 @@ func file_google_monitoring_v3_service_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_service_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_service_service_proto_msgTypes[1].Exporter = func(v any, i int) any {
switch v := v.(*GetServiceRequest); i {
case 0:
return &v.state
@@ -1230,7 +1230,7 @@ func file_google_monitoring_v3_service_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_service_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_service_service_proto_msgTypes[2].Exporter = func(v any, i int) any {
switch v := v.(*ListServicesRequest); i {
case 0:
return &v.state
@@ -1242,7 +1242,7 @@ func file_google_monitoring_v3_service_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_service_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_service_service_proto_msgTypes[3].Exporter = func(v any, i int) any {
switch v := v.(*ListServicesResponse); i {
case 0:
return &v.state
@@ -1254,7 +1254,7 @@ func file_google_monitoring_v3_service_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_service_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_service_service_proto_msgTypes[4].Exporter = func(v any, i int) any {
switch v := v.(*UpdateServiceRequest); i {
case 0:
return &v.state
@@ -1266,7 +1266,7 @@ func file_google_monitoring_v3_service_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_service_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_service_service_proto_msgTypes[5].Exporter = func(v any, i int) any {
switch v := v.(*DeleteServiceRequest); i {
case 0:
return &v.state
@@ -1278,7 +1278,7 @@ func file_google_monitoring_v3_service_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_service_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_service_service_proto_msgTypes[6].Exporter = func(v any, i int) any {
switch v := v.(*CreateServiceLevelObjectiveRequest); i {
case 0:
return &v.state
@@ -1290,7 +1290,7 @@ func file_google_monitoring_v3_service_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_service_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_service_service_proto_msgTypes[7].Exporter = func(v any, i int) any {
switch v := v.(*GetServiceLevelObjectiveRequest); i {
case 0:
return &v.state
@@ -1302,7 +1302,7 @@ func file_google_monitoring_v3_service_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_service_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_service_service_proto_msgTypes[8].Exporter = func(v any, i int) any {
switch v := v.(*ListServiceLevelObjectivesRequest); i {
case 0:
return &v.state
@@ -1314,7 +1314,7 @@ func file_google_monitoring_v3_service_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_service_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_service_service_proto_msgTypes[9].Exporter = func(v any, i int) any {
switch v := v.(*ListServiceLevelObjectivesResponse); i {
case 0:
return &v.state
@@ -1326,7 +1326,7 @@ func file_google_monitoring_v3_service_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_service_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_service_service_proto_msgTypes[10].Exporter = func(v any, i int) any {
switch v := v.(*UpdateServiceLevelObjectiveRequest); i {
case 0:
return &v.state
@@ -1338,7 +1338,7 @@ func file_google_monitoring_v3_service_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_service_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_service_service_proto_msgTypes[11].Exporter = func(v any, i int) any {
switch v := v.(*DeleteServiceLevelObjectiveRequest); i {
case 0:
return &v.state
+5 -5
View File
@@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.33.0
// protoc-gen-go v1.34.2
// protoc v4.25.3
// source: google/monitoring/v3/snooze.proto
@@ -247,7 +247,7 @@ func file_google_monitoring_v3_snooze_proto_rawDescGZIP() []byte {
}
var file_google_monitoring_v3_snooze_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_google_monitoring_v3_snooze_proto_goTypes = []interface{}{
var file_google_monitoring_v3_snooze_proto_goTypes = []any{
(*Snooze)(nil), // 0: google.monitoring.v3.Snooze
(*Snooze_Criteria)(nil), // 1: google.monitoring.v3.Snooze.Criteria
(*TimeInterval)(nil), // 2: google.monitoring.v3.TimeInterval
@@ -269,7 +269,7 @@ func file_google_monitoring_v3_snooze_proto_init() {
}
file_google_monitoring_v3_common_proto_init()
if !protoimpl.UnsafeEnabled {
file_google_monitoring_v3_snooze_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_snooze_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*Snooze); i {
case 0:
return &v.state
@@ -281,7 +281,7 @@ func file_google_monitoring_v3_snooze_proto_init() {
return nil
}
}
file_google_monitoring_v3_snooze_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_snooze_proto_msgTypes[1].Exporter = func(v any, i int) any {
switch v := v.(*Snooze_Criteria); i {
case 0:
return &v.state
@@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.33.0
// protoc-gen-go v1.34.2
// protoc v4.25.3
// source: google/monitoring/v3/snooze_service.proto
@@ -545,7 +545,7 @@ func file_google_monitoring_v3_snooze_service_proto_rawDescGZIP() []byte {
}
var file_google_monitoring_v3_snooze_service_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_google_monitoring_v3_snooze_service_proto_goTypes = []interface{}{
var file_google_monitoring_v3_snooze_service_proto_goTypes = []any{
(*CreateSnoozeRequest)(nil), // 0: google.monitoring.v3.CreateSnoozeRequest
(*ListSnoozesRequest)(nil), // 1: google.monitoring.v3.ListSnoozesRequest
(*ListSnoozesResponse)(nil), // 2: google.monitoring.v3.ListSnoozesResponse
@@ -581,7 +581,7 @@ func file_google_monitoring_v3_snooze_service_proto_init() {
}
file_google_monitoring_v3_snooze_proto_init()
if !protoimpl.UnsafeEnabled {
file_google_monitoring_v3_snooze_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_snooze_service_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*CreateSnoozeRequest); i {
case 0:
return &v.state
@@ -593,7 +593,7 @@ func file_google_monitoring_v3_snooze_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_snooze_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_snooze_service_proto_msgTypes[1].Exporter = func(v any, i int) any {
switch v := v.(*ListSnoozesRequest); i {
case 0:
return &v.state
@@ -605,7 +605,7 @@ func file_google_monitoring_v3_snooze_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_snooze_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_snooze_service_proto_msgTypes[2].Exporter = func(v any, i int) any {
switch v := v.(*ListSnoozesResponse); i {
case 0:
return &v.state
@@ -617,7 +617,7 @@ func file_google_monitoring_v3_snooze_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_snooze_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_snooze_service_proto_msgTypes[3].Exporter = func(v any, i int) any {
switch v := v.(*GetSnoozeRequest); i {
case 0:
return &v.state
@@ -629,7 +629,7 @@ func file_google_monitoring_v3_snooze_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_snooze_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_snooze_service_proto_msgTypes[4].Exporter = func(v any, i int) any {
switch v := v.(*UpdateSnoozeRequest); i {
case 0:
return &v.state
@@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.33.0
// protoc-gen-go v1.34.2
// protoc v4.25.3
// source: google/monitoring/v3/span_context.proto
@@ -137,7 +137,7 @@ func file_google_monitoring_v3_span_context_proto_rawDescGZIP() []byte {
}
var file_google_monitoring_v3_span_context_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_google_monitoring_v3_span_context_proto_goTypes = []interface{}{
var file_google_monitoring_v3_span_context_proto_goTypes = []any{
(*SpanContext)(nil), // 0: google.monitoring.v3.SpanContext
}
var file_google_monitoring_v3_span_context_proto_depIdxs = []int32{
@@ -154,7 +154,7 @@ func file_google_monitoring_v3_span_context_proto_init() {
return
}
if !protoimpl.UnsafeEnabled {
file_google_monitoring_v3_span_context_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_span_context_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*SpanContext); i {
case 0:
return &v.state
+22 -22
View File
@@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.33.0
// protoc-gen-go v1.34.2
// protoc v4.25.3
// source: google/monitoring/v3/uptime.proto
@@ -2441,7 +2441,7 @@ func file_google_monitoring_v3_uptime_proto_rawDescGZIP() []byte {
var file_google_monitoring_v3_uptime_proto_enumTypes = make([]protoimpl.EnumInfo, 10)
var file_google_monitoring_v3_uptime_proto_msgTypes = make([]protoimpl.MessageInfo, 16)
var file_google_monitoring_v3_uptime_proto_goTypes = []interface{}{
var file_google_monitoring_v3_uptime_proto_goTypes = []any{
(UptimeCheckRegion)(0), // 0: google.monitoring.v3.UptimeCheckRegion
(GroupResourceType)(0), // 1: google.monitoring.v3.GroupResourceType
(InternalChecker_State)(0), // 2: google.monitoring.v3.InternalChecker.State
@@ -2515,7 +2515,7 @@ func file_google_monitoring_v3_uptime_proto_init() {
return
}
if !protoimpl.UnsafeEnabled {
file_google_monitoring_v3_uptime_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_uptime_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*InternalChecker); i {
case 0:
return &v.state
@@ -2527,7 +2527,7 @@ func file_google_monitoring_v3_uptime_proto_init() {
return nil
}
}
file_google_monitoring_v3_uptime_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_uptime_proto_msgTypes[1].Exporter = func(v any, i int) any {
switch v := v.(*SyntheticMonitorTarget); i {
case 0:
return &v.state
@@ -2539,7 +2539,7 @@ func file_google_monitoring_v3_uptime_proto_init() {
return nil
}
}
file_google_monitoring_v3_uptime_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_uptime_proto_msgTypes[2].Exporter = func(v any, i int) any {
switch v := v.(*UptimeCheckConfig); i {
case 0:
return &v.state
@@ -2551,7 +2551,7 @@ func file_google_monitoring_v3_uptime_proto_init() {
return nil
}
}
file_google_monitoring_v3_uptime_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_uptime_proto_msgTypes[3].Exporter = func(v any, i int) any {
switch v := v.(*UptimeCheckIp); i {
case 0:
return &v.state
@@ -2563,7 +2563,7 @@ func file_google_monitoring_v3_uptime_proto_init() {
return nil
}
}
file_google_monitoring_v3_uptime_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_uptime_proto_msgTypes[4].Exporter = func(v any, i int) any {
switch v := v.(*SyntheticMonitorTarget_CloudFunctionV2Target); i {
case 0:
return &v.state
@@ -2575,7 +2575,7 @@ func file_google_monitoring_v3_uptime_proto_init() {
return nil
}
}
file_google_monitoring_v3_uptime_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_uptime_proto_msgTypes[5].Exporter = func(v any, i int) any {
switch v := v.(*UptimeCheckConfig_ResourceGroup); i {
case 0:
return &v.state
@@ -2587,7 +2587,7 @@ func file_google_monitoring_v3_uptime_proto_init() {
return nil
}
}
file_google_monitoring_v3_uptime_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_uptime_proto_msgTypes[6].Exporter = func(v any, i int) any {
switch v := v.(*UptimeCheckConfig_PingConfig); i {
case 0:
return &v.state
@@ -2599,7 +2599,7 @@ func file_google_monitoring_v3_uptime_proto_init() {
return nil
}
}
file_google_monitoring_v3_uptime_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_uptime_proto_msgTypes[7].Exporter = func(v any, i int) any {
switch v := v.(*UptimeCheckConfig_HttpCheck); i {
case 0:
return &v.state
@@ -2611,7 +2611,7 @@ func file_google_monitoring_v3_uptime_proto_init() {
return nil
}
}
file_google_monitoring_v3_uptime_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_uptime_proto_msgTypes[8].Exporter = func(v any, i int) any {
switch v := v.(*UptimeCheckConfig_TcpCheck); i {
case 0:
return &v.state
@@ -2623,7 +2623,7 @@ func file_google_monitoring_v3_uptime_proto_init() {
return nil
}
}
file_google_monitoring_v3_uptime_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_uptime_proto_msgTypes[9].Exporter = func(v any, i int) any {
switch v := v.(*UptimeCheckConfig_ContentMatcher); i {
case 0:
return &v.state
@@ -2635,7 +2635,7 @@ func file_google_monitoring_v3_uptime_proto_init() {
return nil
}
}
file_google_monitoring_v3_uptime_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_uptime_proto_msgTypes[11].Exporter = func(v any, i int) any {
switch v := v.(*UptimeCheckConfig_HttpCheck_BasicAuthentication); i {
case 0:
return &v.state
@@ -2647,7 +2647,7 @@ func file_google_monitoring_v3_uptime_proto_init() {
return nil
}
}
file_google_monitoring_v3_uptime_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_uptime_proto_msgTypes[12].Exporter = func(v any, i int) any {
switch v := v.(*UptimeCheckConfig_HttpCheck_ResponseStatusCode); i {
case 0:
return &v.state
@@ -2659,7 +2659,7 @@ func file_google_monitoring_v3_uptime_proto_init() {
return nil
}
}
file_google_monitoring_v3_uptime_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_uptime_proto_msgTypes[13].Exporter = func(v any, i int) any {
switch v := v.(*UptimeCheckConfig_HttpCheck_ServiceAgentAuthentication); i {
case 0:
return &v.state
@@ -2671,7 +2671,7 @@ func file_google_monitoring_v3_uptime_proto_init() {
return nil
}
}
file_google_monitoring_v3_uptime_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_uptime_proto_msgTypes[15].Exporter = func(v any, i int) any {
switch v := v.(*UptimeCheckConfig_ContentMatcher_JsonPathMatcher); i {
case 0:
return &v.state
@@ -2684,23 +2684,23 @@ func file_google_monitoring_v3_uptime_proto_init() {
}
}
}
file_google_monitoring_v3_uptime_proto_msgTypes[1].OneofWrappers = []interface{}{
file_google_monitoring_v3_uptime_proto_msgTypes[1].OneofWrappers = []any{
(*SyntheticMonitorTarget_CloudFunctionV2)(nil),
}
file_google_monitoring_v3_uptime_proto_msgTypes[2].OneofWrappers = []interface{}{
file_google_monitoring_v3_uptime_proto_msgTypes[2].OneofWrappers = []any{
(*UptimeCheckConfig_MonitoredResource)(nil),
(*UptimeCheckConfig_ResourceGroup_)(nil),
(*UptimeCheckConfig_SyntheticMonitor)(nil),
(*UptimeCheckConfig_HttpCheck_)(nil),
(*UptimeCheckConfig_TcpCheck_)(nil),
}
file_google_monitoring_v3_uptime_proto_msgTypes[7].OneofWrappers = []interface{}{
file_google_monitoring_v3_uptime_proto_msgTypes[7].OneofWrappers = []any{
(*UptimeCheckConfig_HttpCheck_ServiceAgentAuthentication_)(nil),
}
file_google_monitoring_v3_uptime_proto_msgTypes[9].OneofWrappers = []interface{}{
file_google_monitoring_v3_uptime_proto_msgTypes[9].OneofWrappers = []any{
(*UptimeCheckConfig_ContentMatcher_JsonPathMatcher_)(nil),
}
file_google_monitoring_v3_uptime_proto_msgTypes[12].OneofWrappers = []interface{}{
file_google_monitoring_v3_uptime_proto_msgTypes[12].OneofWrappers = []any{
(*UptimeCheckConfig_HttpCheck_ResponseStatusCode_StatusValue)(nil),
(*UptimeCheckConfig_HttpCheck_ResponseStatusCode_StatusClass_)(nil),
}
@@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.33.0
// protoc-gen-go v1.34.2
// protoc v4.25.3
// source: google/monitoring/v3/uptime_service.proto
@@ -778,7 +778,7 @@ func file_google_monitoring_v3_uptime_service_proto_rawDescGZIP() []byte {
}
var file_google_monitoring_v3_uptime_service_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
var file_google_monitoring_v3_uptime_service_proto_goTypes = []interface{}{
var file_google_monitoring_v3_uptime_service_proto_goTypes = []any{
(*ListUptimeCheckConfigsRequest)(nil), // 0: google.monitoring.v3.ListUptimeCheckConfigsRequest
(*ListUptimeCheckConfigsResponse)(nil), // 1: google.monitoring.v3.ListUptimeCheckConfigsResponse
(*GetUptimeCheckConfigRequest)(nil), // 2: google.monitoring.v3.GetUptimeCheckConfigRequest
@@ -824,7 +824,7 @@ func file_google_monitoring_v3_uptime_service_proto_init() {
}
file_google_monitoring_v3_uptime_proto_init()
if !protoimpl.UnsafeEnabled {
file_google_monitoring_v3_uptime_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_uptime_service_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*ListUptimeCheckConfigsRequest); i {
case 0:
return &v.state
@@ -836,7 +836,7 @@ func file_google_monitoring_v3_uptime_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_uptime_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_uptime_service_proto_msgTypes[1].Exporter = func(v any, i int) any {
switch v := v.(*ListUptimeCheckConfigsResponse); i {
case 0:
return &v.state
@@ -848,7 +848,7 @@ func file_google_monitoring_v3_uptime_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_uptime_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_uptime_service_proto_msgTypes[2].Exporter = func(v any, i int) any {
switch v := v.(*GetUptimeCheckConfigRequest); i {
case 0:
return &v.state
@@ -860,7 +860,7 @@ func file_google_monitoring_v3_uptime_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_uptime_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_uptime_service_proto_msgTypes[3].Exporter = func(v any, i int) any {
switch v := v.(*CreateUptimeCheckConfigRequest); i {
case 0:
return &v.state
@@ -872,7 +872,7 @@ func file_google_monitoring_v3_uptime_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_uptime_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_uptime_service_proto_msgTypes[4].Exporter = func(v any, i int) any {
switch v := v.(*UpdateUptimeCheckConfigRequest); i {
case 0:
return &v.state
@@ -884,7 +884,7 @@ func file_google_monitoring_v3_uptime_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_uptime_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_uptime_service_proto_msgTypes[5].Exporter = func(v any, i int) any {
switch v := v.(*DeleteUptimeCheckConfigRequest); i {
case 0:
return &v.state
@@ -896,7 +896,7 @@ func file_google_monitoring_v3_uptime_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_uptime_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_uptime_service_proto_msgTypes[6].Exporter = func(v any, i int) any {
switch v := v.(*ListUptimeCheckIpsRequest); i {
case 0:
return &v.state
@@ -908,7 +908,7 @@ func file_google_monitoring_v3_uptime_service_proto_init() {
return nil
}
}
file_google_monitoring_v3_uptime_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
file_google_monitoring_v3_uptime_service_proto_msgTypes[7].Exporter = func(v any, i int) any {
switch v := v.(*ListUptimeCheckIpsResponse); i {
case 0:
return &v.state
@@ -59,6 +59,7 @@ func defaultNotificationChannelGRPCClientOptions() []option.ClientOption {
internaloption.WithDefaultAudience("https://monitoring.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
internaloption.EnableJwtWithScope(),
internaloption.EnableNewAuthLibrary(),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
}
@@ -377,7 +378,9 @@ func (c *notificationChannelGRPCClient) Connection() *grpc.ClientConn {
func (c *notificationChannelGRPCClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version)
c.xGoogHeaders = []string{"x-goog-api-client", gax.XGoogHeader(kv...)}
c.xGoogHeaders = []string{
"x-goog-api-client", gax.XGoogHeader(kv...),
}
}
// Close closes the connection to the API service. The user should invoke this when
+4 -1
View File
@@ -48,6 +48,7 @@ func defaultQueryGRPCClientOptions() []option.ClientOption {
internaloption.WithDefaultAudience("https://monitoring.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
internaloption.EnableJwtWithScope(),
internaloption.EnableNewAuthLibrary(),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
}
@@ -174,7 +175,9 @@ func (c *queryGRPCClient) Connection() *grpc.ClientConn {
func (c *queryGRPCClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version)
c.xGoogHeaders = []string{"x-goog-api-client", gax.XGoogHeader(kv...)}
c.xGoogHeaders = []string{
"x-goog-api-client", gax.XGoogHeader(kv...),
}
}
// Close closes the connection to the API service. The user should invoke this when
@@ -59,6 +59,7 @@ func defaultServiceMonitoringGRPCClientOptions() []option.ClientOption {
internaloption.WithDefaultAudience("https://monitoring.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
internaloption.EnableJwtWithScope(),
internaloption.EnableNewAuthLibrary(),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
}
@@ -324,7 +325,9 @@ func (c *serviceMonitoringGRPCClient) Connection() *grpc.ClientConn {
func (c *serviceMonitoringGRPCClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version)
c.xGoogHeaders = []string{"x-goog-api-client", gax.XGoogHeader(kv...)}
c.xGoogHeaders = []string{
"x-goog-api-client", gax.XGoogHeader(kv...),
}
}
// Close closes the connection to the API service. The user should invoke this when
+4 -1
View File
@@ -53,6 +53,7 @@ func defaultSnoozeGRPCClientOptions() []option.ClientOption {
internaloption.WithDefaultAudience("https://monitoring.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
internaloption.EnableJwtWithScope(),
internaloption.EnableNewAuthLibrary(),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
}
@@ -230,7 +231,9 @@ func (c *snoozeGRPCClient) Connection() *grpc.ClientConn {
func (c *snoozeGRPCClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version)
c.xGoogHeaders = []string{"x-goog-api-client", gax.XGoogHeader(kv...)}
c.xGoogHeaders = []string{
"x-goog-api-client", gax.XGoogHeader(kv...),
}
}
// Close closes the connection to the API service. The user should invoke this when
+4 -1
View File
@@ -55,6 +55,7 @@ func defaultUptimeCheckGRPCClientOptions() []option.ClientOption {
internaloption.WithDefaultAudience("https://monitoring.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
internaloption.EnableJwtWithScope(),
internaloption.EnableNewAuthLibrary(),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
}
@@ -280,7 +281,9 @@ func (c *uptimeCheckGRPCClient) Connection() *grpc.ClientConn {
func (c *uptimeCheckGRPCClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version)
c.xGoogHeaders = []string{"x-goog-api-client", gax.XGoogHeader(kv...)}
c.xGoogHeaders = []string{
"x-goog-api-client", gax.XGoogHeader(kv...),
}
}
// Close closes the connection to the API service. The user should invoke this when
+1 -1
View File
@@ -15,4 +15,4 @@
package internal
// Version is the current tagged release of the library.
const Version = "1.19.0"
const Version = "1.20.1"
+8 -2
View File
@@ -55,6 +55,7 @@ func defaultGRPCClientOptions() []option.ClientOption {
internaloption.WithDefaultAudience("https://cloudtrace.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
internaloption.EnableJwtWithScope(),
internaloption.EnableNewAuthLibrary(),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
}
@@ -250,7 +251,9 @@ func (c *gRPCClient) Connection() *grpc.ClientConn {
func (c *gRPCClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version)
c.xGoogHeaders = []string{"x-goog-api-client", gax.XGoogHeader(kv...)}
c.xGoogHeaders = []string{
"x-goog-api-client", gax.XGoogHeader(kv...),
}
}
// Close closes the connection to the API service. The user should invoke this when
@@ -309,6 +312,7 @@ func defaultRESTClientOptions() []option.ClientOption {
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://cloudtrace.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
internaloption.EnableNewAuthLibrary(),
}
}
@@ -318,7 +322,9 @@ func defaultRESTClientOptions() []option.ClientOption {
func (c *restClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogHeaders = []string{"x-goog-api-client", gax.XGoogHeader(kv...)}
c.xGoogHeaders = []string{
"x-goog-api-client", gax.XGoogHeader(kv...),
}
}
// Close closes the connection to the API service. The user should invoke this when
+19 -19
View File
@@ -1,4 +1,4 @@
// Copyright 2022 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.33.0
// protoc-gen-go v1.34.2
// protoc v4.25.3
// source: google/devtools/cloudtrace/v2/trace.proto
@@ -1692,7 +1692,7 @@ func file_google_devtools_cloudtrace_v2_trace_proto_rawDescGZIP() []byte {
var file_google_devtools_cloudtrace_v2_trace_proto_enumTypes = make([]protoimpl.EnumInfo, 3)
var file_google_devtools_cloudtrace_v2_trace_proto_msgTypes = make([]protoimpl.MessageInfo, 15)
var file_google_devtools_cloudtrace_v2_trace_proto_goTypes = []interface{}{
var file_google_devtools_cloudtrace_v2_trace_proto_goTypes = []any{
(Span_SpanKind)(0), // 0: google.devtools.cloudtrace.v2.Span.SpanKind
(Span_TimeEvent_MessageEvent_Type)(0), // 1: google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Type
(Span_Link_Type)(0), // 2: google.devtools.cloudtrace.v2.Span.Link.Type
@@ -1763,7 +1763,7 @@ func file_google_devtools_cloudtrace_v2_trace_proto_init() {
return
}
if !protoimpl.UnsafeEnabled {
file_google_devtools_cloudtrace_v2_trace_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
file_google_devtools_cloudtrace_v2_trace_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*Span); i {
case 0:
return &v.state
@@ -1775,7 +1775,7 @@ func file_google_devtools_cloudtrace_v2_trace_proto_init() {
return nil
}
}
file_google_devtools_cloudtrace_v2_trace_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
file_google_devtools_cloudtrace_v2_trace_proto_msgTypes[1].Exporter = func(v any, i int) any {
switch v := v.(*AttributeValue); i {
case 0:
return &v.state
@@ -1787,7 +1787,7 @@ func file_google_devtools_cloudtrace_v2_trace_proto_init() {
return nil
}
}
file_google_devtools_cloudtrace_v2_trace_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
file_google_devtools_cloudtrace_v2_trace_proto_msgTypes[2].Exporter = func(v any, i int) any {
switch v := v.(*StackTrace); i {
case 0:
return &v.state
@@ -1799,7 +1799,7 @@ func file_google_devtools_cloudtrace_v2_trace_proto_init() {
return nil
}
}
file_google_devtools_cloudtrace_v2_trace_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
file_google_devtools_cloudtrace_v2_trace_proto_msgTypes[3].Exporter = func(v any, i int) any {
switch v := v.(*Module); i {
case 0:
return &v.state
@@ -1811,7 +1811,7 @@ func file_google_devtools_cloudtrace_v2_trace_proto_init() {
return nil
}
}
file_google_devtools_cloudtrace_v2_trace_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
file_google_devtools_cloudtrace_v2_trace_proto_msgTypes[4].Exporter = func(v any, i int) any {
switch v := v.(*TruncatableString); i {
case 0:
return &v.state
@@ -1823,7 +1823,7 @@ func file_google_devtools_cloudtrace_v2_trace_proto_init() {
return nil
}
}
file_google_devtools_cloudtrace_v2_trace_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
file_google_devtools_cloudtrace_v2_trace_proto_msgTypes[5].Exporter = func(v any, i int) any {
switch v := v.(*Span_Attributes); i {
case 0:
return &v.state
@@ -1835,7 +1835,7 @@ func file_google_devtools_cloudtrace_v2_trace_proto_init() {
return nil
}
}
file_google_devtools_cloudtrace_v2_trace_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
file_google_devtools_cloudtrace_v2_trace_proto_msgTypes[6].Exporter = func(v any, i int) any {
switch v := v.(*Span_TimeEvent); i {
case 0:
return &v.state
@@ -1847,7 +1847,7 @@ func file_google_devtools_cloudtrace_v2_trace_proto_init() {
return nil
}
}
file_google_devtools_cloudtrace_v2_trace_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
file_google_devtools_cloudtrace_v2_trace_proto_msgTypes[7].Exporter = func(v any, i int) any {
switch v := v.(*Span_TimeEvents); i {
case 0:
return &v.state
@@ -1859,7 +1859,7 @@ func file_google_devtools_cloudtrace_v2_trace_proto_init() {
return nil
}
}
file_google_devtools_cloudtrace_v2_trace_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
file_google_devtools_cloudtrace_v2_trace_proto_msgTypes[8].Exporter = func(v any, i int) any {
switch v := v.(*Span_Link); i {
case 0:
return &v.state
@@ -1871,7 +1871,7 @@ func file_google_devtools_cloudtrace_v2_trace_proto_init() {
return nil
}
}
file_google_devtools_cloudtrace_v2_trace_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
file_google_devtools_cloudtrace_v2_trace_proto_msgTypes[9].Exporter = func(v any, i int) any {
switch v := v.(*Span_Links); i {
case 0:
return &v.state
@@ -1883,7 +1883,7 @@ func file_google_devtools_cloudtrace_v2_trace_proto_init() {
return nil
}
}
file_google_devtools_cloudtrace_v2_trace_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
file_google_devtools_cloudtrace_v2_trace_proto_msgTypes[11].Exporter = func(v any, i int) any {
switch v := v.(*Span_TimeEvent_Annotation); i {
case 0:
return &v.state
@@ -1895,7 +1895,7 @@ func file_google_devtools_cloudtrace_v2_trace_proto_init() {
return nil
}
}
file_google_devtools_cloudtrace_v2_trace_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
file_google_devtools_cloudtrace_v2_trace_proto_msgTypes[12].Exporter = func(v any, i int) any {
switch v := v.(*Span_TimeEvent_MessageEvent); i {
case 0:
return &v.state
@@ -1907,7 +1907,7 @@ func file_google_devtools_cloudtrace_v2_trace_proto_init() {
return nil
}
}
file_google_devtools_cloudtrace_v2_trace_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
file_google_devtools_cloudtrace_v2_trace_proto_msgTypes[13].Exporter = func(v any, i int) any {
switch v := v.(*StackTrace_StackFrame); i {
case 0:
return &v.state
@@ -1919,7 +1919,7 @@ func file_google_devtools_cloudtrace_v2_trace_proto_init() {
return nil
}
}
file_google_devtools_cloudtrace_v2_trace_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {
file_google_devtools_cloudtrace_v2_trace_proto_msgTypes[14].Exporter = func(v any, i int) any {
switch v := v.(*StackTrace_StackFrames); i {
case 0:
return &v.state
@@ -1932,12 +1932,12 @@ func file_google_devtools_cloudtrace_v2_trace_proto_init() {
}
}
}
file_google_devtools_cloudtrace_v2_trace_proto_msgTypes[1].OneofWrappers = []interface{}{
file_google_devtools_cloudtrace_v2_trace_proto_msgTypes[1].OneofWrappers = []any{
(*AttributeValue_StringValue)(nil),
(*AttributeValue_IntValue)(nil),
(*AttributeValue_BoolValue)(nil),
}
file_google_devtools_cloudtrace_v2_trace_proto_msgTypes[6].OneofWrappers = []interface{}{
file_google_devtools_cloudtrace_v2_trace_proto_msgTypes[6].OneofWrappers = []any{
(*Span_TimeEvent_Annotation_)(nil),
(*Span_TimeEvent_MessageEvent_)(nil),
}
+4 -4
View File
@@ -1,4 +1,4 @@
// Copyright 2022 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.33.0
// protoc-gen-go v1.34.2
// protoc v4.25.3
// source: google/devtools/cloudtrace/v2/tracing.proto
@@ -186,7 +186,7 @@ func file_google_devtools_cloudtrace_v2_tracing_proto_rawDescGZIP() []byte {
}
var file_google_devtools_cloudtrace_v2_tracing_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_google_devtools_cloudtrace_v2_tracing_proto_goTypes = []interface{}{
var file_google_devtools_cloudtrace_v2_tracing_proto_goTypes = []any{
(*BatchWriteSpansRequest)(nil), // 0: google.devtools.cloudtrace.v2.BatchWriteSpansRequest
(*Span)(nil), // 1: google.devtools.cloudtrace.v2.Span
(*emptypb.Empty)(nil), // 2: google.protobuf.Empty
@@ -211,7 +211,7 @@ func file_google_devtools_cloudtrace_v2_tracing_proto_init() {
}
file_google_devtools_cloudtrace_v2_trace_proto_init()
if !protoimpl.UnsafeEnabled {
file_google_devtools_cloudtrace_v2_tracing_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
file_google_devtools_cloudtrace_v2_tracing_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*BatchWriteSpansRequest); i {
case 0:
return &v.state
+1 -1
View File
@@ -15,4 +15,4 @@
package internal
// Version is the current tagged release of the library.
const Version = "1.10.7"
const Version = "1.10.9"