Skip to content

Commit

Permalink
feat: list resources pagination (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
FemiNoviaLina authored May 8, 2024
1 parent 35322f1 commit e252bc6
Show file tree
Hide file tree
Showing 21 changed files with 548 additions and 311 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
NAME=github.com/goto/entropy
VERSION=$(shell git describe --tags --always --first-parent 2>/dev/null)
COMMIT=$(shell git rev-parse --short HEAD)
PROTON_COMMIT="bdbc77d4acec0d9b09ff28feaf4a88df02b7864a"
PROTON_COMMIT="564a3d2fa0aa14e435dc4f264fbf63ff2dcf09c2"
BUILD_TIME=$(shell date)
COVERAGE_DIR=coverage
BUILD_DIR=dist
Expand Down
9 changes: 7 additions & 2 deletions cli/client/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (

func cmdViewResource() *cobra.Command {
var kind, project string
var pageNum, pageSize int32
cmd := &cobra.Command{
Use: "get [resource-urn]",
Args: cobra.MaximumNArgs(1),
Expand Down Expand Up @@ -54,8 +55,10 @@ func cmdViewResource() *cobra.Command {

// list resource
req := entropyv1beta1.ListResourcesRequest{
Kind: kind,
Project: project,
Kind: kind,
Project: project,
PageNum: pageNum,
PageSize: pageSize,
}

spinner := printer.Spin("Listing resources...")
Expand All @@ -82,6 +85,8 @@ func cmdViewResource() *cobra.Command {

cmd.Flags().StringVarP(&kind, "kind", "k", "", "kind of resources")
cmd.Flags().StringVarP(&project, "project", "p", "", "project of resources")
cmd.Flags().Int32Var(&pageNum, "page-num", 1, "resources page number")
cmd.Flags().Int32Var(&pageSize, "page-size", 50, "resources page size")

return cmd
}
Expand Down
23 changes: 17 additions & 6 deletions core/mocks/driver.go

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

27 changes: 21 additions & 6 deletions core/mocks/loggable_module.go

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

15 changes: 9 additions & 6 deletions core/mocks/module_registry.go

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

27 changes: 21 additions & 6 deletions core/mocks/module_service.go

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

31 changes: 25 additions & 6 deletions core/mocks/module_store.go

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

Loading

0 comments on commit e252bc6

Please sign in to comment.