aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/cloud.google.com/go/logging
diff options
context:
space:
mode:
authorTaras Madan <tarasmadan@google.com>2022-09-05 14:27:54 +0200
committerGitHub <noreply@github.com>2022-09-05 12:27:54 +0000
commitb2f2446b46bf02821d90ebedadae2bf7ae0e880e (patch)
tree923cf42842918d6bebca1d6bbdc08abed54d274d /vendor/cloud.google.com/go/logging
parente6654faff4bcca4be92e9a8596fd4b77f747c39e (diff)
go.mod, vendor: update (#3358)
* go.mod, vendor: remove unnecessary dependencies Commands: 1. go mod tidy 2. go mod vendor * go.mod, vendor: update cloud.google.com/go Commands: 1. go get -u cloud.google.com/go 2. go mod tidy 3. go mod vendor * go.mod, vendor: update cloud.google.com/* Commands: 1. go get -u cloud.google.com/storage cloud.google.com/logging 2. go mod tidy 3. go mod vendor * go.mod, .golangci.yml, vendor: update *lint* Commands: 1. go get -u golang.org/x/tools github.com/golangci/golangci-lint@v1.47.0 2. go mod tidy 3. go mod vendor 4. edit .golangci.yml to suppress new errors (resolved in the same PR later) * all: fix lint errors hash.go: copy() recommended by gosimple parse.go: ent is never nil verifier.go: signal.Notify() with unbuffered channel is bad. Have no idea why. * .golangci.yml: adjust godot rules check-all is deprecated, but still work if you're hesitating too - I'll remove this commit
Diffstat (limited to 'vendor/cloud.google.com/go/logging')
-rw-r--r--vendor/cloud.google.com/go/logging/.release-please-manifest.json3
-rw-r--r--vendor/cloud.google.com/go/logging/CHANGES.md15
-rw-r--r--vendor/cloud.google.com/go/logging/README.md31
-rw-r--r--vendor/cloud.google.com/go/logging/apiv2/README.md2
-rw-r--r--vendor/cloud.google.com/go/logging/apiv2/config_client.go712
-rw-r--r--vendor/cloud.google.com/go/logging/apiv2/doc.go52
-rw-r--r--vendor/cloud.google.com/go/logging/apiv2/gapic_metadata.json193
-rw-r--r--vendor/cloud.google.com/go/logging/apiv2/logging_client.go220
-rw-r--r--vendor/cloud.google.com/go/logging/apiv2/metrics_client.go164
-rw-r--r--vendor/cloud.google.com/go/logging/apiv2/version.go23
-rw-r--r--vendor/cloud.google.com/go/logging/doc.go25
-rw-r--r--vendor/cloud.google.com/go/logging/go.mod21
-rw-r--r--vendor/cloud.google.com/go/logging/go.sum223
-rw-r--r--vendor/cloud.google.com/go/logging/go_mod_tidy_hack.go1
-rw-r--r--vendor/cloud.google.com/go/logging/instrumentation.go83
-rw-r--r--vendor/cloud.google.com/go/logging/internal/common.go43
-rw-r--r--vendor/cloud.google.com/go/logging/internal/environment.go75
-rw-r--r--vendor/cloud.google.com/go/logging/internal/version.go18
-rw-r--r--vendor/cloud.google.com/go/logging/logadmin/logadmin.go7
-rw-r--r--vendor/cloud.google.com/go/logging/loggeroption.go189
-rw-r--r--vendor/cloud.google.com/go/logging/logging.go399
-rw-r--r--vendor/cloud.google.com/go/logging/release-please-config.json11
-rw-r--r--vendor/cloud.google.com/go/logging/resource.go263
23 files changed, 2082 insertions, 691 deletions
diff --git a/vendor/cloud.google.com/go/logging/.release-please-manifest.json b/vendor/cloud.google.com/go/logging/.release-please-manifest.json
new file mode 100644
index 000000000..d88d30750
--- /dev/null
+++ b/vendor/cloud.google.com/go/logging/.release-please-manifest.json
@@ -0,0 +1,3 @@
+{
+ "logging": "1.5.0"
+}
diff --git a/vendor/cloud.google.com/go/logging/CHANGES.md b/vendor/cloud.google.com/go/logging/CHANGES.md
index c326f28f7..b9b91392d 100644
--- a/vendor/cloud.google.com/go/logging/CHANGES.md
+++ b/vendor/cloud.google.com/go/logging/CHANGES.md
@@ -1,5 +1,20 @@
# Changes
+## [1.5.0](https://github.com/googleapis/google-cloud-go/compare/logging/v1.4.2...logging/v1.5.0) (2022-06-25)
+
+
+### Features
+
+* **logging:** add better version metadata to calls ([d1ad921](https://github.com/googleapis/google-cloud-go/commit/d1ad921d0322e7ce728ca9d255a3cf0437d26add))
+* **logging:** set versionClient to module version ([55f0d92](https://github.com/googleapis/google-cloud-go/commit/55f0d92bf112f14b024b4ab0076c9875a17423c9))
+* **logging:** support structured logging functionality ([#6029](https://github.com/googleapis/google-cloud-go/issues/6029)) ([56f4cdd](https://github.com/googleapis/google-cloud-go/commit/56f4cdd066cc9eaeece2c6fb466d58c3e7c41563))
+* **logging:** Update Logging API with latest changes ([5af548b](https://github.com/googleapis/google-cloud-go/commit/5af548bee4ffde279727b2e1ad9b072925106a74))
+
+
+### Bug Fixes
+
+* **logging:** remove instance_name resource label ([#5461](https://github.com/googleapis/google-cloud-go/issues/5461)) ([115385f](https://github.com/googleapis/google-cloud-go/commit/115385f066ee54cf35a093749bc2673a17b3fa08))
+
### [1.4.2](https://www.github.com/googleapis/google-cloud-go/compare/logging/v1.4.1...logging/v1.4.2) (2021-05-20)
diff --git a/vendor/cloud.google.com/go/logging/README.md b/vendor/cloud.google.com/go/logging/README.md
index b9957e5a3..0de922f51 100644
--- a/vendor/cloud.google.com/go/logging/README.md
+++ b/vendor/cloud.google.com/go/logging/README.md
@@ -3,8 +3,9 @@
- [About Cloud Logging](https://cloud.google.com/logging/)
- [API documentation](https://cloud.google.com/logging/docs)
- [Go client documentation](https://pkg.go.dev/cloud.google.com/go/logging)
-- [Complete sample programs](https://github.com/GoogleCloudPlatform/golang-samples/tree/master/logging)
+- [Complete sample programs](https://github.com/GoogleCloudPlatform/golang-samples/tree/main/logging)
+For an interactive tutorial on using the client library in a Go application, click [Guide Me](https://console.cloud.google.com/?walkthrough_id=logging__logging-go).
### Example Usage
First create a `logging.Client` to use throughout your application:
@@ -27,12 +28,38 @@ logger := client.Logger("my-log")
logger.Log(logging.Entry{Payload: "something happened!"})
```
-Close your client before your program exits, to flush any buffered log entries.
+If you need to write a critical log entry use synchronous ingestion method.
[snip]:# (logging-3)
```go
+logger := client.Logger("my-log")
+logger.LogSync(context.Background(), logging.Entry{Payload: "something happened!"})
+```
+
+Close your client before your program exits, to flush any buffered log entries.
+[snip]:# (logging-4)
+
+```go
err = client.Close()
if err != nil {
// TODO: Handle error.
}
```
+
+### Logger configuration options
+
+Creating a Logger using `logging.Logger` accept configuration [LoggerOption](loggeroption.go#L25) arguments. The following options are supported:
+
+| Configuration option | Arguments | Description |
+| -------------------- | --------- | ----------- |
+| CommonLabels | `map[string]string` | The set of labels that will be ingested for all log entries ingested by Logger. |
+| ConcurrentWriteLimit | `int` | Number of parallel goroutine the Logger will use to ingest logs asynchronously. High number of routines may exhaust API quota. The default is 1. |
+| DelayThreshold | `time.Duration` | Maximum time a log entry is buffered on client before being ingested. The default is 1 second. |
+| EntryCountThreshold | `int` | Maximum number of log entries to be buffered on client before being ingested. The default is 1000. |
+| EntryByteThreshold | `int` | Maximum size in bytes of log entries to be buffered on client before being ingested. The default is 8MiB. |
+| EntryByteLimit | `int` | Maximum size in bytes of the single write call to ingest log entries. If EntryByteLimit is smaller than EntryByteThreshold, the latter has no effect. The default is zero, meaning there is no limit. |
+| BufferedByteLimit | `int` | Maximum number of bytes that the Logger will keep in memory before returning ErrOverflow. This option limits the total memory consumption of the Logger (but note that each Logger has its own, separate limit). It is possible to reach BufferedByteLimit even if it is larger than EntryByteThreshold or EntryByteLimit, because calls triggered by the latter two options may be enqueued (and hence occupying memory) while new log entries are being added. |
+| ContextFunc | `func() (ctx context.Context, afterCall func())` | Callback function to be called to obtain `context.Context` during async log ingestion. |
+| SourceLocationPopulation | One of `logging.DoNotPopulateSourceLocation`, `logging.PopulateSourceLocationForDebugEntries` or `logging.AlwaysPopulateSourceLocation` | Controls auto-population of the logging.Entry.SoourceLocation field when ingesting log entries. Allows to disable population of source location info, allowing it only for log entries at Debug severity or enable it for all log entries. Enabling it for all entries may result in degradation in performance. Use `logging_test.BenchmarkSourceLocationPopulation` to test performance with and without the option. The default is set to `logging.DoNotPopulateSourceLocation`. |
+| PartialSuccess | | Make each write call to Logging service with [partialSuccess flag](https://cloud.google.com/logging/docs/reference/v2/rest/v2/entries/write#body.request_body.FIELDS.partial_success) set. The default is to make calls without setting the flag. |
+| RedirectAsJSON | `io.Writer` | Converts log entries to Jsonified one line string according to the [structured logging format](https://cloud.google.com/logging/docs/structured-logging#special-payload-fields) and writes it to provided `io.Writer`. Users should use this option with `os.Stdout` and `os.Stderr` to leverage the out-of-process ingestion of logs using logging agents that are deployed in Cloud Logging environments. |
diff --git a/vendor/cloud.google.com/go/logging/apiv2/README.md b/vendor/cloud.google.com/go/logging/apiv2/README.md
index d2d9a176e..64efb249b 100644
--- a/vendor/cloud.google.com/go/logging/apiv2/README.md
+++ b/vendor/cloud.google.com/go/logging/apiv2/README.md
@@ -6,6 +6,4 @@ This package includes auto-generated clients for the logging v2 API.
Use the handwritten logging client (in the parent directory,
cloud.google.com/go/logging) in preference to this.
-This code is EXPERIMENTAL and subject to CHANGE AT ANY TIME.
-
diff --git a/vendor/cloud.google.com/go/logging/apiv2/config_client.go b/vendor/cloud.google.com/go/logging/apiv2/config_client.go
index e80e55711..d79b0b837 100644
--- a/vendor/cloud.google.com/go/logging/apiv2/config_client.go
+++ b/vendor/cloud.google.com/go/logging/apiv2/config_client.go
@@ -1,4 +1,4 @@
-// Copyright 2021 Google LLC
+// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -23,16 +23,19 @@ import (
"net/url"
"time"
- "github.com/golang/protobuf/proto"
+ "cloud.google.com/go/longrunning"
+ lroauto "cloud.google.com/go/longrunning/autogen"
gax "github.com/googleapis/gax-go/v2"
"google.golang.org/api/iterator"
"google.golang.org/api/option"
"google.golang.org/api/option/internaloption"
gtransport "google.golang.org/api/transport/grpc"
loggingpb "google.golang.org/genproto/googleapis/logging/v2"
+ longrunningpb "google.golang.org/genproto/googleapis/longrunning"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/metadata"
+ "google.golang.org/protobuf/proto"
)
var newConfigClientHook clientHook
@@ -62,15 +65,18 @@ type ConfigCallOptions struct {
DeleteExclusion []gax.CallOption
GetCmekSettings []gax.CallOption
UpdateCmekSettings []gax.CallOption
+ GetSettings []gax.CallOption
+ UpdateSettings []gax.CallOption
+ CopyLogEntries []gax.CallOption
}
-func defaultConfigClientOptions() []option.ClientOption {
+func defaultConfigGRPCClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("logging.googleapis.com:443"),
internaloption.WithDefaultMTLSEndpoint("logging.mtls.googleapis.com:443"),
internaloption.WithDefaultAudience("https://logging.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
- option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
+ internaloption.EnableJwtWithScope(),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
}
@@ -185,35 +191,333 @@ func defaultConfigCallOptions() *ConfigCallOptions {
},
GetCmekSettings: []gax.CallOption{},
UpdateCmekSettings: []gax.CallOption{},
+ GetSettings: []gax.CallOption{},
+ UpdateSettings: []gax.CallOption{},
+ CopyLogEntries: []gax.CallOption{},
}
}
+// internalConfigClient is an interface that defines the methods available from Cloud Logging API.
+type internalConfigClient interface {
+ Close() error
+ setGoogleClientInfo(...string)
+ Connection() *grpc.ClientConn
+ ListBuckets(context.Context, *loggingpb.ListBucketsRequest, ...gax.CallOption) *LogBucketIterator
+ GetBucket(context.Context, *loggingpb.GetBucketRequest, ...gax.CallOption) (*loggingpb.LogBucket, error)
+ CreateBucket(context.Context, *loggingpb.CreateBucketRequest, ...gax.CallOption) (*loggingpb.LogBucket, error)
+ UpdateBucket(context.Context, *loggingpb.UpdateBucketRequest, ...gax.CallOption) (*loggingpb.LogBucket, error)
+ DeleteBucket(context.Context, *loggingpb.DeleteBucketRequest, ...gax.CallOption) error
+ UndeleteBucket(context.Context, *loggingpb.UndeleteBucketRequest, ...gax.CallOption) error
+ ListViews(context.Context, *loggingpb.ListViewsRequest, ...gax.CallOption) *LogViewIterator
+ GetView(context.Context, *loggingpb.GetViewRequest, ...gax.CallOption) (*loggingpb.LogView, error)
+ CreateView(context.Context, *loggingpb.CreateViewRequest, ...gax.CallOption) (*loggingpb.LogView, error)
+ UpdateView(context.Context, *loggingpb.UpdateViewRequest, ...gax.CallOption) (*loggingpb.LogView, error)
+ DeleteView(context.Context, *loggingpb.DeleteViewRequest, ...gax.CallOption) error
+ ListSinks(context.Context, *loggingpb.ListSinksRequest, ...gax.CallOption) *LogSinkIterator
+ GetSink(context.Context, *loggingpb.GetSinkRequest, ...gax.CallOption) (*loggingpb.LogSink, error)
+ CreateSink(context.Context, *loggingpb.CreateSinkRequest, ...gax.CallOption) (*loggingpb.LogSink, error)
+ UpdateSink(context.Context, *loggingpb.UpdateSinkRequest, ...gax.CallOption) (*loggingpb.LogSink, error)
+ DeleteSink(context.Context, *loggingpb.DeleteSinkRequest, ...gax.CallOption) error
+ ListExclusions(context.Context, *loggingpb.ListExclusionsRequest, ...gax.CallOption) *LogExclusionIterator
+ GetExclusion(context.Context, *loggingpb.GetExclusionRequest, ...gax.CallOption) (*loggingpb.LogExclusion, error)
+ CreateExclusion(context.Context, *loggingpb.CreateExclusionRequest, ...gax.CallOption) (*loggingpb.LogExclusion, error)
+ UpdateExclusion(context.Context, *loggingpb.UpdateExclusionRequest, ...gax.CallOption) (*loggingpb.LogExclusion, error)
+ DeleteExclusion(context.Context, *loggingpb.DeleteExclusionRequest, ...gax.CallOption) error
+ GetCmekSettings(context.Context, *loggingpb.GetCmekSettingsRequest, ...gax.CallOption) (*loggingpb.CmekSettings, error)
+ UpdateCmekSettings(context.Context, *loggingpb.UpdateCmekSettingsRequest, ...gax.CallOption) (*loggingpb.CmekSettings, error)
+ GetSettings(context.Context, *loggingpb.GetSettingsRequest, ...gax.CallOption) (*loggingpb.Settings, error)
+ UpdateSettings(context.Context, *loggingpb.UpdateSettingsRequest, ...gax.CallOption) (*loggingpb.Settings, error)
+ CopyLogEntries(context.Context, *loggingpb.CopyLogEntriesRequest, ...gax.CallOption) (*CopyLogEntriesOperation, error)
+ CopyLogEntriesOperation(name string) *CopyLogEntriesOperation
+}
+
// ConfigClient is a client for interacting with Cloud Logging API.
-//
// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
+//
+// Service for configuring sinks used to route log entries.
type ConfigClient struct {
+ // The internal transport-dependent client.
+ internalClient internalConfigClient
+
+ // The call options for this service.
+ CallOptions *ConfigCallOptions
+
+ // LROClient is used internally to handle long-running operations.
+ // It is exposed so that its CallOptions can be modified if required.
+ // Users should not Close this client.
+ LROClient *lroauto.OperationsClient
+}
+
+// Wrapper methods routed to the internal client.
+
+// Close closes the connection to the API service. The user should invoke this when
+// the client is no longer required.
+func (c *ConfigClient) Close() error {
+ return c.internalClient.Close()
+}
+
+// setGoogleClientInfo sets the name and version of the application in
+// the `x-goog-api-client` header passed on each request. Intended for
+// use by Google-written clients.
+func (c *ConfigClient) setGoogleClientInfo(keyval ...string) {
+ c.internalClient.setGoogleClientInfo(keyval...)
+}
+
+// Connection returns a connection to the API service.
+//
+// Deprecated.
+func (c *ConfigClient) Connection() *grpc.ClientConn {
+ return c.internalClient.Connection()
+}
+
+// ListBuckets lists log buckets.
+func (c *ConfigClient) ListBuckets(ctx context.Context, req *loggingpb.ListBucketsRequest, opts ...gax.CallOption) *LogBucketIterator {
+ return c.internalClient.ListBuckets(ctx, req, opts...)
+}
+
+// GetBucket gets a log bucket.
+func (c *ConfigClient) GetBucket(ctx context.Context, req *loggingpb.GetBucketRequest, opts ...gax.CallOption) (*loggingpb.LogBucket, error) {
+ return c.internalClient.GetBucket(ctx, req, opts...)
+}
+
+// CreateBucket creates a log bucket that can be used to store log entries. After a bucket
+// has been created, the bucket’s location cannot be changed.
+func (c *ConfigClient) CreateBucket(ctx context.Context, req *loggingpb.CreateBucketRequest, opts ...gax.CallOption) (*loggingpb.LogBucket, error) {
+ return c.internalClient.CreateBucket(ctx, req, opts...)
+}
+
+// UpdateBucket updates a log bucket. This method replaces the following fields in the
+// existing bucket with values from the new bucket: retention_period
+//
+// If the retention period is decreased and the bucket is locked,
+// FAILED_PRECONDITION will be returned.
+//
+// If the bucket has a lifecycle_state of DELETE_REQUESTED, then
+// FAILED_PRECONDITION will be returned.
+//
+// After a bucket has been created, the bucket’s location cannot be changed.
+func (c *ConfigClient) UpdateBucket(ctx context.Context, req *loggingpb.UpdateBucketRequest, opts ...gax.CallOption) (*loggingpb.LogBucket, error) {
+ return c.internalClient.UpdateBucket(ctx, req, opts...)
+}
+
+// DeleteBucket deletes a log bucket.
+//
+// Changes the bucket’s lifecycle_state to the DELETE_REQUESTED state.
+// After 7 days, the bucket will be purged and all log entries in the bucket
+// will be permanently deleted.
+func (c *ConfigClient) DeleteBucket(ctx context.Context, req *loggingpb.DeleteBucketRequest, opts ...gax.CallOption) error {
+ return c.internalClient.DeleteBucket(ctx, req, opts...)
+}
+
+// UndeleteBucket undeletes a log bucket. A bucket that has been deleted can be undeleted
+// within the grace period of 7 days.
+func (c *ConfigClient) UndeleteBucket(ctx context.Context, req *loggingpb.UndeleteBucketRequest, opts ...gax.CallOption) error {
+ return c.internalClient.UndeleteBucket(ctx, req, opts...)
+}
+
+// ListViews lists views on a log bucket.
+func (c *ConfigClient) ListViews(ctx context.Context, req *loggingpb.ListViewsRequest, opts ...gax.CallOption) *LogViewIterator {
+ return c.internalClient.ListViews(ctx, req, opts...)
+}
+
+// GetView gets a view on a log bucket…
+func (c *ConfigClient) GetView(ctx context.Context, req *loggingpb.GetViewRequest, opts ...gax.CallOption) (*loggingpb.LogView, error) {
+ return c.internalClient.GetView(ctx, req, opts...)
+}
+
+// CreateView creates a view over log entries in a log bucket. A bucket may contain a
+// maximum of 30 views.
+func (c *ConfigClient) CreateView(ctx context.Context, req *loggingpb.CreateViewRequest, opts ...gax.CallOption) (*loggingpb.LogView, error) {
+ return c.internalClient.CreateView(ctx, req, opts...)
+}
+
+// UpdateView updates a view on a log bucket. This method replaces the following fields
+// in the existing view with values from the new view: filter.
+// If an UNAVAILABLE error is returned, this indicates that system is not in
+// a state where it can update the view. If this occurs, please try again in a
+// few minutes.
+func (c *ConfigClient) UpdateView(ctx context.Context, req *loggingpb.UpdateViewRequest, opts ...gax.CallOption) (*loggingpb.LogView, error) {
+ return c.internalClient.UpdateView(ctx, req, opts...)
+}
+
+// DeleteView deletes a view on a log bucket.
+// If an UNAVAILABLE error is returned, this indicates that system is not in
+// a state where it can delete the view. If this occurs, please try again in a
+// few minutes.
+func (c *ConfigClient) DeleteView(ctx context.Context, req *loggingpb.DeleteViewRequest, opts ...gax.CallOption) error {
+ return c.internalClient.DeleteView(ctx, req, opts...)
+}
+
+// ListSinks lists sinks.
+func (c *ConfigClient) ListSinks(ctx context.Context, req *loggingpb.ListSinksRequest, opts ...gax.CallOption) *LogSinkIterator {
+ return c.internalClient.ListSinks(ctx, req, opts...)
+}
+
+// GetSink gets a sink.
+func (c *ConfigClient) GetSink(ctx context.Context, req *loggingpb.GetSinkRequest, opts ...gax.CallOption) (*loggingpb.LogSink, error) {
+ return c.internalClient.GetSink(ctx, req, opts...)
+}
+
+// CreateSink creates a sink that exports specified log entries to a destination. The
+// export of newly-ingested log entries begins immediately, unless the sink’s
+// writer_identity is not permitted to write to the destination. A sink can
+// export log entries only from the resource owning the sink.
+func (c *ConfigClient) CreateSink(ctx context.Context, req *loggingpb.CreateSinkRequest, opts ...gax.CallOption) (*loggingpb.LogSink, error) {
+ return c.internalClient.CreateSink(ctx, req, opts...)
+}
+
+// UpdateSink updates a sink. This method replaces the following fields in the existing
+// sink with values from the new sink: destination, and filter.
+//
+// The updated sink might also have a new writer_identity; see the
+// unique_writer_identity field.
+func (c *ConfigClient) UpdateSink(ctx context.Context, req *loggingpb.UpdateSinkRequest, opts ...gax.CallOption) (*loggingpb.LogSink, error) {
+ return c.internalClient.UpdateSink(ctx, req, opts...)
+}
+
+// DeleteSink deletes a sink. If the sink has a unique writer_identity, then that
+// service account is also deleted.
+func (c *ConfigClient) DeleteSink(ctx context.Context, req *loggingpb.DeleteSinkRequest, opts ...gax.CallOption) error {
+ return c.internalClient.DeleteSink(ctx, req, opts...)
+}
+
+// ListExclusions lists all the exclusions on the _Default sink in a parent resource.
+func (c *ConfigClient) ListExclusions(ctx context.Context, req *loggingpb.ListExclusionsRequest, opts ...gax.CallOption) *LogExclusionIterator {
+ return c.internalClient.ListExclusions(ctx, req, opts...)
+}
+
+// GetExclusion gets the description of an exclusion in the _Default sink.
+func (c *ConfigClient) GetExclusion(ctx context.Context, req *loggingpb.GetExclusionRequest, opts ...gax.CallOption) (*loggingpb.LogExclusion, error) {
+ return c.internalClient.GetExclusion(ctx, req, opts...)
+}
+
+// CreateExclusion creates a new exclusion in the _Default sink in a specified parent
+// resource. Only log entries belonging to that resource can be excluded. You
+// can have up to 10 exclusions in a resource.
+func (c *ConfigClient) CreateExclusion(ctx context.Context, req *loggingpb.CreateExclusionRequest, opts ...gax.CallOption) (*loggingpb.LogExclusion, error) {
+ return c.internalClient.CreateExclusion(ctx, req, opts...)
+}
+
+// UpdateExclusion changes one or more properties of an existing exclusion in the _Default
+// sink.
+func (c *ConfigClient) UpdateExclusion(ctx context.Context, req *loggingpb.UpdateExclusionRequest, opts ...gax.CallOption) (*loggingpb.LogExclusion, error) {
+ return c.internalClient.UpdateExclusion(ctx, req, opts...)
+}
+
+// DeleteExclusion deletes an exclusion in the _Default sink.
+func (c *ConfigClient) DeleteExclusion(ctx context.Context, req *loggingpb.DeleteExclusionRequest, opts ...gax.CallOption) error {
+ return c.internalClient.DeleteExclusion(ctx, req, opts...)
+}
+
+// GetCmekSettings gets the Logging CMEK settings for the given resource.
+//
+// Note: CMEK for the Log Router can be configured for Google Cloud projects,
+// folders, organizations and billing accounts. Once configured for an
+// organization, it applies to all projects and folders in the Google Cloud
+// organization.
+//
+// See Enabling CMEK for Log
+// Router (at https://cloud.google.com/logging/docs/routing/managed-encryption)
+// for more information.
+func (c *ConfigClient) GetCmekSettings(ctx context.Context, req *loggingpb.GetCmekSettingsRequest, opts ...gax.CallOption) (*loggingpb.CmekSettings, error) {
+ return c.internalClient.GetCmekSettings(ctx, req, opts...)
+}
+
+// UpdateCmekSettings updates the Log Router CMEK settings for the given resource.
+//
+// Note: CMEK for the Log Router can currently only be configured for Google
+// Cloud organizations. Once configured, it applies to all projects and
+// folders in the Google Cloud organization.
+//
+// UpdateCmekSettings
+// will fail if 1) kms_key_name is invalid, or 2) the associated service
+// account does not have the required
+// roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key, or
+// 3) access to the key is disabled.
+//
+// See Enabling CMEK for Log
+// Router (at https://cloud.google.com/logging/docs/routing/managed-encryption)
+// for more information.
+func (c *ConfigClient) UpdateCmekSettings(ctx context.Context, req *loggingpb.UpdateCmekSettingsRequest, opts ...gax.CallOption) (*loggingpb.CmekSettings, error) {
+ return c.internalClient.UpdateCmekSettings(ctx, req, opts...)
+}
+
+// GetSettings gets the Log Router settings for the given resource.
+//
+// Note: Settings for the Log Router can be get for Google Cloud projects,
+// folders, organizations and billing accounts. Currently it can only be
+// configured for organizations. Once configured for an organization, it
+// applies to all projects and folders in the Google Cloud organization.
+//
+// See Enabling CMEK for Log
+// Router (at https://cloud.google.com/logging/docs/routing/managed-encryption)
+// for more information.
+func (c *ConfigClient) GetSettings(ctx context.Context, req *loggingpb.GetSettingsRequest, opts ...gax.CallOption) (*loggingpb.Settings, error) {
+ return c.internalClient.GetSettings(ctx, req, opts...)
+}
+
+// UpdateSettings updates the Log Router settings for the given resource.
+//
+// Note: Settings for the Log Router can currently only be configured for
+// Google Cloud organizations. Once configured, it applies to all projects and
+// folders in the Google Cloud organization.
+//
+// UpdateSettings
+// will fail if 1) kms_key_name is invalid, or 2) the associated service
+// account does not have the required
+// roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key, or
+// 3) access to the key is disabled. 4) location_id is not supported by
+// Logging. 5) location_id violate OrgPolicy.
+//
+// See Enabling CMEK for Log
+// Router (at https://cloud.google.com/logging/docs/routing/managed-encryption)
+// for more information.
+func (c *ConfigClient) UpdateSettings(ctx context.Context, req *loggingpb.UpdateSettingsRequest, opts ...gax.CallOption) (*loggingpb.Settings, error) {
+ return c.internalClient.UpdateSettings(ctx, req, opts...)
+}
+
+// CopyLogEntries copies a set of log entries from a log bucket to a Cloud Storage bucket.
+func (c *ConfigClient) CopyLogEntries(ctx context.Context, req *loggingpb.CopyLogEntriesRequest, opts ...gax.CallOption) (*CopyLogEntriesOperation, error) {
+ return c.internalClient.CopyLogEntries(ctx, req, opts...)
+}
+
+// CopyLogEntriesOperation returns a new CopyLogEntriesOperation from a given name.
+// The name must be that of a previously created CopyLogEntriesOperation, possibly from a different process.
+func (c *ConfigClient) CopyLogEntriesOperation(name string) *CopyLogEntriesOperation {
+ return c.internalClient.CopyLogEntriesOperation(name)
+}
+
+// configGRPCClient is a client for interacting with Cloud Logging API over gRPC transport.
+//
+// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
+type configGRPCClient struct {
// Connection pool of gRPC connections to the service.
connPool gtransport.ConnPool
// flag to opt out of default deadlines via GOOGLE_API_GO_EXPERIMENTAL_DISABLE_DEFAULT_DEADLINE
disableDeadlines bool
+ // Points back to the CallOptions field of the containing ConfigClient
+ CallOptions **ConfigCallOptions
+
// The gRPC API client.
configClient loggingpb.ConfigServiceV2Client
- // The call options for this service.
- CallOptions *ConfigCallOptions
+ // LROClient is used internally to handle long-running operations.
+ // It is exposed so that its CallOptions can be modified if required.
+ // Users should not Close this client.
+ LROClient **lroauto.OperationsClient
// The x-goog-* metadata to be sent with each request.
xGoogMetadata metadata.MD
}
-// NewConfigClient creates a new config service v2 client.
+// NewConfigClient creates a new config service v2 client based on gRPC.
+// The returned client must be Closed when it is done being used to clean up its underlying connections.
//
// Service for configuring sinks used to route log entries.
func NewConfigClient(ctx context.Context, opts ...option.ClientOption) (*ConfigClient, error) {
- clientOpts := defaultConfigClientOptions()
-
+ clientOpts := defaultConfigGRPCClientOptions()
if newConfigClientHook != nil {
hookOpts, err := newConfigClientHook(ctx, clientHookParams{})
if err != nil {
@@ -231,53 +535,69 @@ func NewConfigClient(ctx context.Context, opts ...option.ClientOption) (*ConfigC
if err != nil {
return nil, err
}
- c := &ConfigClient{
+ client := ConfigClient{CallOptions: defaultConfigCallOptions()}
+
+ c := &configGRPCClient{
connPool: connPool,
disableDeadlines: disableDeadlines,
- CallOptions: defaultConfigCallOptions(),
-
- configClient: loggingpb.NewConfigServiceV2Client(connPool),
+ configClient: loggingpb.NewConfigServiceV2Client(connPool),
+ CallOptions: &client.CallOptions,
}
c.setGoogleClientInfo()
- return c, nil
+ client.internalClient = c
+
+ client.LROClient, err = lroauto.NewOperationsClient(ctx, gtransport.WithConnPool(connPool))
+ if err != nil {
+ // This error "should not happen", since we are just reusing old connection pool
+ // and never actually need to dial.
+ // If this does happen, we could leak connp. However, we cannot close conn:
+ // If the user invoked the constructor with option.WithGRPCConn,
+ // we would close a connection that's still in use.
+ // TODO: investigate error conditions.
+ return nil, err
+ }
+ c.LROClient = &client.LROClient
+ return &client, nil
}
// Connection returns a connection to the API service.
//
// Deprecated.
-func (c *ConfigClient) Connection() *grpc.ClientConn {
+func (c *configGRPCClient) Connection() *grpc.ClientConn {
return c.connPool.Conn()
}
-// Close closes the connection to the API service. The user should invoke this when
-// the client is no longer required.
-func (c *ConfigClient) Close() error {
- return c.connPool.Close()
-}
-
// setGoogleClientInfo sets the name and version of the application in
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
-func (c *ConfigClient) setGoogleClientInfo(keyval ...string) {
+func (c *configGRPCClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
- kv = append(kv, "gapic", versionClient, "gax", gax.Version, "grpc", grpc.Version)
+ kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version)
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
-// ListBuckets lists buckets.
-func (c *ConfigClient) ListBuckets(ctx context.Context, req *loggingpb.ListBucketsRequest, opts ...gax.CallOption) *LogBucketIterator {
+// Close closes the connection to the API service. The user should invoke this when
+// the client is no longer required.
+func (c *configGRPCClient) Close() error {
+ return c.connPool.Close()
+}
+
+func (c *configGRPCClient) ListBuckets(ctx context.Context, req *loggingpb.ListBucketsRequest, opts ...gax.CallOption) *LogBucketIterator {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent())))
+
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
- opts = append(c.CallOptions.ListBuckets[0:len(c.CallOptions.ListBuckets):len(c.CallOptions.ListBuckets)], opts...)
+ opts = append((*c.CallOptions).ListBuckets[0:len((*c.CallOptions).ListBuckets):len((*c.CallOptions).ListBuckets)], opts...)
it := &LogBucketIterator{}
req = proto.Clone(req).(*loggingpb.ListBucketsRequest)
it.InternalFetch = func(pageSize int, pageToken string) ([]*loggingpb.LogBucket, string, error) {
- var resp *loggingpb.ListBucketsResponse
- req.PageToken = pageToken
+ resp := &loggingpb.ListBucketsResponse{}
+ if pageToken != "" {
+ req.PageToken = pageToken
+ }
if pageSize > math.MaxInt32 {
req.PageSize = math.MaxInt32
- } else {
+ } else if pageSize != 0 {
req.PageSize = int32(pageSize)
}
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -300,17 +620,19 @@ func (c *ConfigClient) ListBuckets(ctx context.Context, req *loggingpb.ListBucke
it.items = append(it.items, items...)
return nextPageToken, nil
}
+
it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
it.pageInfo.MaxSize = int(req.GetPageSize())
it.pageInfo.Token = req.GetPageToken()
+
return it
}
-// GetBucket gets a bucket.
-func (c *ConfigClient) GetBucket(ctx context.Context, req *loggingpb.GetBucketRequest, opts ...gax.CallOption) (*loggingpb.LogBucket, error) {
+func (c *configGRPCClient) GetBucket(ctx context.Context, req *loggingpb.GetBucketRequest, opts ...gax.CallOption) (*loggingpb.LogBucket, error) {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
- opts = append(c.CallOptions.GetBucket[0:len(c.CallOptions.GetBucket):len(c.CallOptions.GetBucket)], opts...)
+ opts = append((*c.CallOptions).GetBucket[0:len((*c.CallOptions).GetBucket):len((*c.CallOptions).GetBucket)], opts...)
var resp *loggingpb.LogBucket
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -323,12 +645,11 @@ func (c *ConfigClient) GetBucket(ctx context.Context, req *loggingpb.GetBucketRe
return resp, nil
}
-// CreateBucket creates a bucket that can be used to store log entries. Once a bucket has
-// been created, the region cannot be changed.
-func (c *ConfigClient) CreateBucket(ctx context.Context, req *loggingpb.CreateBucketRequest, opts ...gax.CallOption) (*loggingpb.LogBucket, error) {
+func (c *configGRPCClient) CreateBucket(ctx context.Context, req *loggingpb.CreateBucketRequest, opts ...gax.CallOption) (*loggingpb.LogBucket, error) {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent())))
+
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
- opts = append(c.CallOptions.CreateBucket[0:len(c.CallOptions.CreateBucket):len(c.CallOptions.CreateBucket)], opts...)
+ opts = append((*c.CallOptions).CreateBucket[0:len((*c.CallOptions).CreateBucket):len((*c.CallOptions).CreateBucket)], opts...)
var resp *loggingpb.LogBucket
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -341,20 +662,11 @@ func (c *ConfigClient) CreateBucket(ctx context.Context, req *loggingpb.CreateBu
return resp, nil
}
-// UpdateBucket updates a bucket. This method replaces the following fields in the
-// existing bucket with values from the new bucket: retention_period
-//
-// If the retention period is decreased and the bucket is locked,
-// FAILED_PRECONDITION will be returned.
-//
-// If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION
-// will be returned.
-//
-// A buckets region may not be modified after it is created.
-func (c *ConfigClient) UpdateBucket(ctx context.Context, req *loggingpb.UpdateBucketRequest, opts ...gax.CallOption) (*loggingpb.LogBucket, error) {
+func (c *configGRPCClient) UpdateBucket(ctx context.Context, req *loggingpb.UpdateBucketRequest, opts ...gax.CallOption) (*loggingpb.LogBucket, error) {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
- opts = append(c.CallOptions.UpdateBucket[0:len(c.CallOptions.UpdateBucket):len(c.CallOptions.UpdateBucket)], opts...)
+ opts = append((*c.CallOptions).UpdateBucket[0:len((*c.CallOptions).UpdateBucket):len((*c.CallOptions).UpdateBucket)], opts...)
var resp *loggingpb.LogBucket
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -367,14 +679,11 @@ func (c *ConfigClient) UpdateBucket(ctx context.Context, req *loggingpb.UpdateBu
return resp, nil
}
-// DeleteBucket deletes a bucket.
-// Moves the bucket to the DELETE_REQUESTED state. After 7 days, the
-// bucket will be purged and all logs in the bucket will be permanently
-// deleted.
-func (c *ConfigClient) DeleteBucket(ctx context.Context, req *loggingpb.DeleteBucketRequest, opts ...gax.CallOption) error {
+func (c *configGRPCClient) DeleteBucket(ctx context.Context, req *loggingpb.DeleteBucketRequest, opts ...gax.CallOption) error {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
- opts = append(c.CallOptions.DeleteBucket[0:len(c.CallOptions.DeleteBucket):len(c.CallOptions.DeleteBucket)], opts...)
+ opts = append((*c.CallOptions).DeleteBucket[0:len((*c.CallOptions).DeleteBucket):len((*c.CallOptions).DeleteBucket)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
_, err = c.configClient.DeleteBucket(ctx, req, settings.GRPC...)
@@ -383,12 +692,11 @@ func (c *ConfigClient) DeleteBucket(ctx context.Context, req *loggingpb.DeleteBu
return err
}
-// UndeleteBucket undeletes a bucket. A bucket that has been deleted may be undeleted within
-// the grace period of 7 days.
-func (c *ConfigClient) UndeleteBucket(ctx context.Context, req *loggingpb.UndeleteBucketRequest, opts ...gax.CallOption) error {
+func (c *configGRPCClient) UndeleteBucket(ctx context.Context, req *loggingpb.UndeleteBucketRequest, opts ...gax.CallOption) error {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
- opts = append(c.CallOptions.UndeleteBucket[0:len(c.CallOptions.UndeleteBucket):len(c.CallOptions.UndeleteBucket)], opts...)
+ opts = append((*c.CallOptions).UndeleteBucket[0:len((*c.CallOptions).UndeleteBucket):len((*c.CallOptions).UndeleteBucket)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
_, err = c.configClient.UndeleteBucket(ctx, req, settings.GRPC...)
@@ -397,19 +705,21 @@ func (c *ConfigClient) UndeleteBucket(ctx context.Context, req *loggingpb.Undele
return err
}
-// ListViews lists views on a bucket.
-func (c *ConfigClient) ListViews(ctx context.Context, req *loggingpb.ListViewsRequest, opts ...gax.CallOption) *LogViewIterator {
+func (c *configGRPCClient) ListViews(ctx context.Context, req *loggingpb.ListViewsRequest, opts ...gax.CallOption) *LogViewIterator {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent())))
+
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
- opts = append(c.CallOptions.ListViews[0:len(c.CallOptions.ListViews):len(c.CallOptions.ListViews)], opts...)
+ opts = append((*c.CallOptions).ListViews[0:len((*c.CallOptions).ListViews):len((*c.CallOptions).ListViews)], opts...)
it := &LogViewIterator{}
req = proto.Clone(req).(*loggingpb.ListViewsRequest)
it.InternalFetch = func(pageSize int, pageToken string) ([]*loggingpb.LogView, string, error) {
- var resp *loggingpb.ListViewsResponse
- req.PageToken = pageToken
+ resp := &loggingpb.ListViewsResponse{}
+ if pageToken != "" {
+ req.PageToken = pageToken
+ }
if pageSize > math.MaxInt32 {
req.PageSize = math.MaxInt32
- } else {
+ } else if pageSize != 0 {
req.PageSize = int32(pageSize)
}
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -432,17 +742,19 @@ func (c *ConfigClient) ListViews(ctx context.Context, req *loggingpb.ListViewsRe
it.items = append(it.items, items...)
return nextPageToken, nil
}
+
it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
it.pageInfo.MaxSize = int(req.GetPageSize())
it.pageInfo.Token = req.GetPageToken()
+
return it
}
-// GetView gets a view.
-func (c *ConfigClient) GetView(ctx context.Context, req *loggingpb.GetViewRequest, opts ...gax.CallOption) (*loggingpb.LogView, error) {
+func (c *configGRPCClient) GetView(ctx context.Context, req *loggingpb.GetViewRequest, opts ...gax.CallOption) (*loggingpb.LogView, error) {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
- opts = append(c.CallOptions.GetView[0:len(c.CallOptions.GetView):len(c.CallOptions.GetView)], opts...)
+ opts = append((*c.CallOptions).GetView[0:len((*c.CallOptions).GetView):len((*c.CallOptions).GetView)], opts...)
var resp *loggingpb.LogView
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -455,12 +767,11 @@ func (c *ConfigClient) GetView(ctx context.Context, req *loggingpb.GetViewReques
return resp, nil
}
-// CreateView creates a view over logs in a bucket. A bucket may contain a maximum of
-// 50 views.
-func (c *ConfigClient) CreateView(ctx context.Context, req *loggingpb.CreateViewRequest, opts ...gax.CallOption) (*loggingpb.LogView, error) {
+func (c *configGRPCClient) CreateView(ctx context.Context, req *loggingpb.CreateViewRequest, opts ...gax.CallOption) (*loggingpb.LogView, error) {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent())))
+
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
- opts = append(c.CallOptions.CreateView[0:len(c.CallOptions.CreateView):len(c.CallOptions.CreateView)], opts...)
+ opts = append((*c.CallOptions).CreateView[0:len((*c.CallOptions).CreateView):len((*c.CallOptions).CreateView)], opts...)
var resp *loggingpb.LogView
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -473,12 +784,11 @@ func (c *ConfigClient) CreateView(ctx context.Context, req *loggingpb.CreateView
return resp, nil
}
-// UpdateView updates a view. This method replaces the following fields in the existing
-// view with values from the new view: filter.
-func (c *ConfigClient) UpdateView(ctx context.Context, req *loggingpb.UpdateViewRequest, opts ...gax.CallOption) (*loggingpb.LogView, error) {
+func (c *configGRPCClient) UpdateView(ctx context.Context, req *loggingpb.UpdateViewRequest, opts ...gax.CallOption) (*loggingpb.LogView, error) {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
- opts = append(c.CallOptions.UpdateView[0:len(c.CallOptions.UpdateView):len(c.CallOptions.UpdateView)], opts...)
+ opts = append((*c.CallOptions).UpdateView[0:len((*c.CallOptions).UpdateView):len((*c.CallOptions).UpdateView)], opts...)
var resp *loggingpb.LogView
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -491,11 +801,11 @@ func (c *ConfigClient) UpdateView(ctx context.Context, req *loggingpb.UpdateView
return resp, nil
}
-// DeleteView deletes a view from a bucket.
-func (c *ConfigClient) DeleteView(ctx context.Context, req *loggingpb.DeleteViewRequest, opts ...gax.CallOption) error {
+func (c *configGRPCClient) DeleteView(ctx context.Context, req *loggingpb.DeleteViewRequest, opts ...gax.CallOption) error {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
- opts = append(c.CallOptions.DeleteView[0:len(c.CallOptions.DeleteView):len(c.CallOptions.DeleteView)], opts...)
+ opts = append((*c.CallOptions).DeleteView[0:len((*c.CallOptions).DeleteView):len((*c.CallOptions).DeleteView)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
_, err = c.configClient.DeleteView(ctx, req, settings.GRPC...)
@@ -504,19 +814,21 @@ func (c *ConfigClient) DeleteView(ctx context.Context, req *loggingpb.DeleteView
return err
}
-// ListSinks lists sinks.
-func (c *ConfigClient) ListSinks(ctx context.Context, req *loggingpb.ListSinksRequest, opts ...gax.CallOption) *LogSinkIterator {
+func (c *configGRPCClient) ListSinks(ctx context.Context, req *loggingpb.ListSinksRequest, opts ...gax.CallOption) *LogSinkIterator {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent())))
+
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
- opts = append(c.CallOptions.ListSinks[0:len(c.CallOptions.ListSinks):len(c.CallOptions.ListSinks)], opts...)
+ opts = append((*c.CallOptions).ListSinks[0:len((*c.CallOptions).ListSinks):len((*c.CallOptions).ListSinks)], opts...)
it := &LogSinkIterator{}
req = proto.Clone(req).(*loggingpb.ListSinksRequest)
it.InternalFetch = func(pageSize int, pageToken string) ([]*loggingpb.LogSink, string, error) {
- var resp *loggingpb.ListSinksResponse
- req.PageToken = pageToken
+ resp := &loggingpb.ListSinksResponse{}
+ if pageToken != "" {
+ req.PageToken = pageToken
+ }
if pageSize > math.MaxInt32 {
req.PageSize = math.MaxInt32
- } else {
+ } else if pageSize != 0 {
req.PageSize = int32(pageSize)
}
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -539,22 +851,24 @@ func (c *ConfigClient) ListSinks(ctx context.Context, req *loggingpb.ListSinksRe
it.items = append(it.items, items...)
return nextPageToken, nil
}
+
it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
it.pageInfo.MaxSize = int(req.GetPageSize())
it.pageInfo.Token = req.GetPageToken()
+
return it
}
-// GetSink gets a sink.
-func (c *ConfigClient) GetSink(ctx context.Context, req *loggingpb.GetSinkRequest, opts ...gax.CallOption) (*loggingpb.LogSink, error) {
+func (c *configGRPCClient) GetSink(ctx context.Context, req *loggingpb.GetSinkRequest, opts ...gax.CallOption) (*loggingpb.LogSink, error) {
if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines {
cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond)
defer cancel()
ctx = cctx
}
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "sink_name", url.QueryEscape(req.GetSinkName())))
+
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
- opts = append(c.CallOptions.GetSink[0:len(c.CallOptions.GetSink):len(c.CallOptions.GetSink)], opts...)
+ opts = append((*c.CallOptions).GetSink[0:len((*c.CallOptions).GetSink):len((*c.CallOptions).GetSink)], opts...)
var resp *loggingpb.LogSink
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -567,19 +881,16 @@ func (c *ConfigClient) GetSink(ctx context.Context, req *loggingpb.GetSinkReques
return resp, nil
}
-// CreateSink creates a sink that exports specified log entries to a destination. The
-// export of newly-ingested log entries begins immediately, unless the sink’s
-// writer_identity is not permitted to write to the destination. A sink can
-// export log entries only from the resource owning the sink.
-func (c *ConfigClient) CreateSink(ctx context.Context, req *loggingpb.CreateSinkRequest, opts ...gax.CallOption) (*loggingpb.LogSink, error) {
+func (c *configGRPCClient) CreateSink(ctx context.Context, req *loggingpb.CreateSinkRequest, opts ...gax.CallOption) (*loggingpb.LogSink, error) {
if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines {
cctx, cancel := context.WithTimeout(ctx, 120000*time.Millisecond)
defer cancel()
ctx = cctx
}
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent())))
+
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
- opts = append(c.CallOptions.CreateSink[0:len(c.CallOptions.CreateSink):len(c.CallOptions.CreateSink)], opts...)
+ opts = append((*c.CallOptions).CreateSink[0:len((*c.CallOptions).CreateSink):len((*c.CallOptions).CreateSink)], opts...)
var resp *loggingpb.LogSink
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -592,20 +903,16 @@ func (c *ConfigClient) CreateSink(ctx context.Context, req *loggingpb.CreateSink
return resp, nil
}
-// UpdateSink updates a sink. This method replaces the following fields in the existing
-// sink with values from the new sink: destination, and filter.
-//
-// The updated sink might also have a new writer_identity; see the
-// unique_writer_identity field.
-func (c *ConfigClient) UpdateSink(ctx context.Context, req *loggingpb.UpdateSinkRequest, opts ...gax.CallOption) (*loggingpb.LogSink, error) {
+func (c *configGRPCClient) UpdateSink(ctx context.Context, req *loggingpb.UpdateSinkRequest, opts ...gax.CallOption) (*loggingpb.LogSink, error) {
if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines {
cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond)
defer cancel()
ctx = cctx
}
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "sink_name", url.QueryEscape(req.GetSinkName())))
+
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
- opts = append(c.CallOptions.UpdateSink[0:len(c.CallOptions.UpdateSink):len(c.CallOptions.UpdateSink)], opts...)
+ opts = append((*c.CallOptions).UpdateSink[0:len((*c.CallOptions).UpdateSink):len((*c.CallOptions).UpdateSink)], opts...)
var resp *loggingpb.LogSink
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -618,17 +925,16 @@ func (c *ConfigClient) UpdateSink(ctx context.Context, req *loggingpb.UpdateSink
return resp, nil
}
-// DeleteSink deletes a sink. If the sink has a unique writer_identity, then that
-// service account is also deleted.
-func (c *ConfigClient) DeleteSink(ctx context.Context, req *loggingpb.DeleteSinkRequest, opts ...gax.CallOption) error {
+func (c *configGRPCClient) DeleteSink(ctx context.Context, req *loggingpb.DeleteSinkRequest, opts ...gax.CallOption) error {
if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines {
cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond)
defer cancel()
ctx = cctx
}
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "sink_name", url.QueryEscape(req.GetSinkName())))
+
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
- opts = append(c.CallOptions.DeleteSink[0:len(c.CallOptions.DeleteSink):len(c.CallOptions.DeleteSink)], opts...)
+ opts = append((*c.CallOptions).DeleteSink[0:len((*c.CallOptions).DeleteSink):len((*c.CallOptions).DeleteSink)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
_, err = c.configClient.DeleteSink(ctx, req, settings.GRPC...)
@@ -637,19 +943,21 @@ func (c *ConfigClient) DeleteSink(ctx context.Context, req *loggingpb.DeleteSink
return err
}
-// ListExclusions lists all the exclusions in a parent resource.
-func (c *ConfigClient) ListExclusions(ctx context.Context, req *loggingpb.ListExclusionsRequest, opts ...gax.CallOption) *LogExclusionIterator {
+func (c *configGRPCClient) ListExclusions(ctx context.Context, req *loggingpb.ListExclusionsRequest, opts ...gax.CallOption) *LogExclusionIterator {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent())))
+
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
- opts = append(c.CallOptions.ListExclusions[0:len(c.CallOptions.ListExclusions):len(c.CallOptions.ListExclusions)], opts...)
+ opts = append((*c.CallOptions).ListExclusions[0:len((*c.CallOptions).ListExclusions):len((*c.CallOptions).ListExclusions)], opts...)
it := &LogExclusionIterator{}
req = proto.Clone(req).(*loggingpb.ListExclusionsRequest)
it.InternalFetch = func(pageSize int, pageToken string) ([]*loggingpb.LogExclusion, string, error) {
- var resp *loggingpb.ListExclusionsResponse
- req.PageToken = pageToken
+ resp := &loggingpb.ListExclusionsResponse{}
+ if pageToken != "" {
+ req.PageToken = pageToken
+ }
if pageSize > math.MaxInt32 {
req.PageSize = math.MaxInt32
- } else {
+ } else if pageSize != 0 {
req.PageSize = int32(pageSize)
}
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -672,22 +980,24 @@ func (c *ConfigClient) ListExclusions(ctx context.Context, req *loggingpb.ListEx
it.items = append(it.items, items...)
return nextPageToken, nil
}
+
it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
it.pageInfo.MaxSize = int(req.GetPageSize())
it.pageInfo.Token = req.GetPageToken()
+
return it
}
-// GetExclusion gets the description of an exclusion.
-func (c *ConfigClient) GetExclusion(ctx context.Context, req *loggingpb.GetExclusionRequest, opts ...gax.CallOption) (*loggingpb.LogExclusion, error) {
+func (c *configGRPCClient) GetExclusion(ctx context.Context, req *loggingpb.GetExclusionRequest, opts ...gax.CallOption) (*loggingpb.LogExclusion, error) {
if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines {
cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond)
defer cancel()
ctx = cctx
}
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
- opts = append(c.CallOptions.GetExclusion[0:len(c.CallOptions.GetExclusion):len(c.CallOptions.GetExclusion)], opts...)
+ opts = append((*c.CallOptions).GetExclusion[0:len((*c.CallOptions).GetExclusion):len((*c.CallOptions).GetExclusion)], opts...)
var resp *loggingpb.LogExclusion
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -700,18 +1010,16 @@ func (c *ConfigClient) GetExclusion(ctx context.Context, req *loggingpb.GetExclu
return resp, nil
}
-// CreateExclusion creates a new exclusion in a specified parent resource.
-// Only log entries belonging to that resource can be excluded.
-// You can have up to 10 exclusions in a resource.
-func (c *ConfigClient) CreateExclusion(ctx context.Context, req *loggingpb.CreateExclusionRequest, opts ...gax.CallOption) (*loggingpb.LogExclusion, error) {
+func (c *configGRPCClient) CreateExclusion(ctx context.Context, req *loggingpb.CreateExclusionRequest, opts ...gax.CallOption) (*loggingpb.LogExclusion, error) {
if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines {
cctx, cancel := context.WithTimeout(ctx, 120000*time.Millisecond)
defer cancel()
ctx = cctx
}
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent())))
+
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
- opts = append(c.CallOptions.CreateExclusion[0:len(c.CallOptions.CreateExclusion):len(c.CallOptions.CreateExclusion)], opts...)
+ opts = append((*c.CallOptions).CreateExclusion[0:len((*c.CallOptions).CreateExclusion):len((*c.CallOptions).CreateExclusion)], opts...)
var resp *loggingpb.LogExclusion
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -724,16 +1032,16 @@ func (c *ConfigClient) CreateExclusion(ctx context.Context, req *loggingpb.Creat
return resp, nil
}
-// UpdateExclusion changes one or more properties of an existing exclusion.
-func (c *ConfigClient) UpdateExclusion(ctx context.Context, req *loggingpb.UpdateExclusionRequest, opts ...gax.CallOption) (*loggingpb.LogExclusion, error) {
+func (c *configGRPCClient) UpdateExclusion(ctx context.Context, req *loggingpb.UpdateExclusionRequest, opts ...gax.CallOption) (*loggingpb.LogExclusion, error) {
if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines {
cctx, cancel := context.WithTimeout(ctx, 120000*time.Millisecond)
defer cancel()
ctx = cctx
}
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
- opts = append(c.CallOptions.UpdateExclusion[0:len(c.CallOptions.UpdateExclusion):len(c.CallOptions.UpdateExclusion)], opts...)
+ opts = append((*c.CallOptions).UpdateExclusion[0:len((*c.CallOptions).UpdateExclusion):len((*c.CallOptions).UpdateExclusion)], opts...)
var resp *loggingpb.LogExclusion
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -746,16 +1054,16 @@ func (c *ConfigClient) UpdateExclusion(ctx context.Context, req *loggingpb.Updat
return resp, nil
}
-// DeleteExclusion deletes an exclusion.
-func (c *ConfigClient) DeleteExclusion(ctx context.Context, req *loggingpb.DeleteExclusionRequest, opts ...gax.CallOption) error {
+func (c *configGRPCClient) DeleteExclusion(ctx context.Context, req *loggingpb.DeleteExclusionRequest, opts ...gax.CallOption) error {
if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines {
cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond)
defer cancel()
ctx = cctx
}
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
- opts = append(c.CallOptions.DeleteExclusion[0:len(c.CallOptions.DeleteExclusion):len(c.CallOptions.DeleteExclusion)], opts...)
+ opts = append((*c.CallOptions).DeleteExclusion[0:len((*c.CallOptions).DeleteExclusion):len((*c.CallOptions).DeleteExclusion)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
_, err = c.configClient.DeleteExclusion(ctx, req, settings.GRPC...)
@@ -764,19 +1072,11 @@ func (c *ConfigClient) DeleteExclusion(ctx context.Context, req *loggingpb.Delet
return err
}
-// GetCmekSettings gets the Logs Router CMEK settings for the given resource.
-//
-// Note: CMEK for the Logs Router can currently only be configured for GCP
-// organizations. Once configured, it applies to all projects and folders in
-// the GCP organization.
-//
-// See Enabling CMEK for Logs
-// Router (at https://cloud.google.com/logging/docs/routing/managed-encryption)
-// for more information.
-func (c *ConfigClient) GetCmekSettings(ctx context.Context, req *loggingpb.GetCmekSettingsRequest, opts ...gax.CallOption) (*loggingpb.CmekSettings, error) {
+func (c *configGRPCClient) GetCmekSettings(ctx context.Context, req *loggingpb.GetCmekSettingsRequest, opts ...gax.CallOption) (*loggingpb.CmekSettings, error) {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
- opts = append(c.CallOptions.GetCmekSettings[0:len(c.CallOptions.GetCmekSettings):len(c.CallOptions.GetCmekSettings)], opts...)
+ opts = append((*c.CallOptions).GetCmekSettings[0:len((*c.CallOptions).GetCmekSettings):len((*c.CallOptions).GetCmekSettings)], opts...)
var resp *loggingpb.CmekSettings
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -789,25 +1089,11 @@ func (c *ConfigClient) GetCmekSettings(ctx context.Context, req *loggingpb.GetCm
return resp, nil
}
-// UpdateCmekSettings updates the Logs Router CMEK settings for the given resource.
-//
-// Note: CMEK for the Logs Router can currently only be configured for GCP
-// organizations. Once configured, it applies to all projects and folders in
-// the GCP organization.
-//
-// UpdateCmekSettings
-// will fail if 1) kms_key_name is invalid, or 2) the associated service
-// account does not have the required
-// roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key, or
-// 3) access to the key is disabled.
-//
-// See Enabling CMEK for Logs
-// Router (at https://cloud.google.com/logging/docs/routing/managed-encryption)
-// for more information.
-func (c *ConfigClient) UpdateCmekSettings(ctx context.Context, req *loggingpb.UpdateCmekSettingsRequest, opts ...gax.CallOption) (*loggingpb.CmekSettings, error) {
+func (c *configGRPCClient) UpdateCmekSettings(ctx context.Context, req *loggingpb.UpdateCmekSettingsRequest, opts ...gax.CallOption) (*loggingpb.CmekSettings, error) {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
- opts = append(c.CallOptions.UpdateCmekSettings[0:len(c.CallOptions.UpdateCmekSettings):len(c.CallOptions.UpdateCmekSettings)], opts...)
+ opts = append((*c.CallOptions).UpdateCmekSettings[0:len((*c.CallOptions).UpdateCmekSettings):len((*c.CallOptions).UpdateCmekSettings)], opts...)
var resp *loggingpb.CmekSettings
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -820,6 +1106,126 @@ func (c *ConfigClient) UpdateCmekSettings(ctx context.Context, req *loggingpb.Up
return resp, nil
}
+func (c *configGRPCClient) GetSettings(ctx context.Context, req *loggingpb.GetSettingsRequest, opts ...gax.CallOption) (*loggingpb.Settings, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).GetSettings[0:len((*c.CallOptions).GetSettings):len((*c.CallOptions).GetSettings)], opts...)
+ var resp *loggingpb.Settings
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.configClient.GetSettings(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *configGRPCClient) UpdateSettings(ctx context.Context, req *loggingpb.UpdateSettingsRequest, opts ...gax.CallOption) (*loggingpb.Settings, error) {
+ md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "name", url.QueryEscape(req.GetName())))
+
+ ctx = insertMetadata(ctx, c.xGoogMetadata, md)
+ opts = append((*c.CallOptions).UpdateSettings[0:len((*c.CallOptions).UpdateSettings):len((*c.CallOptions).UpdateSettings)], opts...)
+ var resp *loggingpb.Settings
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.configClient.UpdateSettings(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
+
+func (c *configGRPCClient) CopyLogEntries(ctx context.Context, req *loggingpb.CopyLogEntriesRequest, opts ...gax.CallOption) (*CopyLogEntriesOperation, error) {
+ ctx = insertMetadata(ctx, c.xGoogMetadata)
+ opts = append((*c.CallOptions).CopyLogEntries[0:len((*c.CallOptions).CopyLogEntries):len((*c.CallOptions).CopyLogEntries)], opts...)
+ var resp *longrunningpb.Operation
+ err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
+ var err error
+ resp, err = c.configClient.CopyLogEntries(ctx, req, settings.GRPC...)
+ return err
+ }, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return &CopyLogEntriesOperation{
+ lro: longrunning.InternalNewOperation(*c.LROClient, resp),
+ }, nil
+}
+
+// CopyLogEntriesOperation manages a long-running operation from CopyLogEntries.
+type CopyLogEntriesOperation struct {
+ lro *longrunning.Operation
+}
+
+// CopyLogEntriesOperation returns a new CopyLogEntriesOperation from a given name.
+// The name must be that of a previously created CopyLogEntriesOperation, possibly from a different process.
+func (c *configGRPCClient) CopyLogEntriesOperation(name string) *CopyLogEntriesOperation {
+ return &CopyLogEntriesOperation{
+ lro: longrunning.InternalNewOperation(*c.LROClient, &longrunningpb.Operation{Name: name}),
+ }
+}
+
+// Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
+//
+// See documentation of Poll for error-handling information.
+func (op *CopyLogEntriesOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*loggingpb.CopyLogEntriesResponse, error) {
+ var resp loggingpb.CopyLogEntriesResponse
+ if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
+ return nil, err
+ }
+ return &resp, nil
+}
+
+// Poll fetches the latest state of the long-running operation.
+//
+// Poll also fetches the latest metadata, which can be retrieved by Metadata.
+//
+// If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
+// the operation has completed with failure, the error is returned and op.Done will return true.
+// If Poll succeeds and the operation has completed successfully,
+// op.Done will return true, and the response of the operation is returned.
+// If Poll succeeds and the operation has not completed, the returned response and error are both nil.
+func (op *CopyLogEntriesOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*loggingpb.CopyLogEntriesResponse, error) {
+ var resp loggingpb.CopyLogEntriesResponse
+ if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
+ return nil, err
+ }
+ if !op.Done() {
+ return nil, nil
+ }
+ return &resp, nil
+}
+
+// Metadata returns metadata associated with the long-running operation.
+// Metadata itself does not contact the server, but Poll does.
+// To get the latest metadata, call this method after a successful call to Poll.
+// If the metadata is not available, the returned metadata and error are both nil.
+func (op *CopyLogEntriesOperation) Metadata() (*loggingpb.CopyLogEntriesMetadata, error) {
+ var meta loggingpb.CopyLogEntriesMetadata
+ if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
+ return nil, nil
+ } else if err != nil {
+ return nil, err
+ }
+ return &meta, nil
+}
+
+// Done reports whether the long-running operation has completed.
+func (op *CopyLogEntriesOperation) Done() bool {
+ return op.lro.Done()
+}
+
+// Name returns the name of the long-running operation.
+// The name is assigned by the server and is unique within the service from which the operation is created.
+func (op *CopyLogEntriesOperation) Name() string {
+ return op.lro.Name()
+}
+
// LogBucketIterator manages a stream of *loggingpb.LogBucket.
type LogBucketIterator struct {
items []*loggingpb.LogBucket
diff --git a/vendor/cloud.google.com/go/logging/apiv2/doc.go b/vendor/cloud.google.com/go/logging/apiv2/doc.go
index f4dd7cc05..4fcf15399 100644
--- a/vendor/cloud.google.com/go/logging/apiv2/doc.go
+++ b/vendor/cloud.google.com/go/logging/apiv2/doc.go
@@ -1,4 +1,4 @@
-// Copyright 2021 Google LLC
+// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -17,10 +17,41 @@
// Package logging is an auto-generated package for the
// Cloud Logging API.
//
-// Writes log entries and manages your Cloud Logging configuration. The table
-// entries below are presented in alphabetical order, not in order of common
-// use. For explanations of the concepts found in the table entries, read the
-// documentation at https://cloud.google.com/logging/docs.
+// Writes log entries and manages your Cloud Logging configuration.
+//
+// Example usage
+//
+// To get started with this package, create a client.
+// ctx := context.Background()
+// c, err := logging.NewClient(ctx)
+// if err != nil {
+// // TODO: Handle error.
+// }
+// defer c.Close()
+//
+// The client will use your default application credentials. Clients should be reused instead of created as needed.
+// The methods of Client are safe for concurrent use by multiple goroutines.
+// The returned client must be Closed when it is done being used.
+//
+// Using the Client
+//
+// The following is an example of making an API call with the newly created client.
+//
+// ctx := context.Background()
+// c, err := logging.NewClient(ctx)
+// if err != nil {
+// // TODO: Handle error.
+// }
+// defer c.Close()
+//
+// req := &loggingpb.DeleteLogRequest{
+// // TODO: Fill request struct fields.
+// // See https://pkg.go.dev/google.golang.org/genproto/googleapis/logging/v2#DeleteLogRequest.
+// }
+// err = c.DeleteLog(ctx, req)
+// if err != nil {
+// // TODO: Handle error.
+// }
//
// Use of Context
//
@@ -31,7 +62,7 @@
// To close the open connection, use the Close() method.
//
// For information about setting deadlines, reusing contexts, and more
-// please visit pkg.go.dev/cloud.google.com/go.
+// please visit https://pkg.go.dev/cloud.google.com/go.
package logging // import "cloud.google.com/go/logging/apiv2"
import (
@@ -51,7 +82,14 @@ import (
type clientHookParams struct{}
type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error)
-const versionClient = "20210518"
+var versionClient string
+
+func getVersionClient() string {
+ if versionClient == "" {
+ return "UNKNOWN"
+ }
+ return versionClient
+}
func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
out, _ := metadata.FromOutgoingContext(ctx)
diff --git a/vendor/cloud.google.com/go/logging/apiv2/gapic_metadata.json b/vendor/cloud.google.com/go/logging/apiv2/gapic_metadata.json
index 63cb6a90b..b125a4fa1 100644
--- a/vendor/cloud.google.com/go/logging/apiv2/gapic_metadata.json
+++ b/vendor/cloud.google.com/go/logging/apiv2/gapic_metadata.json
@@ -1,127 +1,142 @@
{
- "schema": "1.0",
- "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.",
- "language": "go",
- "protoPackage": "google.logging.v2",
- "libraryPackage": "cloud.google.com/go/logging/apiv2",
- "services": {
- "ConfigServiceV2": {
- "clients": {
- "grpc": {
- "libraryClient": "ConfigClient",
- "rpcs": {
- "CreateBucket": {
- "methods": [
+ "schema": "1.0",
+ "comment": "This file maps proto services/RPCs to the corresponding library clients/methods.",
+ "language": "go",
+ "protoPackage": "google.logging.v2",
+ "libraryPackage": "cloud.google.com/go/logging/apiv2",
+ "services": {
+ "ConfigServiceV2": {
+ "clients": {
+ "grpc": {
+ "libraryClient": "ConfigClient",
+ "rpcs": {
+ "CopyLogEntries": {
+ "methods": [
+ "CopyLogEntries"
+ ]
+ },
+ "CreateBucket": {
+ "methods": [
"CreateBucket"
]
},
- "CreateExclusion": {
- "methods": [
+ "CreateExclusion": {
+ "methods": [
"CreateExclusion"
]
},
- "CreateSink": {
- "methods": [
+ "CreateSink": {
+ "methods": [
"CreateSink"
]
},
- "CreateView": {
- "methods": [
+ "CreateView": {
+ "methods": [
"CreateView"
]
},
- "DeleteBucket": {
- "methods": [
+ "DeleteBucket": {
+ "methods": [
"DeleteBucket"
]
},
- "DeleteExclusion": {
- "methods": [
+ "DeleteExclusion": {
+ "methods": [
"DeleteExclusion"
]
},
- "DeleteSink": {
- "methods": [
+ "DeleteSink": {
+ "methods": [
"DeleteSink"
]
},
- "DeleteView": {
- "methods": [
+ "DeleteView": {
+ "methods": [
"DeleteView"
]
},
- "GetBucket": {
- "methods": [
+ "GetBucket": {
+ "methods": [
"GetBucket"
]
},
- "GetCmekSettings": {
- "methods": [
+ "GetCmekSettings": {
+ "methods": [
"GetCmekSettings"
]
},
- "GetExclusion": {
- "methods": [
+ "GetExclusion": {
+ "methods": [
"GetExclusion"
]
},
- "GetSink": {
- "methods": [
+ "GetSettings": {
+ "methods": [
+ "GetSettings"
+ ]
+ },
+ "GetSink": {
+ "methods": [
"GetSink"
]
},
- "GetView": {
- "methods": [
+ "GetView": {
+ "methods": [
"GetView"
]
},
- "ListBuckets": {
- "methods": [
+ "ListBuckets": {
+ "methods": [
"ListBuckets"
]
},
- "ListExclusions": {
- "methods": [
+ "ListExclusions": {
+ "methods": [
"ListExclusions"
]
},
- "ListSinks": {
- "methods": [
+ "ListSinks": {
+ "methods": [
"ListSinks"
]
},
- "ListViews": {
- "methods": [
+ "ListViews": {
+ "methods": [
"ListViews"
]
},
- "UndeleteBucket": {
- "methods": [
+ "UndeleteBucket": {
+ "methods": [
"UndeleteBucket"
]
},
- "UpdateBucket": {
- "methods": [
+ "UpdateBucket": {
+ "methods": [
"UpdateBucket"
]
},
- "UpdateCmekSettings": {
- "methods": [
+ "UpdateCmekSettings": {
+ "methods": [
"UpdateCmekSettings"
]
},
- "UpdateExclusion": {
- "methods": [
+ "UpdateExclusion": {
+ "methods": [
"UpdateExclusion"
]
},
- "UpdateSink": {
- "methods": [
+ "UpdateSettings": {
+ "methods": [
+ "UpdateSettings"
+ ]
+ },
+ "UpdateSink": {
+ "methods": [
"UpdateSink"
]
},
- "UpdateView": {
- "methods": [
+ "UpdateView": {
+ "methods": [
"UpdateView"
]
}
@@ -129,38 +144,38 @@
}
}
},
- "LoggingServiceV2": {
- "clients": {
- "grpc": {
- "libraryClient": "Client",
- "rpcs": {
- "DeleteLog": {
- "methods": [
+ "LoggingServiceV2": {
+ "clients": {
+ "grpc": {
+ "libraryClient": "Client",
+ "rpcs": {
+ "DeleteLog": {
+ "methods": [
"DeleteLog"
]
},
- "ListLogEntries": {
- "methods": [
+ "ListLogEntries": {
+ "methods": [
"ListLogEntries"
]
},
- "ListLogs": {
- "methods": [
+ "ListLogs": {
+ "methods": [
"ListLogs"
]
},
- "ListMonitoredResourceDescriptors": {
- "methods": [
+ "ListMonitoredResourceDescriptors": {
+ "methods": [
"ListMonitoredResourceDescriptors"
]
},
- "TailLogEntries": {
- "methods": [
+ "TailLogEntries": {
+ "methods": [
"TailLogEntries"
]
},
- "WriteLogEntries": {
- "methods": [
+ "WriteLogEntries": {
+ "methods": [
"WriteLogEntries"
]
}
@@ -168,33 +183,33 @@
}
}
},
- "MetricsServiceV2": {
- "clients": {
- "grpc": {
- "libraryClient": "MetricsClient",
- "rpcs": {
- "CreateLogMetric": {
- "methods": [
+ "MetricsServiceV2": {
+ "clients": {
+ "grpc": {
+ "libraryClient": "MetricsClient",
+ "rpcs": {
+ "CreateLogMetric": {
+ "methods": [
"CreateLogMetric"
]
},
- "DeleteLogMetric": {
- "methods": [
+ "DeleteLogMetric": {
+ "methods": [
"DeleteLogMetric"
]
},
- "GetLogMetric": {
- "methods": [
+ "GetLogMetric": {
+ "methods": [
"GetLogMetric"
]
},
- "ListLogMetrics": {
- "methods": [
+ "ListLogMetrics": {
+ "methods": [
"ListLogMetrics"
]
},
- "UpdateLogMetric": {
- "methods": [
+ "UpdateLogMetric": {
+ "methods": [
"UpdateLogMetric"
]
}
diff --git a/vendor/cloud.google.com/go/logging/apiv2/logging_client.go b/vendor/cloud.google.com/go/logging/apiv2/logging_client.go
index 2ee165ce1..fdea038c4 100644
--- a/vendor/cloud.google.com/go/logging/apiv2/logging_client.go
+++ b/vendor/cloud.google.com/go/logging/apiv2/logging_client.go
@@ -1,4 +1,4 @@
-// Copyright 2021 Google LLC
+// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -23,7 +23,6 @@ import (
"net/url"
"time"
- "github.com/golang/protobuf/proto"
gax "github.com/googleapis/gax-go/v2"
"google.golang.org/api/iterator"
"google.golang.org/api/option"
@@ -34,6 +33,7 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/metadata"
+ "google.golang.org/protobuf/proto"
)
var newClientHook clientHook
@@ -48,13 +48,13 @@ type CallOptions struct {
TailLogEntries []gax.CallOption
}
-func defaultClientOptions() []option.ClientOption {
+func defaultGRPCClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("logging.googleapis.com:443"),
internaloption.WithDefaultMTLSEndpoint("logging.mtls.googleapis.com:443"),
internaloption.WithDefaultAudience("https://logging.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
- option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
+ internaloption.EnableJwtWithScope(),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
}
@@ -143,32 +143,123 @@ func defaultCallOptions() *CallOptions {
}
}
+// internalClient is an interface that defines the methods available from Cloud Logging API.
+type internalClient interface {
+ Close() error
+ setGoogleClientInfo(...string)
+ Connection() *grpc.ClientConn
+ DeleteLog(context.Context, *loggingpb.DeleteLogRequest, ...gax.CallOption) error
+ WriteLogEntries(context.Context, *loggingpb.WriteLogEntriesRequest, ...gax.CallOption) (*loggingpb.WriteLogEntriesResponse, error)
+ ListLogEntries(context.Context, *loggingpb.ListLogEntriesRequest, ...gax.CallOption) *LogEntryIterator
+ ListMonitoredResourceDescriptors(context.Context, *loggingpb.ListMonitoredResourceDescriptorsRequest, ...gax.CallOption) *MonitoredResourceDescriptorIterator
+ ListLogs(context.Context, *loggingpb.ListLogsRequest, ...gax.CallOption) *StringIterator
+ TailLogEntries(context.Context, ...gax.CallOption) (loggingpb.LoggingServiceV2_TailLogEntriesClient, error)
+}
+
// Client is a client for interacting with Cloud Logging API.
-//
// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
+//
+// Service for ingesting and querying logs.
type Client struct {
+ // The internal transport-dependent client.
+ internalClient internalClient
+
+ // The call options for this service.
+ CallOptions *CallOptions
+}
+
+// Wrapper methods routed to the internal client.
+
+// Close closes the connection to the API service. The user should invoke this when
+// the client is no longer required.
+func (c *Client) Close() error {
+ return c.internalClient.Close()
+}
+
+// setGoogleClientInfo sets the name and version of the application in
+// the `x-goog-api-client` header passed on each request. Intended for
+// use by Google-written clients.
+func (c *Client) setGoogleClientInfo(keyval ...string) {
+ c.internalClient.setGoogleClientInfo(keyval...)
+}
+
+// Connection returns a connection to the API service.
+//
+// Deprecated.
+func (c *Client) Connection() *grpc.ClientConn {
+ return c.internalClient.Connection()
+}
+
+// DeleteLog deletes all the log entries in a log for the _Default Log Bucket. The log
+// reappears if it receives new entries. Log entries written shortly before
+// the delete operation might not be deleted. Entries received after the
+// delete operation with a timestamp before the operation will be deleted.
+func (c *Client) DeleteLog(ctx context.Context, req *loggingpb.DeleteLogRequest, opts ...gax.CallOption) error {
+ return c.internalClient.DeleteLog(ctx, req, opts...)
+}
+
+// WriteLogEntries writes log entries to Logging. This API method is the
+// only way to send log entries to Logging. This method
+// is used, directly or indirectly, by the Logging agent
+// (fluentd) and all logging libraries configured to use Logging.
+// A single request may contain log entries for a maximum of 1000
+// different resources (projects, organizations, billing accounts or
+// folders)
+func (c *Client) WriteLogEntries(ctx context.Context, req *loggingpb.WriteLogEntriesRequest, opts ...gax.CallOption) (*loggingpb.WriteLogEntriesResponse, error) {
+ return c.internalClient.WriteLogEntries(ctx, req, opts...)
+}
+
+// ListLogEntries lists log entries. Use this method to retrieve log entries that originated
+// from a project/folder/organization/billing account. For ways to export log
+// entries, see Exporting
+// Logs (at https://cloud.google.com/logging/docs/export).
+func (c *Client) ListLogEntries(ctx context.Context, req *loggingpb.ListLogEntriesRequest, opts ...gax.CallOption) *LogEntryIterator {
+ return c.internalClient.ListLogEntries(ctx, req, opts...)
+}
+
+// ListMonitoredResourceDescriptors lists the descriptors for monitored resource types used by Logging.
+func (c *Client) ListMonitoredResourceDescriptors(ctx context.Context, req *loggingpb.ListMonitoredResourceDescriptorsRequest, opts ...gax.CallOption) *MonitoredResourceDescriptorIterator {
+ return c.internalClient.ListMonitoredResourceDescriptors(ctx, req, opts...)
+}
+
+// ListLogs lists the logs in projects, organizations, folders, or billing accounts.
+// Only logs that have entries are listed.
+func (c *Client) ListLogs(ctx context.Context, req *loggingpb.ListLogsRequest, opts ...gax.CallOption) *StringIterator {
+ return c.internalClient.ListLogs(ctx, req, opts...)
+}
+
+// TailLogEntries streaming read of log entries as they are ingested. Until the stream is
+// terminated, it will continue reading logs.
+func (c *Client) TailLogEntries(ctx context.Context, opts ...gax.CallOption) (loggingpb.LoggingServiceV2_TailLogEntriesClient, error) {
+ return c.internalClient.TailLogEntries(ctx, opts...)
+}
+
+// gRPCClient is a client for interacting with Cloud Logging API over gRPC transport.
+//
+// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
+type gRPCClient struct {
// Connection pool of gRPC connections to the service.
connPool gtransport.ConnPool
// flag to opt out of default deadlines via GOOGLE_API_GO_EXPERIMENTAL_DISABLE_DEFAULT_DEADLINE
disableDeadlines bool
+ // Points back to the CallOptions field of the containing Client
+ CallOptions **CallOptions
+
// The gRPC API client.
client loggingpb.LoggingServiceV2Client
- // The call options for this service.
- CallOptions *CallOptions
-
// The x-goog-* metadata to be sent with each request.
xGoogMetadata metadata.MD
}
-// NewClient creates a new logging service v2 client.
+// NewClient creates a new logging service v2 client based on gRPC.
+// The returned client must be Closed when it is done being used to clean up its underlying connections.
//
// Service for ingesting and querying logs.
func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error) {
- clientOpts := defaultClientOptions()
-
+ clientOpts := defaultGRPCClientOptions()
if newClientHook != nil {
hookOpts, err := newClientHook(ctx, clientHookParams{})
if err != nil {
@@ -186,53 +277,53 @@ func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error
if err != nil {
return nil, err
}
- c := &Client{
+ client := Client{CallOptions: defaultCallOptions()}
+
+ c := &gRPCClient{
connPool: connPool,
disableDeadlines: disableDeadlines,
- CallOptions: defaultCallOptions(),
-
- client: loggingpb.NewLoggingServiceV2Client(connPool),
+ client: loggingpb.NewLoggingServiceV2Client(connPool),
+ CallOptions: &client.CallOptions,
}
c.setGoogleClientInfo()
- return c, nil
+ client.internalClient = c
+
+ return &client, nil
}
// Connection returns a connection to the API service.
//
// Deprecated.
-func (c *Client) Connection() *grpc.ClientConn {
+func (c *gRPCClient) Connection() *grpc.ClientConn {
return c.connPool.Conn()
}
-// Close closes the connection to the API service. The user should invoke this when
-// the client is no longer required.
-func (c *Client) Close() error {
- return c.connPool.Close()
-}
-
// setGoogleClientInfo sets the name and version of the application in
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
-func (c *Client) setGoogleClientInfo(keyval ...string) {
+func (c *gRPCClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
- kv = append(kv, "gapic", versionClient, "gax", gax.Version, "grpc", grpc.Version)
+ kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version)
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
-// DeleteLog deletes all the log entries in a log. The log reappears if it receives new
-// entries. Log entries written shortly before the delete operation might not
-// be deleted. Entries received after the delete operation with a timestamp
-// before the operation will be deleted.
-func (c *Client) DeleteLog(ctx context.Context, req *loggingpb.DeleteLogRequest, opts ...gax.CallOption) error {
+// Close closes the connection to the API service. The user should invoke this when
+// the client is no longer required.
+func (c *gRPCClient) Close() error {
+ return c.connPool.Close()
+}
+
+func (c *gRPCClient) DeleteLog(ctx context.Context, req *loggingpb.DeleteLogRequest, opts ...gax.CallOption) error {
if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines {
cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond)
defer cancel()
ctx = cctx
}
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "log_name", url.QueryEscape(req.GetLogName())))
+
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
- opts = append(c.CallOptions.DeleteLog[0:len(c.CallOptions.DeleteLog):len(c.CallOptions.DeleteLog)], opts...)
+ opts = append((*c.CallOptions).DeleteLog[0:len((*c.CallOptions).DeleteLog):len((*c.CallOptions).DeleteLog)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
_, err = c.client.DeleteLog(ctx, req, settings.GRPC...)
@@ -241,21 +332,14 @@ func (c *Client) DeleteLog(ctx context.Context, req *loggingpb.DeleteLogRequest,
return err
}
-// WriteLogEntries writes log entries to Logging. This API method is the
-// only way to send log entries to Logging. This method
-// is used, directly or indirectly, by the Logging agent
-// (fluentd) and all logging libraries configured to use Logging.
-// A single request may contain log entries for a maximum of 1000
-// different resources (projects, organizations, billing accounts or
-// folders)
-func (c *Client) WriteLogEntries(ctx context.Context, req *loggingpb.WriteLogEntriesRequest, opts ...gax.CallOption) (*loggingpb.WriteLogEntriesResponse, error) {
+func (c *gRPCClient) WriteLogEntries(ctx context.Context, req *loggingpb.WriteLogEntriesRequest, opts ...gax.CallOption) (*loggingpb.WriteLogEntriesResponse, error) {
if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines {
cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond)
defer cancel()
ctx = cctx
}
ctx = insertMetadata(ctx, c.xGoogMetadata)
- opts = append(c.CallOptions.WriteLogEntries[0:len(c.CallOptions.WriteLogEntries):len(c.CallOptions.WriteLogEntries)], opts...)
+ opts = append((*c.CallOptions).WriteLogEntries[0:len((*c.CallOptions).WriteLogEntries):len((*c.CallOptions).WriteLogEntries)], opts...)
var resp *loggingpb.WriteLogEntriesResponse
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -268,21 +352,19 @@ func (c *Client) WriteLogEntries(ctx context.Context, req *loggingpb.WriteLogEnt
return resp, nil
}
-// ListLogEntries lists log entries. Use this method to retrieve log entries that originated
-// from a project/folder/organization/billing account. For ways to export log
-// entries, see Exporting
-// Logs (at https://cloud.google.com/logging/docs/export).
-func (c *Client) ListLogEntries(ctx context.Context, req *loggingpb.ListLogEntriesRequest, opts ...gax.CallOption) *LogEntryIterator {
+func (c *gRPCClient) ListLogEntries(ctx context.Context, req *loggingpb.ListLogEntriesRequest, opts ...gax.CallOption) *LogEntryIterator {
ctx = insertMetadata(ctx, c.xGoogMetadata)
- opts = append(c.CallOptions.ListLogEntries[0:len(c.CallOptions.ListLogEntries):len(c.CallOptions.ListLogEntries)], opts...)
+ opts = append((*c.CallOptions).ListLogEntries[0:len((*c.CallOptions).ListLogEntries):len((*c.CallOptions).ListLogEntries)], opts...)
it := &LogEntryIterator{}
req = proto.Clone(req).(*loggingpb.ListLogEntriesRequest)
it.InternalFetch = func(pageSize int, pageToken string) ([]*loggingpb.LogEntry, string, error) {
- var resp *loggingpb.ListLogEntriesResponse
- req.PageToken = pageToken
+ resp := &loggingpb.ListLogEntriesResponse{}
+ if pageToken != "" {
+ req.PageToken = pageToken
+ }
if pageSize > math.MaxInt32 {
req.PageSize = math.MaxInt32
- } else {
+ } else if pageSize != 0 {
req.PageSize = int32(pageSize)
}
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -305,24 +387,27 @@ func (c *Client) ListLogEntries(ctx context.Context, req *loggingpb.ListLogEntri
it.items = append(it.items, items...)
return nextPageToken, nil
}
+
it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
it.pageInfo.MaxSize = int(req.GetPageSize())
it.pageInfo.Token = req.GetPageToken()
+
return it
}
-// ListMonitoredResourceDescriptors lists the descriptors for monitored resource types used by Logging.
-func (c *Client) ListMonitoredResourceDescriptors(ctx context.Context, req *loggingpb.ListMonitoredResourceDescriptorsRequest, opts ...gax.CallOption) *MonitoredResourceDescriptorIterator {
+func (c *gRPCClient) ListMonitoredResourceDescriptors(ctx context.Context, req *loggingpb.ListMonitoredResourceDescriptorsRequest, opts ...gax.CallOption) *MonitoredResourceDescriptorIterator {
ctx = insertMetadata(ctx, c.xGoogMetadata)
- opts = append(c.CallOptions.ListMonitoredResourceDescriptors[0:len(c.CallOptions.ListMonitoredResourceDescriptors):len(c.CallOptions.ListMonitoredResourceDescriptors)], opts...)
+ opts = append((*c.CallOptions).ListMonitoredResourceDescriptors[0:len((*c.CallOptions).ListMonitoredResourceDescriptors):len((*c.CallOptions).ListMonitoredResourceDescriptors)], opts...)
it := &MonitoredResourceDescriptorIterator{}
req = proto.Clone(req).(*loggingpb.ListMonitoredResourceDescriptorsRequest)
it.InternalFetch = func(pageSize int, pageToken string) ([]*monitoredrespb.MonitoredResourceDescriptor, string, error) {
- var resp *loggingpb.ListMonitoredResourceDescriptorsResponse
- req.PageToken = pageToken
+ resp := &loggingpb.ListMonitoredResourceDescriptorsResponse{}
+ if pageToken != "" {
+ req.PageToken = pageToken
+ }
if pageSize > math.MaxInt32 {
req.PageSize = math.MaxInt32
- } else {
+ } else if pageSize != 0 {
req.PageSize = int32(pageSize)
}
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -345,26 +430,29 @@ func (c *Client) ListMonitoredResourceDescriptors(ctx context.Context, req *logg
it.items = append(it.items, items...)
return nextPageToken, nil
}
+
it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
it.pageInfo.MaxSize = int(req.GetPageSize())
it.pageInfo.Token = req.GetPageToken()
+
return it
}
-// ListLogs lists the logs in projects, organizations, folders, or billing accounts.
-// Only logs that have entries are listed.
-func (c *Client) ListLogs(ctx context.Context, req *loggingpb.ListLogsRequest, opts ...gax.CallOption) *StringIterator {
+func (c *gRPCClient) ListLogs(ctx context.Context, req *loggingpb.ListLogsRequest, opts ...gax.CallOption) *StringIterator {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent())))
+
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
- opts = append(c.CallOptions.ListLogs[0:len(c.CallOptions.ListLogs):len(c.CallOptions.ListLogs)], opts...)
+ opts = append((*c.CallOptions).ListLogs[0:len((*c.CallOptions).ListLogs):len((*c.CallOptions).ListLogs)], opts...)
it := &StringIterator{}
req = proto.Clone(req).(*loggingpb.ListLogsRequest)
it.InternalFetch = func(pageSize int, pageToken string) ([]string, string, error) {
- var resp *loggingpb.ListLogsResponse
- req.PageToken = pageToken
+ resp := &loggingpb.ListLogsResponse{}
+ if pageToken != "" {
+ req.PageToken = pageToken
+ }
if pageSize > math.MaxInt32 {
req.PageSize = math.MaxInt32
- } else {
+ } else if pageSize != 0 {
req.PageSize = int32(pageSize)
}
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -387,18 +475,18 @@ func (c *Client) ListLogs(ctx context.Context, req *loggingpb.ListLogsRequest, o
it.items = append(it.items, items...)
return nextPageToken, nil
}
+
it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
it.pageInfo.MaxSize = int(req.GetPageSize())
it.pageInfo.Token = req.GetPageToken()
+
return it
}
-// TailLogEntries streaming read of log entries as they are ingested. Until the stream is
-// terminated, it will continue reading logs.
-func (c *Client) TailLogEntries(ctx context.Context, opts ...gax.CallOption) (loggingpb.LoggingServiceV2_TailLogEntriesClient, error) {
+func (c *gRPCClient) TailLogEntries(ctx context.Context, opts ...gax.CallOption) (loggingpb.LoggingServiceV2_TailLogEntriesClient, error) {
ctx = insertMetadata(ctx, c.xGoogMetadata)
- opts = append(c.CallOptions.TailLogEntries[0:len(c.CallOptions.TailLogEntries):len(c.CallOptions.TailLogEntries)], opts...)
var resp loggingpb.LoggingServiceV2_TailLogEntriesClient
+ opts = append((*c.CallOptions).TailLogEntries[0:len((*c.CallOptions).TailLogEntries):len((*c.CallOptions).TailLogEntries)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
resp, err = c.client.TailLogEntries(ctx, settings.GRPC...)
diff --git a/vendor/cloud.google.com/go/logging/apiv2/metrics_client.go b/vendor/cloud.google.com/go/logging/apiv2/metrics_client.go
index 051282083..3f32953e9 100644
--- a/vendor/cloud.google.com/go/logging/apiv2/metrics_client.go
+++ b/vendor/cloud.google.com/go/logging/apiv2/metrics_client.go
@@ -1,4 +1,4 @@
-// Copyright 2021 Google LLC
+// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -23,7 +23,6 @@ import (
"net/url"
"time"
- "github.com/golang/protobuf/proto"
gax "github.com/googleapis/gax-go/v2"
"google.golang.org/api/iterator"
"google.golang.org/api/option"
@@ -33,6 +32,7 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/metadata"
+ "google.golang.org/protobuf/proto"
)
var newMetricsClientHook clientHook
@@ -46,13 +46,13 @@ type MetricsCallOptions struct {
DeleteLogMetric []gax.CallOption
}
-func defaultMetricsClientOptions() []option.ClientOption {
+func defaultMetricsGRPCClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("logging.googleapis.com:443"),
internaloption.WithDefaultMTLSEndpoint("logging.mtls.googleapis.com:443"),
internaloption.WithDefaultAudience("https://logging.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
- option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
+ internaloption.EnableJwtWithScope(),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
}
@@ -116,32 +116,103 @@ func defaultMetricsCallOptions() *MetricsCallOptions {
}
}
+// internalMetricsClient is an interface that defines the methods available from Cloud Logging API.
+type internalMetricsClient interface {
+ Close() error
+ setGoogleClientInfo(...string)
+ Connection() *grpc.ClientConn
+ ListLogMetrics(context.Context, *loggingpb.ListLogMetricsRequest, ...gax.CallOption) *LogMetricIterator
+ GetLogMetric(context.Context, *loggingpb.GetLogMetricRequest, ...gax.CallOption) (*loggingpb.LogMetric, error)
+ CreateLogMetric(context.Context, *loggingpb.CreateLogMetricRequest, ...gax.CallOption) (*loggingpb.LogMetric, error)
+ UpdateLogMetric(context.Context, *loggingpb.UpdateLogMetricRequest, ...gax.CallOption) (*loggingpb.LogMetric, error)
+ DeleteLogMetric(context.Context, *loggingpb.DeleteLogMetricRequest, ...gax.CallOption) error
+}
+
// MetricsClient is a client for interacting with Cloud Logging API.
-//
// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
+//
+// Service for configuring logs-based metrics.
type MetricsClient struct {
+ // The internal transport-dependent client.
+ internalClient internalMetricsClient
+
+ // The call options for this service.
+ CallOptions *MetricsCallOptions
+}
+
+// Wrapper methods routed to the internal client.
+
+// Close closes the connection to the API service. The user should invoke this when
+// the client is no longer required.
+func (c *MetricsClient) Close() error {
+ return c.internalClient.Close()
+}
+
+// setGoogleClientInfo sets the name and version of the application in
+// the `x-goog-api-client` header passed on each request. Intended for
+// use by Google-written clients.
+func (c *MetricsClient) setGoogleClientInfo(keyval ...string) {
+ c.internalClient.setGoogleClientInfo(keyval...)
+}
+
+// Connection returns a connection to the API service.
+//
+// Deprecated.
+func (c *MetricsClient) Connection() *grpc.ClientConn {
+ return c.internalClient.Connection()
+}
+
+// ListLogMetrics lists logs-based metrics.
+func (c *MetricsClient) ListLogMetrics(ctx context.Context, req *loggingpb.ListLogMetricsRequest, opts ...gax.CallOption) *LogMetricIterator {
+ return c.internalClient.ListLogMetrics(ctx, req, opts...)
+}
+
+// GetLogMetric gets a logs-based metric.
+func (c *MetricsClient) GetLogMetric(ctx context.Context, req *loggingpb.GetLogMetricRequest, opts ...gax.CallOption) (*loggingpb.LogMetric, error) {
+ return c.internalClient.GetLogMetric(ctx, req, opts...)
+}
+
+// CreateLogMetric creates a logs-based metric.
+func (c *MetricsClient) CreateLogMetric(ctx context.Context, req *loggingpb.CreateLogMetricRequest, opts ...gax.CallOption) (*loggingpb.LogMetric, error) {
+ return c.internalClient.CreateLogMetric(ctx, req, opts...)
+}
+
+// UpdateLogMetric creates or updates a logs-based metric.
+func (c *MetricsClient) UpdateLogMetric(ctx context.Context, req *loggingpb.UpdateLogMetricRequest, opts ...gax.CallOption) (*loggingpb.LogMetric, error) {
+ return c.internalClient.UpdateLogMetric(ctx, req, opts...)
+}
+
+// DeleteLogMetric deletes a logs-based metric.
+func (c *MetricsClient) DeleteLogMetric(ctx context.Context, req *loggingpb.DeleteLogMetricRequest, opts ...gax.CallOption) error {
+ return c.internalClient.DeleteLogMetric(ctx, req, opts...)
+}
+
+// metricsGRPCClient is a client for interacting with Cloud Logging API over gRPC transport.
+//
+// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
+type metricsGRPCClient struct {
// Connection pool of gRPC connections to the service.
connPool gtransport.ConnPool
// flag to opt out of default deadlines via GOOGLE_API_GO_EXPERIMENTAL_DISABLE_DEFAULT_DEADLINE
disableDeadlines bool
+ // Points back to the CallOptions field of the containing MetricsClient
+ CallOptions **MetricsCallOptions
+
// The gRPC API client.
metricsClient loggingpb.MetricsServiceV2Client
- // The call options for this service.
- CallOptions *MetricsCallOptions
-
// The x-goog-* metadata to be sent with each request.
xGoogMetadata metadata.MD
}
-// NewMetricsClient creates a new metrics service v2 client.
+// NewMetricsClient creates a new metrics service v2 client based on gRPC.
+// The returned client must be Closed when it is done being used to clean up its underlying connections.
//
// Service for configuring logs-based metrics.
func NewMetricsClient(ctx context.Context, opts ...option.ClientOption) (*MetricsClient, error) {
- clientOpts := defaultMetricsClientOptions()
-
+ clientOpts := defaultMetricsGRPCClientOptions()
if newMetricsClientHook != nil {
hookOpts, err := newMetricsClientHook(ctx, clientHookParams{})
if err != nil {
@@ -159,53 +230,58 @@ func NewMetricsClient(ctx context.Context, opts ...option.ClientOption) (*Metric
if err != nil {
return nil, err
}
- c := &MetricsClient{
+ client := MetricsClient{CallOptions: defaultMetricsCallOptions()}
+
+ c := &metricsGRPCClient{
connPool: connPool,
disableDeadlines: disableDeadlines,
- CallOptions: defaultMetricsCallOptions(),
-
- metricsClient: loggingpb.NewMetricsServiceV2Client(connPool),
+ metricsClient: loggingpb.NewMetricsServiceV2Client(connPool),
+ CallOptions: &client.CallOptions,
}
c.setGoogleClientInfo()
- return c, nil
+ client.internalClient = c
+
+ return &client, nil
}
// Connection returns a connection to the API service.
//
// Deprecated.
-func (c *MetricsClient) Connection() *grpc.ClientConn {
+func (c *metricsGRPCClient) Connection() *grpc.ClientConn {
return c.connPool.Conn()
}
-// Close closes the connection to the API service. The user should invoke this when
-// the client is no longer required.
-func (c *MetricsClient) Close() error {
- return c.connPool.Close()
-}
-
// setGoogleClientInfo sets the name and version of the application in
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
-func (c *MetricsClient) setGoogleClientInfo(keyval ...string) {
+func (c *metricsGRPCClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
- kv = append(kv, "gapic", versionClient, "gax", gax.Version, "grpc", grpc.Version)
+ kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version)
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
-// ListLogMetrics lists logs-based metrics.
-func (c *MetricsClient) ListLogMetrics(ctx context.Context, req *loggingpb.ListLogMetricsRequest, opts ...gax.CallOption) *LogMetricIterator {
+// Close closes the connection to the API service. The user should invoke this when
+// the client is no longer required.
+func (c *metricsGRPCClient) Close() error {
+ return c.connPool.Close()
+}
+
+func (c *metricsGRPCClient) ListLogMetrics(ctx context.Context, req *loggingpb.ListLogMetricsRequest, opts ...gax.CallOption) *LogMetricIterator {
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent())))
+
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
- opts = append(c.CallOptions.ListLogMetrics[0:len(c.CallOptions.ListLogMetrics):len(c.CallOptions.ListLogMetrics)], opts...)
+ opts = append((*c.CallOptions).ListLogMetrics[0:len((*c.CallOptions).ListLogMetrics):len((*c.CallOptions).ListLogMetrics)], opts...)
it := &LogMetricIterator{}
req = proto.Clone(req).(*loggingpb.ListLogMetricsRequest)
it.InternalFetch = func(pageSize int, pageToken string) ([]*loggingpb.LogMetric, string, error) {
- var resp *loggingpb.ListLogMetricsResponse
- req.PageToken = pageToken
+ resp := &loggingpb.ListLogMetricsResponse{}
+ if pageToken != "" {
+ req.PageToken = pageToken
+ }
if pageSize > math.MaxInt32 {
req.PageSize = math.MaxInt32
- } else {
+ } else if pageSize != 0 {
req.PageSize = int32(pageSize)
}
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
@@ -228,22 +304,24 @@ func (c *MetricsClient) ListLogMetrics(ctx context.Context, req *loggingpb.ListL
it.items = append(it.items, items...)
return nextPageToken, nil
}
+
it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
it.pageInfo.MaxSize = int(req.GetPageSize())
it.pageInfo.Token = req.GetPageToken()
+
return it
}
-// GetLogMetric gets a logs-based metric.
-func (c *MetricsClient) GetLogMetric(ctx context.Context, req *loggingpb.GetLogMetricRequest, opts ...gax.CallOption) (*loggingpb.LogMetric, error) {
+func (c *metricsGRPCClient) GetLogMetric(ctx context.Context, req *loggingpb.GetLogMetricRequest, opts ...gax.CallOption) (*loggingpb.LogMetric, error) {
if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines {
cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond)
defer cancel()
ctx = cctx
}
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "metric_name", url.QueryEscape(req.GetMetricName())))
+
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
- opts = append(c.CallOptions.GetLogMetric[0:len(c.CallOptions.GetLogMetric):len(c.CallOptions.GetLogMetric)], opts...)
+ opts = append((*c.CallOptions).GetLogMetric[0:len((*c.CallOptions).GetLogMetric):len((*c.CallOptions).GetLogMetric)], opts...)
var resp *loggingpb.LogMetric
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -256,16 +334,16 @@ func (c *MetricsClient) GetLogMetric(ctx context.Context, req *loggingpb.GetLogM
return resp, nil
}
-// CreateLogMetric creates a logs-based metric.
-func (c *MetricsClient) CreateLogMetric(ctx context.Context, req *loggingpb.CreateLogMetricRequest, opts ...gax.CallOption) (*loggingpb.LogMetric, error) {
+func (c *metricsGRPCClient) CreateLogMetric(ctx context.Context, req *loggingpb.CreateLogMetricRequest, opts ...gax.CallOption) (*loggingpb.LogMetric, error) {
if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines {
cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond)
defer cancel()
ctx = cctx
}
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "parent", url.QueryEscape(req.GetParent())))
+
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
- opts = append(c.CallOptions.CreateLogMetric[0:len(c.CallOptions.CreateLogMetric):len(c.CallOptions.CreateLogMetric)], opts...)
+ opts = append((*c.CallOptions).CreateLogMetric[0:len((*c.CallOptions).CreateLogMetric):len((*c.CallOptions).CreateLogMetric)], opts...)
var resp *loggingpb.LogMetric
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -278,16 +356,16 @@ func (c *MetricsClient) CreateLogMetric(ctx context.Context, req *loggingpb.Crea
return resp, nil
}
-// UpdateLogMetric creates or updates a logs-based metric.
-func (c *MetricsClient) UpdateLogMetric(ctx context.Context, req *loggingpb.UpdateLogMetricRequest, opts ...gax.CallOption) (*loggingpb.LogMetric, error) {
+func (c *metricsGRPCClient) UpdateLogMetric(ctx context.Context, req *loggingpb.UpdateLogMetricRequest, opts ...gax.CallOption) (*loggingpb.LogMetric, error) {
if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines {
cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond)
defer cancel()
ctx = cctx
}
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "metric_name", url.QueryEscape(req.GetMetricName())))
+
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
- opts = append(c.CallOptions.UpdateLogMetric[0:len(c.CallOptions.UpdateLogMetric):len(c.CallOptions.UpdateLogMetric)], opts...)
+ opts = append((*c.CallOptions).UpdateLogMetric[0:len((*c.CallOptions).UpdateLogMetric):len((*c.CallOptions).UpdateLogMetric)], opts...)
var resp *loggingpb.LogMetric
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
@@ -300,16 +378,16 @@ func (c *MetricsClient) UpdateLogMetric(ctx context.Context, req *loggingpb.Upda
return resp, nil
}
-// DeleteLogMetric deletes a logs-based metric.
-func (c *MetricsClient) DeleteLogMetric(ctx context.Context, req *loggingpb.DeleteLogMetricRequest, opts ...gax.CallOption) error {
+func (c *metricsGRPCClient) DeleteLogMetric(ctx context.Context, req *loggingpb.DeleteLogMetricRequest, opts ...gax.CallOption) error {
if _, ok := ctx.Deadline(); !ok && !c.disableDeadlines {
cctx, cancel := context.WithTimeout(ctx, 60000*time.Millisecond)
defer cancel()
ctx = cctx
}
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v", "metric_name", url.QueryEscape(req.GetMetricName())))
+
ctx = insertMetadata(ctx, c.xGoogMetadata, md)
- opts = append(c.CallOptions.DeleteLogMetric[0:len(c.CallOptions.DeleteLogMetric):len(c.CallOptions.DeleteLogMetric)], opts...)
+ opts = append((*c.CallOptions).DeleteLogMetric[0:len((*c.CallOptions).DeleteLogMetric):len((*c.CallOptions).DeleteLogMetric)], opts...)
err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
var err error
_, err = c.metricsClient.DeleteLogMetric(ctx, req, settings.GRPC...)
diff --git a/vendor/cloud.google.com/go/logging/apiv2/version.go b/vendor/cloud.google.com/go/logging/apiv2/version.go
new file mode 100644
index 000000000..2de6c5463
--- /dev/null
+++ b/vendor/cloud.google.com/go/logging/apiv2/version.go
@@ -0,0 +1,23 @@
+// Copyright 2022 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.
+
+// Code generated by gapicgen. DO NOT EDIT.
+
+package logging
+
+import "cloud.google.com/go/logging/internal"
+
+func init() {
+ versionClient = internal.Version
+}
diff --git a/vendor/cloud.google.com/go/logging/doc.go b/vendor/cloud.google.com/go/logging/doc.go
index 3aa9b12b0..e3a9afdff 100644
--- a/vendor/cloud.google.com/go/logging/doc.go
+++ b/vendor/cloud.google.com/go/logging/doc.go
@@ -68,6 +68,21 @@ not recommended for normal use.
}
+Redirecting log ingestion
+
+For cases when runtime environment supports out-of-process log ingestion,
+like logging agent, you can opt-in to write log entries to io.Writer instead of
+ingesting them to Cloud Logging service. Usually, you will use os.Stdout or os.Stderr as
+writers because Google Cloud logging agents are configured to capture logs from standard output.
+The entries will be Jsonified and wrote as one line strings following the structured logging format.
+See https://cloud.google.com/logging/docs/structured-logging#special-payload-fields for the format description.
+To instruct Logger to redirect log entries add RedirectAsJSON() LoggerOption`s.
+
+
+ // Create a logger to print structured logs formatted as a single line Json to stdout
+ loggger := client.Logger("test-log", RedirectAsJSON(os.Stdout))
+
+
Payloads
An entry payload can be a string, as in the examples above. It can also be any value
@@ -84,6 +99,16 @@ If you have a []byte of JSON, wrap it in json.RawMessage:
j := []byte(`{"Name": "Bob", "Count": 3}`)
lg.Log(logging.Entry{Payload: json.RawMessage(j)})
+If you have proto.Message and want to send it as a protobuf payload, marshal it to anypb.Any:
+
+ // import
+ func logMessage (m proto.Message) {
+ var payload anypb.Any
+ err := anypb.MarshalFrom(&payload, m)
+ if err != nil {
+ lg.Log(logging.Entry{Payload: payload})
+ }
+ }
The Standard Logger
diff --git a/vendor/cloud.google.com/go/logging/go.mod b/vendor/cloud.google.com/go/logging/go.mod
index 29fd22543..d7ef55b4e 100644
--- a/vendor/cloud.google.com/go/logging/go.mod
+++ b/vendor/cloud.google.com/go/logging/go.mod
@@ -1,16 +1,19 @@
module cloud.google.com/go/logging
-go 1.11
+go 1.15
require (
- cloud.google.com/go v0.81.0
- cloud.google.com/go/storage v1.10.0
+ cloud.google.com/go v0.102.1
+ cloud.google.com/go/compute v1.7.0
+ cloud.google.com/go/iam v0.3.0
+ cloud.google.com/go/storage v1.22.1
github.com/golang/protobuf v1.5.2
- github.com/google/go-cmp v0.5.5
- github.com/googleapis/gax-go/v2 v2.0.5
+ github.com/google/go-cmp v0.5.8
+ github.com/googleapis/gax-go/v2 v2.4.0
go.opencensus.io v0.23.0
- golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c
- google.golang.org/api v0.46.0
- google.golang.org/genproto v0.0.0-20210517163617-5e0236093d7a
- google.golang.org/grpc v1.37.1
+ golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb
+ google.golang.org/api v0.84.0
+ google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad
+ google.golang.org/grpc v1.47.0
+ google.golang.org/protobuf v1.28.0
)
diff --git a/vendor/cloud.google.com/go/logging/go.sum b/vendor/cloud.google.com/go/logging/go.sum
index 4013a1171..ab52e6bc5 100644
--- a/vendor/cloud.google.com/go/logging/go.sum
+++ b/vendor/cloud.google.com/go/logging/go.sum
@@ -17,16 +17,36 @@ cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKP
cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk=
cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg=
cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8=
-cloud.google.com/go v0.81.0 h1:at8Tk2zUz63cLPR0JPWm5vp77pEZmzxEQBEfRKn1VV8=
cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0=
+cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY=
+cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM=
+cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY=
+cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ=
+cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI=
+cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4=
+cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc=
+cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA=
+cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A=
+cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc=
+cloud.google.com/go v0.102.1 h1:vpK6iQWv/2uUeFJth4/cBHsQAGjn1iIE6AAlxipRaA0=
+cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU=
cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE=
cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc=
cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg=
cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc=
cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ=
+cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow=
+cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM=
+cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M=
+cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s=
+cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU=
+cloud.google.com/go/compute v1.7.0 h1:v/k9Eueb8aAJ0vZuxKMrgm6kPhCLZU9HxFU+AFDs9Uk=
+cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U=
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk=
+cloud.google.com/go/iam v0.3.0 h1:exkAomrVUuzx9kWFI1wm3KI0uoDeUFPB4kKGzx6x+Gc=
+cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY=
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw=
cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA=
@@ -35,12 +55,17 @@ cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiy
cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos=
cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk=
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
-cloud.google.com/go/storage v1.10.0 h1:STgFzyU5/8miMl0//zKh2aQeTyeaUH3WN9bSUiJ09bA=
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
+cloud.google.com/go/storage v1.22.1 h1:F6IlQJZrZM++apn9V5/VfS3gbTUYg98PS3EMQAzqtfg=
+cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
+github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
+github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
+github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
+github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
@@ -48,6 +73,12 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
+github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI=
+github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
+github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
+github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
+github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
+github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
@@ -55,7 +86,11 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m
github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po=
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
+github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ=
+github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0=
+github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
+github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
@@ -72,6 +107,7 @@ github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt
github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8=
+github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
@@ -90,6 +126,8 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS
github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM=
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
+github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA=
+github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
@@ -102,13 +140,17 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
+github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg=
+github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
-github.com/google/martian/v3 v3.1.0 h1:wCKgOCHuUEVfsaQLpPSJb7VdYCdTVZQAuOdYm1yc/60=
github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
+github.com/google/martian/v3 v3.2.1 h1:d8MncMlErDFTwQGBK1xhv026j9kqhvw1Qv9IbWT1VLQ=
+github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk=
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
@@ -120,17 +162,30 @@ github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLe
github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
+github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
+github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
+github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
+github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa h1:7MYGT2XEMam7Mtzv1yDUYXANedWvwk3HKkR3MyGowy8=
+github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
-github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
+github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0=
+github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM=
+github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM=
+github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM=
+github.com/googleapis/gax-go/v2 v2.4.0 h1:dS9eYAjhrE2RjmzYw2XAPvcXfmcQLtFEQWn0CR82awk=
+github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c=
+github.com/googleapis/go-type-adapters v1.0.0 h1:9XdMn+d/G57qq1s8dNc5IesGCXHf6V2HZ2JwRxfA2tA=
+github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4=
+github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
-github.com/jstemmer/go-junit-report v0.9.1 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
@@ -138,15 +193,19 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
+github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
+github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
+github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
+github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
@@ -155,6 +214,7 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M=
go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
+go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
@@ -182,8 +242,8 @@ golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHl
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs=
golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
-golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 h1:2M3HP5CCK1Si9FQhwnzYhXdG6DXeebvUHFpre8QvbyI=
golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
+golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
@@ -193,8 +253,8 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
-golang.org/x/mod v0.4.1 h1:Kvvh58BN8Y9/lBi7hTekvtMpm07eUZ0ck5pRHpsMWrY=
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
+golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -228,8 +288,15 @@ golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v
golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc=
-golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420 h1:a8jGStKg0XqKDlKqjLrXn0ioF5MH36pT7Z0BRTqLhbk=
+golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
+golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
+golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
+golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
+golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
+golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
+golang.org/x/net v0.0.0-20220607020251-c690dde0001d h1:4SFsTMi4UahlKoloni7L4eYzhFRifURQLw+yv0QDCx8=
+golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -241,9 +308,16 @@ golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ
golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
-golang.org/x/oauth2 v0.0.0-20210427180440-81ed05c6b58c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
-golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c h1:pkQiBZBvdos9qq4wBAHqlzuZHEXo07pqV06ef90u1WI=
golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
+golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
+golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
+golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
+golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
+golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
+golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
+golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
+golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb h1:8tDJ3aechhddbdPAxpycgXHJRMLpk/Ab+aa4OgdN5/g=
+golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -254,8 +328,9 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f h1:Ax0t5p6N38Ga0dThY21weqDEyz2oklo4IvDkpigvkD8=
+golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -291,10 +366,32 @@ golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210503080704-8803ae5d1324 h1:pAwJxDByZctfPwzlNGrDN2BQLsdPb9NkhoTJtUkAO28=
-golang.org/x/sys v0.0.0-20210503080704-8803ae5d1324/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d h1:Zu/JngovGLVi6t2J3nmAf3AoTDwuzw85YZ3b9o4yU7s=
+golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
+golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -302,8 +399,9 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
-golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
+golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
@@ -352,13 +450,20 @@ golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4f
golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
-golang.org/x/tools v0.1.0 h1:po9/4sTYwZU9lPhi1tOrb4hCv3qrhiQ77LZfGa2OjwY=
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
+golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
+golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
+golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
+golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
+golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
+golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f h1:uF6paiQQebLeSXkrTqHqz0MXhXXS1KgF41eUdBNvxK0=
+golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
@@ -380,8 +485,25 @@ google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34q
google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8=
google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU=
google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94=
-google.golang.org/api v0.46.0 h1:jkDWHOBIoNSD0OQpq4rtBVu+Rh325MPjXG1rakAp8JU=
-google.golang.org/api v0.46.0/go.mod h1:ceL4oozhkAiTID8XMmJBsIxID/9wMXJVVFXPg4ylg3I=
+google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo=
+google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4=
+google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw=
+google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU=
+google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k=
+google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE=
+google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE=
+google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI=
+google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I=
+google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo=
+google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g=
+google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA=
+google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8=
+google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs=
+google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA=
+google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw=
+google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg=
+google.golang.org/api v0.84.0 h1:NMB9J4cCxs9xEm+1Z9QiO3eFvn7EnQj3Eo3hN6ugVlg=
+google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
@@ -413,6 +535,7 @@ google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfG
google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
+google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA=
@@ -428,10 +551,47 @@ google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6D
google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
+google.golang.org/genproto v0.0.0-20210329143202-679c6ae281ee/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A=
google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A=
-google.golang.org/genproto v0.0.0-20210429181445-86c259c2b4ab/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A=
-google.golang.org/genproto v0.0.0-20210517163617-5e0236093d7a h1:VA0wtJaR+W1I11P2f535J7D/YxyvEFMTMvcmyeZ9FBE=
-google.golang.org/genproto v0.0.0-20210517163617-5e0236093d7a/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A=
+google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A=
+google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
+google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
+google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
+google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24=
+google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k=
+google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k=
+google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48=
+google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48=
+google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w=
+google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
+google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
+google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
+google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
+google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
+google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
+google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
+google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
+google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
+google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
+google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
+google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
+google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
+google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
+google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
+google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
+google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E=
+google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
+google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
+google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
+google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
+google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
+google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4=
+google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4=
+google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4=
+google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA=
+google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA=
+google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad h1:kqrS+lhvaMHCxul6sKQvKJ8nAAhlVItmZV822hYFH/U=
+google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
@@ -445,14 +605,26 @@ google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3Iji
google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
+google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0=
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8=
google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
-google.golang.org/grpc v1.37.1 h1:ARnQJNWxGyYJpdf/JXscNlQr/uv607ZPU9Z7ogHi+iI=
google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
+google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
+google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE=
+google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE=
+google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34=
+google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34=
+google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU=
+google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ=
+google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
+google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
+google.golang.org/grpc v1.47.0 h1:9n77onPX5F3qfFCqjy9dhn8PbNQsIKeVU04J9G7umt8=
+google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
+google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
@@ -464,12 +636,15 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD
google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
-google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
+google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
+google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw=
+google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
diff --git a/vendor/cloud.google.com/go/logging/go_mod_tidy_hack.go b/vendor/cloud.google.com/go/logging/go_mod_tidy_hack.go
index a932c70c4..6d11e4f78 100644
--- a/vendor/cloud.google.com/go/logging/go_mod_tidy_hack.go
+++ b/vendor/cloud.google.com/go/logging/go_mod_tidy_hack.go
@@ -14,6 +14,7 @@
// This file, and the cloud.google.com/go import, won't actually become part of
// the resultant binary.
+//go:build modhack
// +build modhack
package logging
diff --git a/vendor/cloud.google.com/go/logging/instrumentation.go b/vendor/cloud.google.com/go/logging/instrumentation.go
new file mode 100644
index 000000000..a377d5ccc
--- /dev/null
+++ b/vendor/cloud.google.com/go/logging/instrumentation.go
@@ -0,0 +1,83 @@
+// Copyright 2022 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
+//
+// https://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.
+
+package logging
+
+import (
+ "strings"
+
+ "cloud.google.com/go/logging/internal"
+ logpb "google.golang.org/genproto/googleapis/logging/v2"
+)
+
+const diagnosticLogID = "diagnostic-log"
+
+// instrumentationPayload defines telemetry log entry payload for capturing instrumentation info
+type instrumentationPayload struct {
+ InstrumentationSource []map[string]string `json:"instrumentation_source"`
+ Runtime string `json:"runtime,omitempty"`
+}
+
+var (
+ instrumentationInfo = &instrumentationPayload{
+ InstrumentationSource: []map[string]string{
+ {
+ "name": "go",
+ "version": internal.Version,
+ },
+ },
+ Runtime: internal.VersionGo(),
+ }
+)
+
+// instrumentLogs appends log entry with library instrumentation info to the
+// list of log entries on the first function's call.
+func (l *Logger) instrumentLogs(entries []*logpb.LogEntry) ([]*logpb.LogEntry, bool) {
+ var instrumentationAdded bool
+
+ internal.InstrumentOnce.Do(func() {
+ ie, err := l.instrumentationEntry()
+ if err != nil {
+ // do not retry instrumenting logs if failed creating instrumentation entry
+ return
+ }
+ // populate LogName only when directly ingesting entries
+ if l.redirectOutputWriter == nil {
+ ie.LogName = internal.LogPath(l.client.parent, diagnosticLogID)
+ }
+ entries = append(entries, ie)
+ instrumentationAdded = true
+ })
+ return entries, instrumentationAdded
+}
+
+func (l *Logger) instrumentationEntry() (*logpb.LogEntry, error) {
+ ent := Entry{
+ Payload: map[string]*instrumentationPayload{
+ "logging.googleapis.com/diagnostic": instrumentationInfo,
+ },
+ }
+ // pass nil for Logger and 0 for skip levels to ignore auto-population
+ return toLogEntryInternal(ent, nil, l.client.parent, 0)
+}
+
+// hasInstrumentation returns true if any of the log entries has diagnostic LogId
+func hasInstrumentation(entries []*logpb.LogEntry) bool {
+ for _, ent := range entries {
+ if strings.HasSuffix(ent.LogName, diagnosticLogID) {
+ return true
+ }
+ }
+ return false
+}
diff --git a/vendor/cloud.google.com/go/logging/internal/common.go b/vendor/cloud.google.com/go/logging/internal/common.go
index c5788feb0..28801ac86 100644
--- a/vendor/cloud.google.com/go/logging/internal/common.go
+++ b/vendor/cloud.google.com/go/logging/internal/common.go
@@ -16,7 +16,10 @@ package internal
import (
"fmt"
+ "runtime"
"strings"
+ "sync"
+ "unicode"
)
const (
@@ -24,6 +27,9 @@ const (
ProdAddr = "logging.googleapis.com:443"
)
+// InstrumentOnce guards instrumenting logs one time
+var InstrumentOnce = new(sync.Once)
+
// LogPath creates a formatted path from a parent and a logID.
func LogPath(parent, logID string) string {
logID = strings.Replace(logID, "/", "%2F", -1)
@@ -39,3 +45,40 @@ func LogIDFromPath(parent, path string) string {
logID := path[start:]
return strings.Replace(logID, "%2F", "/", -1)
}
+
+// VersionGo returns the Go runtime version. The returned string
+// has no whitespace, suitable for reporting in header.
+func VersionGo() string {
+ const develPrefix = "devel +"
+
+ s := runtime.Version()
+ if strings.HasPrefix(s, develPrefix) {
+ s = s[len(develPrefix):]
+ if p := strings.IndexFunc(s, unicode.IsSpace); p >= 0 {
+ s = s[:p]
+ }
+ return s
+ }
+
+ notSemverRune := func(r rune) bool {
+ return !strings.ContainsRune("0123456789.", r)
+ }
+
+ if strings.HasPrefix(s, "go1") {
+ s = s[2:]
+ var prerelease string
+ if p := strings.IndexFunc(s, notSemverRune); p >= 0 {
+ s, prerelease = s[:p], s[p:]
+ }
+ if strings.HasSuffix(s, ".") {
+ s += "0"
+ } else if strings.Count(s, ".") < 2 {
+ s += ".0"
+ }
+ if prerelease != "" {
+ s += "-" + prerelease
+ }
+ return s
+ }
+ return "UNKNOWN"
+}
diff --git a/vendor/cloud.google.com/go/logging/internal/environment.go b/vendor/cloud.google.com/go/logging/internal/environment.go
new file mode 100644
index 000000000..d56d49685
--- /dev/null
+++ b/vendor/cloud.google.com/go/logging/internal/environment.go
@@ -0,0 +1,75 @@
+// Copyright 2022 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
+//
+// https://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.
+
+package internal
+
+import (
+ "io/ioutil"
+ "net"
+ "net/http"
+ "os"
+ "strings"
+ "time"
+
+ "cloud.google.com/go/compute/metadata"
+)
+
+// ResourceAttributesGetter abstracts environment lookup methods to query for environment variables, metadata attributes and file content.
+type ResourceAttributesGetter interface {
+ EnvVar(name string) string
+ Metadata(path string) string
+ ReadAll(path string) string
+}
+
+var getter ResourceAttributesGetter = &defaultResourceGetter{
+ metaClient: metadata.NewClient(&http.Client{
+ Transport: &http.Transport{
+ Dial: (&net.Dialer{
+ Timeout: 1 * time.Second,
+ KeepAlive: 10 * time.Second,
+ }).Dial,
+ },
+ })}
+
+// ResourceAttributes provides read-only access to the ResourceAtttributesGetter interface implementation.
+func ResourceAttributes() ResourceAttributesGetter {
+ return getter
+}
+
+type defaultResourceGetter struct {
+ metaClient *metadata.Client
+}
+
+// EnvVar uses os.LookupEnv() to lookup for environment variable by name.
+func (g *defaultResourceGetter) EnvVar(name string) string {
+ return os.Getenv(name)
+}
+
+// Metadata uses metadata package Client.Get() to lookup for metadata attributes by path.
+func (g *defaultResourceGetter) Metadata(path string) string {
+ val, err := g.metaClient.Get(path)
+ if err != nil {
+ return ""
+ }
+ return strings.TrimSpace(val)
+}
+
+// ReadAll reads all content of the file as a string.
+func (g *defaultResourceGetter) ReadAll(path string) string {
+ bytes, err := ioutil.ReadFile(path)
+ if err != nil {
+ return ""
+ }
+ return string(bytes)
+}
diff --git a/vendor/cloud.google.com/go/logging/internal/version.go b/vendor/cloud.google.com/go/logging/internal/version.go
new file mode 100644
index 000000000..e93235c20
--- /dev/null
+++ b/vendor/cloud.google.com/go/logging/internal/version.go
@@ -0,0 +1,18 @@
+// Copyright 2022 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.
+
+package internal
+
+// Version is the current tagged release of the library.
+const Version = "1.5.0"
diff --git a/vendor/cloud.google.com/go/logging/logadmin/logadmin.go b/vendor/cloud.google.com/go/logging/logadmin/logadmin.go
index d6ffc31f0..12329d01c 100644
--- a/vendor/cloud.google.com/go/logging/logadmin/logadmin.go
+++ b/vendor/cloud.google.com/go/logging/logadmin/logadmin.go
@@ -33,7 +33,6 @@ import (
"strings"
"time"
- "cloud.google.com/go/internal/version"
"cloud.google.com/go/logging"
vkit "cloud.google.com/go/logging/apiv2"
"cloud.google.com/go/logging/internal"
@@ -95,9 +94,9 @@ func NewClient(ctx context.Context, parent string, opts ...option.ClientOption)
mc.CallOptions.CreateLogMetric = []gax.CallOption{gax.WithRetry(retryerOnInternal)}
mc.CallOptions.UpdateLogMetric = []gax.CallOption{gax.WithRetry(retryerOnInternal)}
- lc.SetGoogleClientInfo("gccl", version.Repo)
- sc.SetGoogleClientInfo("gccl", version.Repo)
- mc.SetGoogleClientInfo("gccl", version.Repo)
+ lc.SetGoogleClientInfo("gccl", internal.Version)
+ sc.SetGoogleClientInfo("gccl", internal.Version)
+ mc.SetGoogleClientInfo("gccl", internal.Version)
client := &Client{
lClient: lc,
sClient: sc,
diff --git a/vendor/cloud.google.com/go/logging/loggeroption.go b/vendor/cloud.google.com/go/logging/loggeroption.go
new file mode 100644
index 000000000..11cfbe88f
--- /dev/null
+++ b/vendor/cloud.google.com/go/logging/loggeroption.go
@@ -0,0 +1,189 @@
+// Copyright 2021 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
+//
+// https://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.
+
+package logging
+
+import (
+ "context"
+ "io"
+ "os"
+ "time"
+)
+
+// LoggerOption is a configuration option for a Logger.
+type LoggerOption interface {
+ set(*Logger)
+}
+
+// CommonLabels are labels that apply to all log entries written from a Logger,
+// so that you don't have to repeat them in each log entry's Labels field. If
+// any of the log entries contains a (key, value) with the same key that is in
+// CommonLabels, then the entry's (key, value) overrides the one in
+// CommonLabels.
+func CommonLabels(m map[string]string) LoggerOption { return commonLabels(m) }
+
+type commonLabels map[string]string
+
+func (c commonLabels) set(l *Logger) { l.commonLabels = c }
+
+// ConcurrentWriteLimit determines how many goroutines will send log entries to the
+// underlying service. The default is 1. Set ConcurrentWriteLimit to a higher value to
+// increase throughput.
+func ConcurrentWriteLimit(n int) LoggerOption { return concurrentWriteLimit(n) }
+
+type concurrentWriteLimit int
+
+func (c concurrentWriteLimit) set(l *Logger) { l.bundler.HandlerLimit = int(c) }
+
+// DelayThreshold is the maximum amount of time that an entry should remain
+// buffered in memory before a call to the logging service is triggered. Larger
+// values of DelayThreshold will generally result in fewer calls to the logging
+// service, while increasing the risk that log entries will be lost if the
+// process crashes.
+// The default is DefaultDelayThreshold.
+func DelayThreshold(d time.Duration) LoggerOption { return delayThreshold(d) }
+
+type delayThreshold time.Duration
+
+func (d delayThreshold) set(l *Logger) { l.bundler.DelayThreshold = time.Duration(d) }
+
+// EntryCountThreshold is the maximum number of entries that will be buffered
+// in memory before a call to the logging service is triggered. Larger values
+// will generally result in fewer calls to the logging service, while
+// increasing both memory consumption and the risk that log entries will be
+// lost if the process crashes.
+// The default is DefaultEntryCountThreshold.
+func EntryCountThreshold(n int) LoggerOption { return entryCountThreshold(n) }
+
+type entryCountThreshold int
+
+func (e entryCountThreshold) set(l *Logger) { l.bundler.BundleCountThreshold = int(e) }
+
+// EntryByteThreshold is the maximum number of bytes of entries that will be
+// buffered in memory before a call to the logging service is triggered. See
+// EntryCountThreshold for a discussion of the tradeoffs involved in setting
+// this option.
+// The default is DefaultEntryByteThreshold.
+func EntryByteThreshold(n int) LoggerOption { return entryByteThreshold(n) }
+
+type entryByteThreshold int
+
+func (e entryByteThreshold) set(l *Logger) { l.bundler.BundleByteThreshold = int(e) }
+
+// EntryByteLimit is the maximum number of bytes of entries that will be sent
+// in a single call to the logging service. ErrOversizedEntry is returned if an
+// entry exceeds EntryByteLimit. This option limits the size of a single RPC
+// payload, to account for network or service issues with large RPCs. If
+// EntryByteLimit is smaller than EntryByteThreshold, the latter has no effect.
+// The default is zero, meaning there is no limit.
+func EntryByteLimit(n int) LoggerOption { return entryByteLimit(n) }
+
+type entryByteLimit int
+
+func (e entryByteLimit) set(l *Logger) { l.bundler.BundleByteLimit = int(e) }
+
+// BufferedByteLimit is the maximum number of bytes that the Logger will keep
+// in memory before returning ErrOverflow. This option limits the total memory
+// consumption of the Logger (but note that each Logger has its own, separate
+// limit). It is possible to reach BufferedByteLimit even if it is larger than
+// EntryByteThreshold or EntryByteLimit, because calls triggered by the latter
+// two options may be enqueued (and hence occupying memory) while new log
+// entries are being added.
+// The default is DefaultBufferedByteLimit.
+func BufferedByteLimit(n int) LoggerOption { return bufferedByteLimit(n) }
+
+type bufferedByteLimit int
+
+func (b bufferedByteLimit) set(l *Logger) { l.bundler.BufferedByteLimit = int(b) }
+
+// ContextFunc is a function that will be called to obtain a context.Context for the
+// WriteLogEntries RPC executed in the background for calls to Logger.Log. The
+// default is a function that always returns context.Background. The second return
+// value of the function is a function to call after the RPC completes.
+//
+// The function is not used for calls to Logger.LogSync, since the caller can pass
+// in the context directly.
+//
+// This option is EXPERIMENTAL. It may be changed or removed.
+func ContextFunc(f func() (ctx context.Context, afterCall func())) LoggerOption {
+ return contextFunc(f)
+}
+
+type contextFunc func() (ctx context.Context, afterCall func())
+
+func (c contextFunc) set(l *Logger) { l.ctxFunc = c }
+
+// SourceLocationPopulation is the flag controlling population of the source location info
+// in the ingested entries. This options allows to configure automatic population of the
+// SourceLocation field for all ingested entries, entries with DEBUG severity or disable it.
+// Note that enabling this option can decrease execution time of Logger.Log and Logger.LogSync
+// by the factor of 2 or larger.
+// The default disables source location population.
+//
+// This option is not used when an entry is created using ToLogEntry.
+func SourceLocationPopulation(f int) LoggerOption {
+ return sourceLocationOption(f)
+}
+
+const (
+ // DoNotPopulateSourceLocation is default for clients when WithSourceLocation is not provided
+ DoNotPopulateSourceLocation = 0
+ // PopulateSourceLocationForDebugEntries is set when WithSourceLocation(PopulateDebugEntries) is provided
+ PopulateSourceLocationForDebugEntries = 1
+ // AlwaysPopulateSourceLocation is set when WithSourceLocation(PopulateAllEntries) is provided
+ AlwaysPopulateSourceLocation = 2
+)
+
+type sourceLocationOption int
+
+func (o sourceLocationOption) set(l *Logger) {
+ if o == DoNotPopulateSourceLocation || o == PopulateSourceLocationForDebugEntries || o == AlwaysPopulateSourceLocation {
+ l.populateSourceLocation = int(o)
+ }
+}
+
+// PartialSuccess sets the partialSuccess flag to true when ingesting a bundle of log entries.
+// See https://cloud.google.com/logging/docs/reference/v2/rest/v2/entries/write#body.request_body.FIELDS.partial_success
+// If not provided the partialSuccess flag is set to false.
+func PartialSuccess() LoggerOption {
+ return &partialSuccessOption{}
+}
+
+type partialSuccessOption struct{}
+
+func (o *partialSuccessOption) set(l *Logger) {
+ l.partialSuccess = true
+}
+
+// RedirectAsJSON instructs Logger to redirect output of calls to Log and LogSync to provided io.Writer instead of ingesting
+// to Cloud Logging. Logger formats log entries following logging agent's Json format.
+// See https://cloud.google.com/logging/docs/structured-logging#special-payload-fields for more info about the format.
+// Use this option to delegate log ingestion to an out-of-process logging agent.
+// If no writer is provided, the redirect is set to stdout.
+func RedirectAsJSON(w io.Writer) LoggerOption {
+ if w == nil {
+ w = os.Stdout
+ }
+ return &redirectOutputOption{
+ writer: w,
+ }
+}
+
+type redirectOutputOption struct {
+ writer io.Writer
+}
+
+func (o *redirectOutputOption) set(l *Logger) {
+ l.redirectOutputWriter = o.writer
+}
diff --git a/vendor/cloud.google.com/go/logging/logging.go b/vendor/cloud.google.com/go/logging/logging.go
index 81ede6afb..4f26a1934 100644
--- a/vendor/cloud.google.com/go/logging/logging.go
+++ b/vendor/cloud.google.com/go/logging/logging.go
@@ -30,16 +30,17 @@ import (
"encoding/json"
"errors"
"fmt"
+ "io"
"log"
"net/http"
"regexp"
+ "runtime"
"strconv"
"strings"
"sync"
"time"
"unicode/utf8"
- "cloud.google.com/go/internal/version"
vkit "cloud.google.com/go/logging/apiv2"
"cloud.google.com/go/logging/internal"
"github.com/golang/protobuf/proto"
@@ -50,6 +51,8 @@ import (
mrpb "google.golang.org/genproto/googleapis/api/monitoredres"
logtypepb "google.golang.org/genproto/googleapis/logging/type"
logpb "google.golang.org/genproto/googleapis/logging/v2"
+ "google.golang.org/protobuf/types/known/anypb"
+ "google.golang.org/protobuf/types/known/timestamppb"
)
const (
@@ -75,7 +78,7 @@ const (
DefaultEntryCountThreshold = 1000
// DefaultEntryByteThreshold is the default value for the EntryByteThreshold LoggerOption.
- DefaultEntryByteThreshold = 1 << 20 // 1MiB
+ DefaultEntryByteThreshold = 1 << 23 // 8MiB
// DefaultBufferedByteLimit is the default value for the BufferedByteLimit LoggerOption.
DefaultBufferedByteLimit = 1 << 30 // 1GiB
@@ -87,16 +90,22 @@ const (
defaultWriteTimeout = 10 * time.Minute
)
-// For testing:
-var now = time.Now
+var (
+ // ErrRedirectProtoPayloadNotSupported is returned when Logger is configured to redirect output and
+ // tries to redirect logs with protobuf payload.
+ ErrRedirectProtoPayloadNotSupported = errors.New("printEntryToStdout: cannot find valid payload")
-// ErrOverflow signals that the number of buffered entries for a Logger
-// exceeds its BufferLimit.
-var ErrOverflow = bundler.ErrOverflow
+ // For testing:
+ now = time.Now
-// ErrOversizedEntry signals that an entry's size exceeds the maximum number of
-// bytes that will be sent in a single call to the logging service.
-var ErrOversizedEntry = bundler.ErrOversizedItem
+ // ErrOverflow signals that the number of buffered entries for a Logger
+ // exceeds its BufferLimit.
+ ErrOverflow = bundler.ErrOverflow
+
+ // ErrOversizedEntry signals that an entry's size exceeds the maximum number of
+ // bytes that will be sent in a single call to the logging service.
+ ErrOversizedEntry = bundler.ErrOversizedItem
+)
// Client is a Logging client. A Client is associated with a single Cloud project.
type Client struct {
@@ -135,7 +144,10 @@ type Client struct {
// By default NewClient uses WriteScope. To use a different scope, call
// NewClient using a WithScopes option (see https://godoc.org/google.golang.org/api/option#WithScopes).
func NewClient(ctx context.Context, parent string, opts ...option.ClientOption) (*Client, error) {
- parent = makeParent(parent)
+ parent, err := makeParent(parent)
+ if err != nil {
+ return nil, err
+ }
opts = append([]option.ClientOption{
option.WithScopes(WriteScope),
}, opts...)
@@ -143,7 +155,7 @@ func NewClient(ctx context.Context, parent string, opts ...option.ClientOption)
if err != nil {
return nil, err
}
- c.SetGoogleClientInfo("gccl", version.Repo)
+ c.SetGoogleClientInfo("gccl", internal.Version)
client := &Client{
client: c,
parent: parent,
@@ -168,11 +180,15 @@ func NewClient(ctx context.Context, parent string, opts ...option.ClientOption)
return client, nil
}
-func makeParent(parent string) string {
+func makeParent(parent string) (string, error) {
if !strings.ContainsRune(parent, '/') {
- return "projects/" + parent
+ return "projects/" + parent, nil
+ }
+ prefix := strings.Split(parent, "/")[0]
+ if prefix != "projects" && prefix != "folders" && prefix != "billingAccounts" && prefix != "organizations" {
+ return parent, fmt.Errorf("parent parameter must start with 'projects/' 'folders/' 'billingAccounts/' or 'organizations/'")
}
- return parent
+ return parent, nil
}
// Ping reports whether the client's connection to the logging service and the
@@ -230,114 +246,14 @@ type Logger struct {
bundler *bundler.Bundler
// Options
- commonResource *mrpb.MonitoredResource
- commonLabels map[string]string
- ctxFunc func() (context.Context, func())
-}
-
-// A LoggerOption is a configuration option for a Logger.
-type LoggerOption interface {
- set(*Logger)
-}
-
-// CommonLabels are labels that apply to all log entries written from a Logger,
-// so that you don't have to repeat them in each log entry's Labels field. If
-// any of the log entries contains a (key, value) with the same key that is in
-// CommonLabels, then the entry's (key, value) overrides the one in
-// CommonLabels.
-func CommonLabels(m map[string]string) LoggerOption { return commonLabels(m) }
-
-type commonLabels map[string]string
-
-func (c commonLabels) set(l *Logger) { l.commonLabels = c }
-
-// ConcurrentWriteLimit determines how many goroutines will send log entries to the
-// underlying service. The default is 1. Set ConcurrentWriteLimit to a higher value to
-// increase throughput.
-func ConcurrentWriteLimit(n int) LoggerOption { return concurrentWriteLimit(n) }
-
-type concurrentWriteLimit int
-
-func (c concurrentWriteLimit) set(l *Logger) { l.bundler.HandlerLimit = int(c) }
-
-// DelayThreshold is the maximum amount of time that an entry should remain
-// buffered in memory before a call to the logging service is triggered. Larger
-// values of DelayThreshold will generally result in fewer calls to the logging
-// service, while increasing the risk that log entries will be lost if the
-// process crashes.
-// The default is DefaultDelayThreshold.
-func DelayThreshold(d time.Duration) LoggerOption { return delayThreshold(d) }
-
-type delayThreshold time.Duration
-
-func (d delayThreshold) set(l *Logger) { l.bundler.DelayThreshold = time.Duration(d) }
-
-// EntryCountThreshold is the maximum number of entries that will be buffered
-// in memory before a call to the logging service is triggered. Larger values
-// will generally result in fewer calls to the logging service, while
-// increasing both memory consumption and the risk that log entries will be
-// lost if the process crashes.
-// The default is DefaultEntryCountThreshold.
-func EntryCountThreshold(n int) LoggerOption { return entryCountThreshold(n) }
-
-type entryCountThreshold int
-
-func (e entryCountThreshold) set(l *Logger) { l.bundler.BundleCountThreshold = int(e) }
-
-// EntryByteThreshold is the maximum number of bytes of entries that will be
-// buffered in memory before a call to the logging service is triggered. See
-// EntryCountThreshold for a discussion of the tradeoffs involved in setting
-// this option.
-// The default is DefaultEntryByteThreshold.
-func EntryByteThreshold(n int) LoggerOption { return entryByteThreshold(n) }
-
-type entryByteThreshold int
-
-func (e entryByteThreshold) set(l *Logger) { l.bundler.BundleByteThreshold = int(e) }
-
-// EntryByteLimit is the maximum number of bytes of entries that will be sent
-// in a single call to the logging service. ErrOversizedEntry is returned if an
-// entry exceeds EntryByteLimit. This option limits the size of a single RPC
-// payload, to account for network or service issues with large RPCs. If
-// EntryByteLimit is smaller than EntryByteThreshold, the latter has no effect.
-// The default is zero, meaning there is no limit.
-func EntryByteLimit(n int) LoggerOption { return entryByteLimit(n) }
-
-type entryByteLimit int
-
-func (e entryByteLimit) set(l *Logger) { l.bundler.BundleByteLimit = int(e) }
-
-// BufferedByteLimit is the maximum number of bytes that the Logger will keep
-// in memory before returning ErrOverflow. This option limits the total memory
-// consumption of the Logger (but note that each Logger has its own, separate
-// limit). It is possible to reach BufferedByteLimit even if it is larger than
-// EntryByteThreshold or EntryByteLimit, because calls triggered by the latter
-// two options may be enqueued (and hence occupying memory) while new log
-// entries are being added.
-// The default is DefaultBufferedByteLimit.
-func BufferedByteLimit(n int) LoggerOption { return bufferedByteLimit(n) }
-
-type bufferedByteLimit int
-
-func (b bufferedByteLimit) set(l *Logger) { l.bundler.BufferedByteLimit = int(b) }
-
-// ContextFunc is a function that will be called to obtain a context.Context for the
-// WriteLogEntries RPC executed in the background for calls to Logger.Log. The
-// default is a function that always returns context.Background. The second return
-// value of the function is a function to call after the RPC completes.
-//
-// The function is not used for calls to Logger.LogSync, since the caller can pass
-// in the context directly.
-//
-// This option is EXPERIMENTAL. It may be changed or removed.
-func ContextFunc(f func() (ctx context.Context, afterCall func())) LoggerOption {
- return contextFunc(f)
+ commonResource *mrpb.MonitoredResource
+ commonLabels map[string]string
+ ctxFunc func() (context.Context, func())
+ populateSourceLocation int
+ partialSuccess bool
+ redirectOutputWriter io.Writer
}
-type contextFunc func() (ctx context.Context, afterCall func())
-
-func (c contextFunc) set(l *Logger) { l.ctxFunc = c }
-
// Logger returns a Logger that will write entries with the given log ID, such as
// "syslog". A log ID must be less than 512 characters long and can only
// include the following characters: upper and lower case alphanumeric
@@ -349,10 +265,13 @@ func (c *Client) Logger(logID string, opts ...LoggerOption) *Logger {
r = monitoredResource(c.parent)
}
l := &Logger{
- client: c,
- logName: internal.LogPath(c.parent, logID),
- commonResource: r,
- ctxFunc: func() (context.Context, func()) { return context.Background(), nil },
+ client: c,
+ logName: internal.LogPath(c.parent, logID),
+ commonResource: r,
+ ctxFunc: func() (context.Context, func()) { return context.Background(), nil },
+ populateSourceLocation: DoNotPopulateSourceLocation,
+ partialSuccess: false,
+ redirectOutputWriter: nil,
}
l.bundler = bundler.NewBundler(&logpb.LogEntry{}, func(entries interface{}) {
l.writeLogEntries(entries.([]*logpb.LogEntry))
@@ -464,10 +383,14 @@ func (v Severity) String() string {
// Severity.
func (v *Severity) UnmarshalJSON(data []byte) error {
var s string
- if err := json.Unmarshal(data, &s); err != nil {
- return err
+ var i int
+ if strErr := json.Unmarshal(data, &s); strErr == nil {
+ *v = ParseSeverity(s)
+ } else if intErr := json.Unmarshal(data, &i); intErr == nil {
+ *v = Severity(i)
+ } else {
+ return fmt.Errorf("%v; %v", strErr, intErr)
}
- *v = ParseSeverity(s)
return nil
}
@@ -705,28 +628,52 @@ func jsonValueToStructValue(v interface{}) *structpb.Value {
// and will block, it is intended primarily for debugging or critical errors.
// Prefer Log for most uses.
func (l *Logger) LogSync(ctx context.Context, e Entry) error {
- ent, err := toLogEntryInternal(e, l.client, l.client.parent)
+ ent, err := toLogEntryInternal(e, l, l.client.parent, 1)
if err != nil {
return err
}
+ entries, hasInstrumentation := l.instrumentLogs([]*logpb.LogEntry{ent})
+ if l.redirectOutputWriter != nil {
+ for _, ent = range entries {
+ err = serializeEntryToWriter(ent, l.redirectOutputWriter)
+ if err != nil {
+ break
+ }
+ }
+ return err
+ }
_, err = l.client.client.WriteLogEntries(ctx, &logpb.WriteLogEntriesRequest{
- LogName: l.logName,
- Resource: l.commonResource,
- Labels: l.commonLabels,
- Entries: []*logpb.LogEntry{ent},
+ LogName: l.logName,
+ Resource: l.commonResource,
+ Labels: l.commonLabels,
+ Entries: entries,
+ PartialSuccess: l.partialSuccess || hasInstrumentation,
})
return err
}
// Log buffers the Entry for output to the logging service. It never blocks.
func (l *Logger) Log(e Entry) {
- ent, err := toLogEntryInternal(e, l.client, l.client.parent)
+ ent, err := toLogEntryInternal(e, l, l.client.parent, 1)
if err != nil {
l.client.error(err)
return
}
- if err := l.bundler.Add(ent, proto.Size(ent)); err != nil {
- l.client.error(err)
+
+ entries, _ := l.instrumentLogs([]*logpb.LogEntry{ent})
+ if l.redirectOutputWriter != nil {
+ for _, ent = range entries {
+ err = serializeEntryToWriter(ent, l.redirectOutputWriter)
+ if err != nil {
+ l.client.error(err)
+ }
+ }
+ return
+ }
+ for _, ent = range entries {
+ if err := l.bundler.Add(ent, proto.Size(ent)); err != nil {
+ l.client.error(err)
+ }
}
}
@@ -742,11 +689,16 @@ func (l *Logger) Flush() error {
}
func (l *Logger) writeLogEntries(entries []*logpb.LogEntry) {
+ partialSuccess := l.partialSuccess
+ if len(entries) > 1 {
+ partialSuccess = partialSuccess || hasInstrumentation(entries)
+ }
req := &logpb.WriteLogEntriesRequest{
- LogName: l.logName,
- Resource: l.commonResource,
- Labels: l.commonLabels,
- Entries: entries,
+ LogName: l.logName,
+ Resource: l.commonResource,
+ Labels: l.commonLabels,
+ Entries: entries,
+ PartialSuccess: partialSuccess,
}
ctx, afterCall := l.ctxFunc()
ctx, cancel := context.WithTimeout(ctx, defaultWriteTimeout)
@@ -767,7 +719,59 @@ func (l *Logger) writeLogEntries(entries []*logpb.LogEntry) {
// (for example by calling SetFlags or SetPrefix).
func (l *Logger) StandardLogger(s Severity) *log.Logger { return l.stdLoggers[s] }
-var reCloudTraceContext = regexp.MustCompile(
+func populateTraceInfo(e *Entry, req *http.Request) bool {
+ if req == nil {
+ if e.HTTPRequest != nil && e.HTTPRequest.Request != nil {
+ req = e.HTTPRequest.Request
+ } else {
+ return false
+ }
+ }
+ header := req.Header.Get("Traceparent")
+ if header != "" {
+ // do not use traceSampled flag defined by traceparent because
+ // flag's definition differs from expected by Cloud Tracing
+ traceID, spanID, _ := deconstructTraceParent(header)
+ if traceID != "" {
+ e.Trace = traceID
+ e.SpanID = spanID
+ return true
+ }
+ }
+ header = req.Header.Get("X-Cloud-Trace-Context")
+ if header != "" {
+ traceID, spanID, traceSampled := deconstructXCloudTraceContext(header)
+ if traceID != "" {
+ e.Trace = traceID
+ e.SpanID = spanID
+ // enforce sampling if required
+ e.TraceSampled = e.TraceSampled || traceSampled
+ return true
+ }
+ }
+ return false
+}
+
+// As per format described at https://www.w3.org/TR/trace-context/#traceparent-header-field-values
+var validTraceParentExpression = regexp.MustCompile(`^(00)-([a-fA-F\d]{32})-([a-f\d]{16})-([a-fA-F\d]{2})$`)
+
+func deconstructTraceParent(s string) (traceID, spanID string, traceSampled bool) {
+ matches := validTraceParentExpression.FindStringSubmatch(s)
+ if matches != nil {
+ // regexp package does not support negative lookahead preventing all 0 validations
+ if matches[2] == "00000000000000000000000000000000" || matches[3] == "0000000000000000" {
+ return
+ }
+ flags, err := strconv.ParseInt(matches[4], 16, 16)
+ if err == nil {
+ traceSampled = (flags & 0x01) == 1
+ }
+ traceID, spanID = matches[2], matches[3]
+ }
+ return
+}
+
+var validXCloudTraceContext = regexp.MustCompile(
// Matches on "TRACE_ID"
`([a-f\d]+)?` +
// Matches on "/SPAN_ID"
@@ -785,9 +789,11 @@ func deconstructXCloudTraceContext(s string) (traceID, spanID string, traceSampl
// * traceID (optional): "105445aa7843bc8bf206b120001000"
// * spanID (optional): "1"
// * traceSampled (optional): true
- matches := reCloudTraceContext.FindStringSubmatch(s)
+ matches := validXCloudTraceContext.FindStringSubmatch(s)
- traceID, spanID, traceSampled = matches[1], matches[2], matches[3] == "1"
+ if matches != nil {
+ traceID, spanID, traceSampled = matches[1], matches[2], matches[3] == "1"
+ }
if spanID == "0" {
spanID = ""
@@ -811,11 +817,20 @@ func deconstructXCloudTraceContext(s string) (traceID, spanID string, traceSampl
// Logger.LogSync are used, it is intended to be used together with direct call
// to WriteLogEntries method.
func ToLogEntry(e Entry, parent string) (*logpb.LogEntry, error) {
- // We have this method to support logging agents that need a bigger flexibility.
- return toLogEntryInternal(e, nil, makeParent(parent))
+ var l Logger
+ return l.ToLogEntry(e, parent)
+}
+
+// ToLogEntry for Logger instance
+func (l *Logger) ToLogEntry(e Entry, parent string) (*logpb.LogEntry, error) {
+ parent, err := makeParent(parent)
+ if err != nil {
+ return nil, err
+ }
+ return toLogEntryInternal(e, l, parent, 1)
}
-func toLogEntryInternal(e Entry, client *Client, parent string) (*logpb.LogEntry, error) {
+func toLogEntryInternal(e Entry, l *Logger, parent string, skipLevels int) (*logpb.LogEntry, error) {
if e.LogName != "" {
return nil, errors.New("logging: Entry.LogName should be not be set when writing")
}
@@ -823,33 +838,34 @@ func toLogEntryInternal(e Entry, client *Client, parent string) (*logpb.LogEntry
if t.IsZero() {
t = now()
}
- ts, err := ptypes.TimestampProto(t)
- if err != nil {
- return nil, err
- }
- if e.Trace == "" && e.HTTPRequest != nil && e.HTTPRequest.Request != nil {
- traceHeader := e.HTTPRequest.Request.Header.Get("X-Cloud-Trace-Context")
- if traceHeader != "" {
- // Set to a relative resource name, as described at
- // https://cloud.google.com/appengine/docs/flexible/go/writing-application-logs.
- traceID, spanID, traceSampled := deconstructXCloudTraceContext(traceHeader)
- if traceID != "" {
- e.Trace = fmt.Sprintf("%s/traces/%s", parent, traceID)
- }
- if e.SpanID == "" {
- e.SpanID = spanID
+ ts := timestamppb.New(t)
+ if l != nil && l.populateSourceLocation != DoNotPopulateSourceLocation && e.SourceLocation == nil {
+ if l.populateSourceLocation == AlwaysPopulateSourceLocation ||
+ l.populateSourceLocation == PopulateSourceLocationForDebugEntries && e.Severity == Severity(Debug) {
+ // filename and line are captured for source code that calls
+ // skipLevels up the goroutine calling stack + 1 for this func.
+ pc, file, line, ok := runtime.Caller(skipLevels + 1)
+ if ok {
+ details := runtime.FuncForPC(pc)
+ e.SourceLocation = &logpb.LogEntrySourceLocation{
+ File: file,
+ Function: details.Name(),
+ Line: int64(line),
+ }
}
-
- // If we previously hadn't set TraceSampled, let's retrieve it
- // from the HTTP request's header, as per:
- // https://cloud.google.com/trace/docs/troubleshooting#force-trace
- e.TraceSampled = e.TraceSampled || traceSampled
+ }
+ }
+ if e.Trace == "" {
+ populateTraceInfo(&e, nil)
+ // format trace
+ if e.Trace != "" && !strings.Contains(e.Trace, "/traces/") {
+ e.Trace = fmt.Sprintf("%s/traces/%s", parent, e.Trace)
}
}
req, err := fromHTTPRequest(e.HTTPRequest)
if err != nil {
- if client != nil {
- client.error(err)
+ if l != nil && l.client != nil {
+ l.client.error(err)
} else {
return nil, err
}
@@ -870,6 +886,8 @@ func toLogEntryInternal(e Entry, client *Client, parent string) (*logpb.LogEntry
switch p := e.Payload.(type) {
case string:
ent.Payload = &logpb.LogEntry_TextPayload{TextPayload: p}
+ case *anypb.Any:
+ ent.Payload = &logpb.LogEntry_ProtoPayload{ProtoPayload: p}
default:
s, err := toProtoStruct(p)
if err != nil {
@@ -879,3 +897,48 @@ func toLogEntryInternal(e Entry, client *Client, parent string) (*logpb.LogEntry
}
return ent, nil
}
+
+// entry represents the fields of a logging.Entry that can be parsed by Logging agent.
+// See the mappings at https://cloud.google.com/logging/docs/structured-logging#special-payload-fields
+type structuredLogEntry struct {
+ // JsonMessage map[string]interface{} `json:"message,omitempty"`
+ // TextMessage string `json:"message,omitempty"`
+ Message json.RawMessage `json:"message"`
+ Severity string `json:"severity,omitempty"`
+ HTTPRequest *logtypepb.HttpRequest `json:"httpRequest,omitempty"`
+ Timestamp string `json:"timestamp,omitempty"`
+ Labels map[string]string `json:"logging.googleapis.com/labels,omitempty"`
+ InsertID string `json:"logging.googleapis.com/insertId,omitempty"`
+ Operation *logpb.LogEntryOperation `json:"logging.googleapis.com/operation,omitempty"`
+ SourceLocation *logpb.LogEntrySourceLocation `json:"logging.googleapis.com/sourceLocation,omitempty"`
+ SpanID string `json:"logging.googleapis.com/spanId,omitempty"`
+ Trace string `json:"logging.googleapis.com/trace,omitempty"`
+ TraceSampled bool `json:"logging.googleapis.com/trace_sampled,omitempty"`
+}
+
+func serializeEntryToWriter(entry *logpb.LogEntry, w io.Writer) error {
+ jsonifiedEntry := structuredLogEntry{
+ Severity: entry.Severity.String(),
+ HTTPRequest: entry.HttpRequest,
+ Timestamp: entry.Timestamp.String(),
+ Labels: entry.Labels,
+ InsertID: entry.InsertId,
+ Operation: entry.Operation,
+ SourceLocation: entry.SourceLocation,
+ SpanID: entry.SpanId,
+ Trace: entry.Trace,
+ TraceSampled: entry.TraceSampled,
+ }
+ var err error
+ if entry.GetTextPayload() != "" {
+ jsonifiedEntry.Message, err = json.Marshal(entry.GetTextPayload())
+ } else if entry.GetJsonPayload() != nil {
+ jsonifiedEntry.Message, err = json.Marshal(entry.GetJsonPayload().AsMap())
+ } else {
+ return ErrRedirectProtoPayloadNotSupported
+ }
+ if err == nil {
+ err = json.NewEncoder(w).Encode(jsonifiedEntry)
+ }
+ return err
+}
diff --git a/vendor/cloud.google.com/go/logging/release-please-config.json b/vendor/cloud.google.com/go/logging/release-please-config.json
new file mode 100644
index 000000000..3e96284bf
--- /dev/null
+++ b/vendor/cloud.google.com/go/logging/release-please-config.json
@@ -0,0 +1,11 @@
+{
+ "release-type": "go-yoshi",
+ "separate-pull-requests": true,
+ "include-component-in-tag": true,
+ "tag-separator": "/",
+ "packages": {
+ "logging": {
+ "component": "logging"
+ }
+ }
+} \ No newline at end of file
diff --git a/vendor/cloud.google.com/go/logging/resource.go b/vendor/cloud.google.com/go/logging/resource.go
index b73b28907..f8416e436 100644
--- a/vendor/cloud.google.com/go/logging/resource.go
+++ b/vendor/cloud.google.com/go/logging/resource.go
@@ -15,12 +15,11 @@
package logging
import (
- "io/ioutil"
- "os"
+ "runtime"
"strings"
"sync"
- "cloud.google.com/go/compute/metadata"
+ "cloud.google.com/go/logging/internal"
mrpb "google.golang.org/genproto/googleapis/api/monitoredres"
)
@@ -34,200 +33,224 @@ type commonResource struct{ *mrpb.MonitoredResource }
func (r commonResource) set(l *Logger) { l.commonResource = r.MonitoredResource }
-var detectedResource struct {
- pb *mrpb.MonitoredResource
- once sync.Once
+type resource struct {
+ pb *mrpb.MonitoredResource
+ attrs internal.ResourceAttributesGetter
+ once *sync.Once
}
-// isAppEngine returns true for both standard and flex
-func isAppEngine() bool {
- _, service := os.LookupEnv("GAE_SERVICE")
- _, version := os.LookupEnv("GAE_VERSION")
- _, instance := os.LookupEnv("GAE_INSTANCE")
+var detectedResource = &resource{
+ attrs: internal.ResourceAttributes(),
+ once: new(sync.Once),
+}
- return service && version && instance
+func (r *resource) metadataProjectID() string {
+ return r.attrs.Metadata("project/project-id")
}
-func detectAppEngineResource() *mrpb.MonitoredResource {
- projectID, err := metadata.ProjectID()
- if err != nil {
- return nil
+func (r *resource) metadataZone() string {
+ zone := r.attrs.Metadata("instance/zone")
+ if zone != "" {
+ return zone[strings.LastIndex(zone, "/")+1:]
+ }
+ return ""
+}
+
+func (r *resource) metadataRegion() string {
+ region := r.attrs.Metadata("instance/region")
+ if region != "" {
+ return region[strings.LastIndex(region, "/")+1:]
}
+ return ""
+}
+
+// isMetadataActive queries valid response on "/computeMetadata/v1/" URL
+func (r *resource) isMetadataActive() bool {
+ data := r.attrs.Metadata("")
+ return data != ""
+}
+
+// isAppEngine returns true for both standard and flex
+func (r *resource) isAppEngine() bool {
+ service := r.attrs.EnvVar("GAE_SERVICE")
+ version := r.attrs.EnvVar("GAE_VERSION")
+ instance := r.attrs.EnvVar("GAE_INSTANCE")
+ return service != "" && version != "" && instance != ""
+}
+
+func detectAppEngineResource() *mrpb.MonitoredResource {
+ projectID := detectedResource.metadataProjectID()
if projectID == "" {
- projectID = os.Getenv("GOOGLE_CLOUD_PROJECT")
+ projectID = detectedResource.attrs.EnvVar("GOOGLE_CLOUD_PROJECT")
}
- zone, err := metadata.Zone()
- if err != nil {
+ if projectID == "" {
return nil
}
+ zone := detectedResource.metadataZone()
+ service := detectedResource.attrs.EnvVar("GAE_SERVICE")
+ version := detectedResource.attrs.EnvVar("GAE_VERSION")
return &mrpb.MonitoredResource{
Type: "gae_app",
Labels: map[string]string{
- "project_id": projectID,
- "module_id": os.Getenv("GAE_SERVICE"),
- "version_id": os.Getenv("GAE_VERSION"),
- "instance_id": os.Getenv("GAE_INSTANCE"),
- "runtime": os.Getenv("GAE_RUNTIME"),
- "zone": zone,
+ "project_id": projectID,
+ "module_id": service,
+ "version_id": version,
+ "zone": zone,
},
}
}
-func isCloudFunction() bool {
- // Reserved envvars in older function runtimes, e.g. Node.js 8, Python 3.7 and Go 1.11.
- _, name := os.LookupEnv("FUNCTION_NAME")
- _, region := os.LookupEnv("FUNCTION_REGION")
- _, entry := os.LookupEnv("ENTRY_POINT")
-
- // Reserved envvars in newer function runtimes.
- _, target := os.LookupEnv("FUNCTION_TARGET")
- _, signature := os.LookupEnv("FUNCTION_SIGNATURE_TYPE")
- _, service := os.LookupEnv("K_SERVICE")
- return (name && region && entry) || (target && signature && service)
+func (r *resource) isCloudFunction() bool {
+ target := r.attrs.EnvVar("FUNCTION_TARGET")
+ signature := r.attrs.EnvVar("FUNCTION_SIGNATURE_TYPE")
+ // note that this envvar is also present in Cloud Run environments
+ service := r.attrs.EnvVar("K_SERVICE")
+ return target != "" && signature != "" && service != ""
}
func detectCloudFunction() *mrpb.MonitoredResource {
- projectID, err := metadata.ProjectID()
- if err != nil {
- return nil
- }
- zone, err := metadata.Zone()
- if err != nil {
+ projectID := detectedResource.metadataProjectID()
+ if projectID == "" {
return nil
}
- // Newer functions runtimes store name in K_SERVICE.
- functionName, exists := os.LookupEnv("K_SERVICE")
- if !exists {
- functionName, _ = os.LookupEnv("FUNCTION_NAME")
- }
+ region := detectedResource.metadataRegion()
+ functionName := detectedResource.attrs.EnvVar("K_SERVICE")
return &mrpb.MonitoredResource{
Type: "cloud_function",
Labels: map[string]string{
"project_id": projectID,
- "region": regionFromZone(zone),
+ "region": region,
"function_name": functionName,
},
}
}
-func isCloudRun() bool {
- _, config := os.LookupEnv("K_CONFIGURATION")
- _, service := os.LookupEnv("K_SERVICE")
- _, revision := os.LookupEnv("K_REVISION")
- return config && service && revision
+func (r *resource) isCloudRun() bool {
+ config := r.attrs.EnvVar("K_CONFIGURATION")
+ // note that this envvar is also present in Cloud Function environments
+ service := r.attrs.EnvVar("K_SERVICE")
+ revision := r.attrs.EnvVar("K_REVISION")
+ return config != "" && service != "" && revision != ""
}
func detectCloudRunResource() *mrpb.MonitoredResource {
- projectID, err := metadata.ProjectID()
- if err != nil {
- return nil
- }
- zone, err := metadata.Zone()
- if err != nil {
+ projectID := detectedResource.metadataProjectID()
+ if projectID == "" {
return nil
}
+ region := detectedResource.metadataRegion()
+ config := detectedResource.attrs.EnvVar("K_CONFIGURATION")
+ service := detectedResource.attrs.EnvVar("K_SERVICE")
+ revision := detectedResource.attrs.EnvVar("K_REVISION")
return &mrpb.MonitoredResource{
Type: "cloud_run_revision",
Labels: map[string]string{
"project_id": projectID,
- "location": regionFromZone(zone),
- "service_name": os.Getenv("K_SERVICE"),
- "revision_name": os.Getenv("K_REVISION"),
- "configuration_name": os.Getenv("K_CONFIGURATION"),
+ "location": region,
+ "service_name": service,
+ "revision_name": revision,
+ "configuration_name": config,
},
}
}
-func isKubernetesEngine() bool {
- clusterName, err := metadata.InstanceAttributeValue("cluster-name")
- // Note: InstanceAttributeValue can return "", nil
- if err != nil || clusterName == "" {
+func (r *resource) isKubernetesEngine() bool {
+ clusterName := r.attrs.Metadata("instance/attributes/cluster-name")
+ if clusterName == "" {
return false
}
return true
}
func detectKubernetesResource() *mrpb.MonitoredResource {
- projectID, err := metadata.ProjectID()
- if err != nil {
- return nil
- }
- zone, err := metadata.Zone()
- if err != nil {
- return nil
- }
- clusterName, err := metadata.InstanceAttributeValue("cluster-name")
- if err != nil {
+ projectID := detectedResource.metadataProjectID()
+ if projectID == "" {
return nil
}
- namespaceBytes, err := ioutil.ReadFile("/var/run/secrets/kubernetes.io/serviceaccount/namespace")
- namespaceName := ""
- if err == nil {
- namespaceName = string(namespaceBytes)
+ zone := detectedResource.metadataZone()
+ clusterName := detectedResource.attrs.Metadata("instance/attributes/cluster-name")
+ namespaceName := detectedResource.attrs.ReadAll("/var/run/secrets/kubernetes.io/serviceaccount/namespace")
+ if namespaceName == "" {
+ // if automountServiceAccountToken is disabled allow to customize
+ // the namespace via environment
+ namespaceName = detectedResource.attrs.EnvVar("NAMESPACE_NAME")
}
+ // note: if deployment customizes hostname, HOSTNAME envvar will have invalid content
+ podName := detectedResource.attrs.EnvVar("HOSTNAME")
+ // there is no way to derive container name from within container; use custom envvar if available
+ containerName := detectedResource.attrs.EnvVar("CONTAINER_NAME")
return &mrpb.MonitoredResource{
Type: "k8s_container",
Labels: map[string]string{
"cluster_name": clusterName,
"location": zone,
"project_id": projectID,
- "pod_name": os.Getenv("HOSTNAME"),
+ "pod_name": podName,
"namespace_name": namespaceName,
- // To get the `container_name` label, users need to explicitly provide it.
- "container_name": os.Getenv("CONTAINER_NAME"),
+ "container_name": containerName,
},
}
}
-func detectGCEResource() *mrpb.MonitoredResource {
- projectID, err := metadata.ProjectID()
- if err != nil {
- return nil
- }
- id, err := metadata.InstanceID()
- if err != nil {
- return nil
- }
- zone, err := metadata.Zone()
- if err != nil {
- return nil
- }
- name, err := metadata.InstanceName()
- if err != nil {
+func (r *resource) isComputeEngine() bool {
+ preempted := r.attrs.Metadata("instance/preempted")
+ platform := r.attrs.Metadata("instance/cpu-platform")
+ appBucket := r.attrs.Metadata("instance/attributes/gae_app_bucket")
+ return preempted != "" && platform != "" && appBucket == ""
+}
+
+func detectComputeEngineResource() *mrpb.MonitoredResource {
+ projectID := detectedResource.metadataProjectID()
+ if projectID == "" {
return nil
}
+ id := detectedResource.attrs.Metadata("instance/id")
+ zone := detectedResource.metadataZone()
return &mrpb.MonitoredResource{
Type: "gce_instance",
Labels: map[string]string{
- "project_id": projectID,
- "instance_id": id,
- "instance_name": name,
- "zone": zone,
+ "project_id": projectID,
+ "instance_id": id,
+ "zone": zone,
},
}
}
func detectResource() *mrpb.MonitoredResource {
detectedResource.once.Do(func() {
- switch {
- // AppEngine, Functions, CloudRun, Kubernetes are detected first,
- // as metadata.OnGCE() erroneously returns true on these runtimes.
- case isAppEngine():
- detectedResource.pb = detectAppEngineResource()
- case isCloudFunction():
- detectedResource.pb = detectCloudFunction()
- case isCloudRun():
- detectedResource.pb = detectCloudRunResource()
- case isKubernetesEngine():
- detectedResource.pb = detectKubernetesResource()
- case metadata.OnGCE():
- detectedResource.pb = detectGCEResource()
+ if detectedResource.isMetadataActive() {
+ name := systemProductName()
+ switch {
+ case name == "Google App Engine", detectedResource.isAppEngine():
+ detectedResource.pb = detectAppEngineResource()
+ case name == "Google Cloud Functions", detectedResource.isCloudFunction():
+ detectedResource.pb = detectCloudFunction()
+ case name == "Google Cloud Run", detectedResource.isCloudRun():
+ detectedResource.pb = detectCloudRunResource()
+ // cannot use name validation for GKE and GCE because
+ // both of them set product name to "Google Compute Engine"
+ case detectedResource.isKubernetesEngine():
+ detectedResource.pb = detectKubernetesResource()
+ case detectedResource.isComputeEngine():
+ detectedResource.pb = detectComputeEngineResource()
+ }
}
})
return detectedResource.pb
}
+// systemProductName reads resource type on the Linux-based environments such as
+// Cloud Functions, Cloud Run, GKE, GCE, GAE, etc.
+func systemProductName() string {
+ if runtime.GOOS != "linux" {
+ // We don't have any non-Linux clues available, at least yet.
+ return ""
+ }
+ slurp := detectedResource.attrs.ReadAll("/sys/class/dmi/id/product_name")
+ return strings.TrimSpace(slurp)
+}
+
var resourceInfo = map[string]struct{ rtype, label string }{
"organizations": {"organization", "organization_id"},
"folders": {"folder", "folder_id"},
@@ -250,14 +273,6 @@ func monitoredResource(parent string) *mrpb.MonitoredResource {
}
}
-func regionFromZone(zone string) string {
- cutoff := strings.LastIndex(zone, "-")
- if cutoff > 0 {
- return zone[:cutoff]
- }
- return zone
-}
-
func globalResource(projectID string) *mrpb.MonitoredResource {
return &mrpb.MonitoredResource{
Type: "global",