Skip to content

Commit

Permalink
Add paging support for project and tenant (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
majst01 authored Oct 31, 2022
1 parent 5334903 commit d49f6bb
Show file tree
Hide file tree
Showing 31 changed files with 1,261 additions and 516 deletions.
15 changes: 12 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,18 @@ client:

.PHONY: mocks
mocks:
@if ! which mockery > /dev/null; then echo "mockery needs to be installed (https://github.com/vektra/mockery)"; exit 1; fi
cd api/v1 && mockery --name ProjectServiceClient && mockery --name TenantServiceClient && cd -
cd pkg/datastore && mockery --name Storage && cd -
rm -rf pkg/datastore/mocks api/v1/mocks
docker run --rm \
--user $$(id -u):$$(id -g) \
-w /work \
-v ${PWD}:/work \
vektra/mockery:v2.14.0 -r --keeptree --dir api/v1 --output api/v1/mocks --all

docker run --rm \
--user $$(id -u):$$(id -g) \
-w /work \
-v ${PWD}:/work \
vektra/mockery:v2.14.0 -r --keeptree --dir pkg/datastore --output pkg/datastore/mocks --all

.PHONY: postgres-up
postgres-up: postgres-rm
Expand Down
2 changes: 1 addition & 1 deletion api/grpc/health/v1/health.pb.go

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

156 changes: 156 additions & 0 deletions api/v1/common.pb.go

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

13 changes: 13 additions & 0 deletions api/v1/common.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
syntax = "proto3";

package v1;

option go_package = "./v1";

message Paging {
// page is used for pagination, if unset only the first page is returned,
// the list response contains then the page number for the next page.
optional uint64 page = 1;
// count is the number of results returned per page, if not given server side defaults apply
optional uint64 count = 2;
}
2 changes: 1 addition & 1 deletion api/v1/iam.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 api/v1/meta.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 api/v1/meta.proto
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ message Meta {
google.protobuf.Timestamp updated_time = 6;
map<string, string> annotations = 7;
repeated string labels = 8;
}
}
17 changes: 16 additions & 1 deletion api/v1/mocks/ProjectServiceClient.go

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

Loading

0 comments on commit d49f6bb

Please sign in to comment.