diff options
| author | dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> | 2024-06-01 01:58:18 +0000 |
|---|---|---|
| committer | Taras Madan <tarasmadan@google.com> | 2024-06-03 10:35:00 +0000 |
| commit | ec102f24cae4dd25c09ca260e69b341535d8efce (patch) | |
| tree | ad3dc946696f6c0008e5ffdc09f063bacae2ea4c /vendor/cloud.google.com/go/logging/logadmin | |
| parent | c25b84828149a4957a795b08eb70caf5e89f8d9b (diff) | |
mod: bump cloud.google.com/go/logging from 1.9.0 to 1.10.0
Bumps [cloud.google.com/go/logging](https://github.com/googleapis/google-cloud-go) from 1.9.0 to 1.10.0.
- [Release notes](https://github.com/googleapis/google-cloud-go/releases)
- [Changelog](https://github.com/googleapis/google-cloud-go/blob/main/documentai/CHANGES.md)
- [Commits](https://github.com/googleapis/google-cloud-go/compare/dlp/v1.9.0...dlp/v1.10.0)
---
updated-dependencies:
- dependency-name: cloud.google.com/go/logging
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
Diffstat (limited to 'vendor/cloud.google.com/go/logging/logadmin')
| -rw-r--r-- | vendor/cloud.google.com/go/logging/logadmin/logadmin.go | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/vendor/cloud.google.com/go/logging/logadmin/logadmin.go b/vendor/cloud.google.com/go/logging/logadmin/logadmin.go index 1ec2b4c22..04d8459f2 100644 --- a/vendor/cloud.google.com/go/logging/logadmin/logadmin.go +++ b/vendor/cloud.google.com/go/logging/logadmin/logadmin.go @@ -37,7 +37,6 @@ import ( vkit "cloud.google.com/go/logging/apiv2" logpb "cloud.google.com/go/logging/apiv2/loggingpb" "cloud.google.com/go/logging/internal" - "github.com/golang/protobuf/ptypes" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -138,10 +137,10 @@ func toHTTPRequest(p *logtypepb.HttpRequest) (*logging.HTTPRequest, error) { } var dur time.Duration if p.Latency != nil { - dur, err = ptypes.Duration(p.Latency) - if err != nil { + if err := p.GetLatency().CheckValid(); err != nil { return nil, err } + dur = p.GetLatency().AsDuration() } hr := &http.Request{ Method: p.RequestMethod, @@ -223,6 +222,13 @@ type newestFirst struct{} func (newestFirst) set(r *logpb.ListLogEntriesRequest) { r.OrderBy = "timestamp desc" } +// PageSize provide a way to override number of results to return from each request. +func PageSize(p int32) EntriesOption { return pageSize(p) } + +type pageSize int32 + +func (p pageSize) set(r *logpb.ListLogEntriesRequest) { r.PageSize = int32(p) } + // Entries returns an EntryIterator for iterating over log entries. By default, // the log entries will be restricted to those from the project passed to // NewClient. This may be overridden by passing a ProjectIDs option. Requires ReadScope or AdminScope. @@ -304,21 +310,21 @@ func (it *EntryIterator) fetch(pageSize int, pageToken string) (string, error) { var slashUnescaper = strings.NewReplacer("%2F", "/", "%2f", "/") func fromLogEntry(le *logpb.LogEntry) (*logging.Entry, error) { - time, err := ptypes.Timestamp(le.Timestamp) - if err != nil { + if err := le.GetTimestamp().CheckValid(); err != nil { return nil, err } + time := le.GetTimestamp().AsTime() var payload interface{} switch x := le.Payload.(type) { case *logpb.LogEntry_TextPayload: payload = x.TextPayload case *logpb.LogEntry_ProtoPayload: - var d ptypes.DynamicAny - if err := ptypes.UnmarshalAny(x.ProtoPayload, &d); err != nil { + msg, err := x.ProtoPayload.UnmarshalNew() + if err != nil { return nil, fmt.Errorf("logging: unmarshalling proto payload: %w", err) } - payload = d.Message + payload = msg case *logpb.LogEntry_JsonPayload: // Leave this as a Struct. |
