Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reflection: "show message" gives 0 lines #88

Closed
neopaf opened this issue Aug 28, 2018 · 6 comments
Closed

reflection: "show message" gives 0 lines #88

neopaf opened this issue Aug 28, 2018 · 6 comments

Comments

@neopaf
Copy link

neopaf commented Aug 28, 2018

$ go get github.com/chemidy/goheroe-code-examples/gRPC-Service-Discovery-With-Server-Reflection-in-go/cmd/server
$ /.../server 
starting server on port : :6666

connecting with reflection:

rualpe-ws:grpc-master paf$ evans --host localhost --port 6666 -r

  ______
 |  ____|
 | |__    __   __   __ _   _ __    ___
 |  __|   \ \ / /  / _. | | '_ \  / __|
 | |____   \ V /  | (_| | | | | | \__ \
 |______|   \_/    \__,_| |_| |_| |___/

 more expressive universal gRPC client


default@localhost:6666> service GoHeroe

default.GoHeroe@localhost:6666> show rpc
+------+-------------+--------------+
| RPC  | REQUESTTYPE | RESPONSETYPE |
+------+-------------+--------------+
| List | Filter      | SuperPowers  |
| Add  | SuperPower  | SuperPowers  |
+------+-------------+--------------+

default.GoHeroe@localhost:6666> show message
+---------+
| MESSAGE |
+---------+
+---------+

default.GoHeroe@localhost:6666> 

I expected to see possible messages:

  • Filter
  • SuperPower
  • SuperPowers

proto here:
https://github.com/chemidy/goheroe-code-examples/blob/master/gRPC-Service-Discovery-With-Server-Reflection-in-go/proto/goheroe.proto

@neopaf
Copy link
Author

neopaf commented Aug 28, 2018

actual call works, though (which is COOL!):

default.GoHeroe@localhost:6666> call List
? Filter All
{
  "superPow": [
    {
      "name": "Flash power",
      "cat": "SciencePowers"
    },
    {
      "name": "Superman power",
      "cat": "CosmicBasedPowers"
    },
    {
      "name": "Spiderman power",
      "cat": "SupernaturalPowers"
    }
  ]
}

@neopaf
Copy link
Author

neopaf commented Aug 28, 2018

Yet to know how invoke this from command line one does not know which json to send.
Message type is "Filter" but what fields are there are not clear.

This works:

rualpe-ws:grpc-master paf$ echo '{"category": "SupernaturalPowers"}' | evans --host localhost --port 6666 -r --service GoHeroe --call List --cli
{
  "superPow": [
    {
      "name": "Spiderman power",
      "cat": "SupernaturalPowers"
    }
  ]
}
rualpe-ws:grpc-master paf$ 

But to known this "category" I had to dive into .proto file.
Dream: to have it all in dear Evans.

@neopaf
Copy link
Author

neopaf commented Aug 28, 2018

If this helps, using .proto file it works:

rualpe-ws:Downloads paf$ evans --host localhost --port 6666  goheroe.proto 

  ______
 |  ____|
 | |__    __   __   __ _   _ __    ___
 |  __|   \ \ / /  / _. | | '_ \  / __|
 | |____   \ V /  | (_| | | | | | \__ \
 |______|   \_/    \__,_| |_| |_| |___/

 more expressive universal gRPC client

localhost:6666> package superpower

superpower@localhost:6666> show message
+-------------+
|   MESSAGE   |
+-------------+
| SuperPower  |
| SuperPowers |
| Filter      |
+-------------+

superpower@localhost:6666> desc Filter
+----------+-----------+
|  FIELD   |   TYPE    |
+----------+-----------+
| category | TYPE_ENUM |
+----------+-----------+

superpower@localhost:6666> 

Noticed different package name...

Noticed that even this way one does not know possible enum values (this is not vital, I'm not planning to use ENUMs much).

@neopaf neopaf changed the title show message gives 0 lines reflection: "show message" gives 0 lines Aug 28, 2018
@neopaf
Copy link
Author

neopaf commented Aug 28, 2018

(enums can be played with in REPL mode, all possible values are auto-suggested)

@ktr0731
Copy link
Owner

ktr0731 commented Aug 29, 2018

Thank you for pointed out an issue!
I fixed it at #89. Can you update Evans to 0.6.1?

@neopaf
Copy link
Author

neopaf commented Aug 30, 2018

bliss! thanks, Ktr ;)

==> Upgrading 1 outdated package, with result:
ktr0731/evans/evans 0.6.0 -> 0.6.1
==> Upgrading ktr0731/evans/evans 
==> Downloading https://github.com/ktr0731/evans/releases/download/0.6.1/evans_darwin_amd64.tar.gz
==> Downloading from https://github-production-release-asset-2e65be.s3.amazonaws.com/97361468/f5761c00-ab28-11e8-8c84-0c359c18cb32?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F201808
######################################################################## 100.0%
🍺  /usr/local/Cellar/evans/0.6.1: 3 files, 20.2MB, built in 13 seconds
rualpe-ws:Downloads paf$ evans --host localhost --port 6666 -r

  ______
 |  ____|
 | |__    __   __   __ _   _ __    ___
 |  __|   \ \ / /  / _. | | '_ \  / __|
 | |____   \ V /  | (_| | | | | | \__ \
 |______|   \_/    \__,_| |_| |_| |___/

 more expressive universal gRPC client

default@localhost:6666> show message
+-------------+
|   MESSAGE   |
+-------------+
| Filter      |
| SuperPowers |
| SuperPower  |
+-------------+

default@localhost:6666> desc Filter
+----------+-----------+
|  FIELD   |   TYPE    |
+----------+-----------+
| category | TYPE_ENUM |
+----------+-----------+

@neopaf neopaf closed this as completed Aug 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants