Skip to content

Commit

Permalink
Pagination Module
Browse files Browse the repository at this point in the history
  • Loading branch information
bbengfort committed Sep 30, 2023
1 parent 163c6ca commit b48b52c
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 23 deletions.
59 changes: 40 additions & 19 deletions pagination/pagination.pb.go

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

8 changes: 8 additions & 0 deletions proto/buf.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Generated by buf. DO NOT EDIT.
version: v1
deps:
- remote: buf.build
owner: googleapis
repository: googleapis
commit: 28151c0d0a1641bf938a7672c500e01d
digest: shake256:49215edf8ef57f7863004539deff8834cfb2195113f0b890dd1f67815d9353e28e668019165b9d872395871eeafcbab3ccfdb2b5f11734d3cca95be9e8d139de
2 changes: 2 additions & 0 deletions proto/buf.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
version: v1
name: buf.build/rotational/honudb
deps:
- buf.build/googleapis/googleapis
breaking:
use:
- FILE
Expand Down
19 changes: 15 additions & 4 deletions proto/pagination/v1/pagination.proto
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
syntax = "proto3";

package honu.pagination.v1;

import "google/protobuf/timestamp.proto";

option go_package = "github.com/rotationalio/honu/pagination";

// Implements a protocol buffer struct for state managed pagination. This struct will be
Expand All @@ -10,7 +13,15 @@ option go_package = "github.com/rotationalio/honu/pagination";
// size in the cursor matches the page size in the request.
// See https://cloud.google.com/apis/design/design_patterns#list_pagination for more.
message PageCursor {
int32 page_size = 1; // the number of results returned on each iteration.
bytes next_key = 2; // the key to start the iteration from
string namespace = 3; // the namespace the cursor is iterating on
}
// The number of results returned on each iteration.
int32 page_size = 1;

// The key to start the iteration from for forward iteration (e.g. the seek key).
bytes next_key = 2;

// The namespace the cursor is iterating on
string namespace = 3;

// The timestamp when the cursor is no longer valid.
google.protobuf.Timestamp expires = 4;
}

0 comments on commit b48b52c

Please sign in to comment.