From 75912c49642cbc932f806396f97ee1dd003a125e Mon Sep 17 00:00:00 2001 From: Ewan Harris Date: Mon, 2 Sep 2024 17:09:41 +0100 Subject: [PATCH] docs: add consistency param to command examples --- cmd/query/check.go | 2 +- cmd/query/expand.go | 4 ++-- cmd/query/list-objects.go | 4 ++-- cmd/query/list-relations.go | 4 ++-- cmd/query/list-users.go | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cmd/query/check.go b/cmd/query/check.go index 78f3a9e..7a873e2 100644 --- a/cmd/query/check.go +++ b/cmd/query/check.go @@ -63,7 +63,7 @@ func check( var checkCmd = &cobra.Command{ Use: "check", Short: "Check", - Example: `fga query check --store-id="01H4P8Z95KTXXEP6Z03T75Q984" user:anne can_view document:roadmap --context '{"ip_address":"127.0.0.1"}'`, //nolint:lll + Example: `fga query check --store-id="01H4P8Z95KTXXEP6Z03T75Q984" user:anne can_view document:roadmap --context '{"ip_address":"127.0.0.1"}' --consistency "HIGHER_CONSISTENCY"`, //nolint:lll Long: "Check if a user has a particular relation with an object.", Args: cobra.ExactArgs(3), //nolint:mnd RunE: func(cmd *cobra.Command, args []string) error { diff --git a/cmd/query/expand.go b/cmd/query/expand.go index feed6ad..55ff1db 100644 --- a/cmd/query/expand.go +++ b/cmd/query/expand.go @@ -58,8 +58,8 @@ var expandCmd = &cobra.Command{ Use: "expand", Short: "Expand", Long: "Expands the relationships in userset tree format.", - Example: `fga query expand --store-id="01H4P8Z95KTXXEP6Z03T75Q984" can_view document:roadmap`, - Args: cobra.ExactArgs(2), //nolint:mnd + Example: `fga query expand --store-id="01H4P8Z95KTXXEP6Z03T75Q984" can_view document:roadmap --consistency "HIGHER_CONSISTENCY"`, //nolint:lll + Args: cobra.ExactArgs(2), //nolint:mnd,lll RunE: func(cmd *cobra.Command, args []string) error { clientConfig := cmdutils.GetClientConfig(cmd) diff --git a/cmd/query/list-objects.go b/cmd/query/list-objects.go index c5194e0..837e184 100644 --- a/cmd/query/list-objects.go +++ b/cmd/query/list-objects.go @@ -64,8 +64,8 @@ var listObjectsCmd = &cobra.Command{ Use: "list-objects", Short: "List Objects", Long: "List the objects of a certain type that a user has a particular relation to.", - Example: `fga query list-objects --store-id=01H0H015178Y2V4CX10C2KGHF4 user:anne can_view document --contextual-tuple "user:anne can_view folder:product" --contextual-tuple "folder:product parent document:roadmap"`, //nolint:lll - Args: cobra.ExactArgs(3), //nolint:mnd,lll + Example: `fga query list-objects --store-id=01H0H015178Y2V4CX10C2KGHF4 user:anne can_view document --contextual-tuple "user:anne can_view folder:product" --contextual-tuple "folder:product parent document:roadmap" --consistency "HIGHER_CONSISTENCY"`, //nolint:lll + Args: cobra.ExactArgs(3), //nolint:mnd,lll RunE: func(cmd *cobra.Command, args []string) error { clientConfig := cmdutils.GetClientConfig(cmd) diff --git a/cmd/query/list-relations.go b/cmd/query/list-relations.go index a351cd3..0afebae 100644 --- a/cmd/query/list-relations.go +++ b/cmd/query/list-relations.go @@ -127,8 +127,8 @@ var listRelationsCmd = &cobra.Command{ Use: "list-relations", Short: "List Relations", Long: "List relations that a user has with an object.", - Example: `fga query list-relations --store-id=01H0H015178Y2V4CX10C2KGHF4 user:anne document:roadmap --relation can_view`, //nolint:lll - Args: cobra.ExactArgs(2), //nolint:mnd,lll + Example: `fga query list-relations --store-id=01H0H015178Y2V4CX10C2KGHF4 user:anne document:roadmap --relation can_view --consistency "HIGHER_CONSISTENCY"`, //nolint:lll + Args: cobra.ExactArgs(2), //nolint:mnd,lll RunE: func(cmd *cobra.Command, args []string) error { clientConfig := cmdutils.GetClientConfig(cmd) fgaClient, err := clientConfig.GetFgaClient() diff --git a/cmd/query/list-users.go b/cmd/query/list-users.go index 84d35ac..308a8ea 100644 --- a/cmd/query/list-users.go +++ b/cmd/query/list-users.go @@ -94,7 +94,7 @@ var listUsersCmd = &cobra.Command{ Use: "list-users", Short: "List users", Long: "List all users that have a certain relation with a particular object", - Example: `fga query list-users --store-id=01H0H015178Y2V4CX10C2KGHF4 --object document:roadmap --relation can_view`, + Example: `fga query list-users --store-id=01H0H015178Y2V4CX10C2KGHF4 --object document:roadmap --relation can_view --consistency "HIGHER_CONSISTENCY"`, //nolint:lll RunE: func(cmd *cobra.Command, _ []string) error { clientConfig := cmdutils.GetClientConfig(cmd) fgaClient, err := clientConfig.GetFgaClient()