Skip to content

Commit

Permalink
chore(deps): bump google.golang.org/protobuf from 1.31.0 to 1.32.0
Browse files Browse the repository at this point in the history
Bumps google.golang.org/protobuf from 1.31.0 to 1.32.0.

---
updated-dependencies:
- dependency-name: google.golang.org/protobuf
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
  • Loading branch information
dependabot[bot] committed Jan 2, 2024
1 parent 4eb7980 commit aaf5012
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 51 deletions.
86 changes: 43 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,53 +28,53 @@ Examples
package examplelibrary

import (
"context"
"context"

"go.einride.tech/aip/pagination"
"google.golang.org/genproto/googleapis/example/library/v1"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"go.einride.tech/aip/pagination"
"google.golang.org/genproto/googleapis/example/library/v1"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)

func (s *Server) ListShelves(
ctx context.Context,
request *library.ListShelvesRequest,
ctx context.Context,
request *library.ListShelvesRequest,
) (*library.ListShelvesResponse, error) {
// Handle request constraints.
const (
maxPageSize = 1000
defaultPageSize = 100
)
switch {
case request.PageSize < 0:
return nil, status.Errorf(codes.InvalidArgument, "page size is negative")
case request.PageSize == 0:
request.PageSize = defaultPageSize
case request.PageSize > maxPageSize:
request.PageSize = maxPageSize
}
// Use pagination.PageToken for offset-based page tokens.
pageToken, err := pagination.ParsePageToken(request)
if err != nil {
return nil, status.Errorf(codes.InvalidArgument, "invalid page token")
}
// Query the storage.
result, err := s.Storage.ListShelves(ctx, &ListShelvesQuery{
Offset: pageToken.Offset,
PageSize: request.GetPageSize(),
})
if err != nil {
return nil, err
}
// Build the response.
response := &library.ListShelvesResponse{
Shelves: result.Shelves,
}
// Set the next page token.
if result.HasNextPage {
response.NextPageToken = pageToken.Next(request).String()
}
// Respond.
return response, nil
// Handle request constraints.
const (
§ maxPageSize = 1000
defaultPageSize = 100
)
switch {
case request.PageSize < 0:
return nil, status.Errorf(codes.InvalidArgument, "page size is negative")
case request.PageSize == 0:
request.PageSize = defaultPageSize
case request.PageSize > maxPageSize:
request.PageSize = maxPageSize
}
// Use pagination.PageToken for offset-based page tokens.
pageToken, err := pagination.ParsePageToken(request)
if err != nil {
return nil, status.Errorf(codes.InvalidArgument, "invalid page token")
}
// Query the storage.
result, err := s.Storage.ListShelves(ctx, &ListShelvesQuery{
Offset: pageToken.Offset,
PageSize: request.GetPageSize(),
})
if err != nil {
return nil, err
}
// Build the response.
response := &library.ListShelvesResponse{
Shelves: result.Shelves,
}
// Set the next page token.
if result.HasNextPage {
response.NextPageToken = pageToken.Next(request).String()
}
// Respond.
return response, nil
}
```
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97
google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97
google.golang.org/grpc v1.60.1
google.golang.org/protobuf v1.31.0
google.golang.org/protobuf v1.32.0
gotest.tools/v3 v3.5.1
)

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU=
google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
Expand Down
2 changes: 1 addition & 1 deletion proto/gen/einride/example/freight/v1/freight_service.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion proto/gen/einride/example/freight/v1/shipment.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion proto/gen/einride/example/freight/v1/shipper.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion proto/gen/einride/example/freight/v1/site.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion proto/gen/einride/example/syntax/v1/syntax.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit aaf5012

Please sign in to comment.