Giter Site home page Giter Site logo

ktr0731 / evans Goto Github PK

View Code? Open in Web Editor NEW
4.1K 28.0 185.0 48.6 MB

Evans: more expressive universal gRPC client

License: MIT License

Go 99.14% Makefile 0.23% Shell 0.20% Dockerfile 0.42%
grpc grpc-client completion cli repl-mode protocol-buffers golang rpc

evans's People

Contributors

110y avatar acomagu avatar avamingli avatar benslabbert avatar creasty avatar dbarrosop avatar dependabot-preview[bot] avatar dependabot[bot] avatar dqneo avatar ecbaldwin avatar flokli avatar isopropylcyanide avatar kakke18 avatar karlmutch avatar ktr0731 avatar ledzep2 avatar mbobakov avatar micnncim avatar naoty avatar panzerdev avatar pasdam avatar quantfns avatar relipocere avatar ricardoseriani avatar simplesteph avatar smirl avatar stembrain avatar tarampampam avatar xwjdsh avatar zchee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

evans's Issues

.evans.toml cannot specify port

When I put a .evans.toml file in the current directory like below,

[server]
host = "192.168.0.5"
port = "8888"

and run evans foo.proto, then the port setting is ignored.

$ evans foo.proto
[email protected]:50051>

I believe the flag default value overrides the config file.

Possible regression: `unknown request type`

I recently upgraded Evans from 0.2.8 to 0.3.1, and I started experiencing this error upon launching Evans:

$ evans outer/inner/MyService.proto
outer/inner/MyService.proto:31:15: method outer.inner.MyService.SomeMethod: unknown request type SomeMethodRequest

SomeMethodNameRequest is defined in outer/inner/MyService.proto as:

package outer.inner;
import "outer/messages.proto";

service MyService {
  rpc SomeMethod (SomeMethodRequest) returns (SomeMethodResponse);
}

SomeMethodRequest is defined in outer/messages.proto as:

package outer;

message SomeMethodRequest {}
message SomeMethodResponse {}

I suspect Evans is having trouble importing a message from an outer package.

How to install for Windows?

Hi

I'm planning to reference your CLI tool in my online courses for gRPC. Some of the learners are windows users and they'll need a release for windows they can download or instructions for their platform. Is your tool working for Windows? Can we please include these instructions?

Thanks a lot for the great work, been a fan for a long time! The new reflection capability is awesome

Cheers
Stephane

Using desc on top level messages

Question re functionality of desc usage

It seems that not all messages are listed if using nested message blocks, when using the desc command

Proto snippet....

    message Blog {
        string id = 1;
        string author_id = 2;
        string title = 3;
        string content = 4;
    }
    message CreateBlogRequest {
        Blog blog = 1;
    }
    [email protected]:50051> show message
    +--------------------+
    |      MESSAGE       |
    +--------------------+
    | CreateBlogRequest  |
    +--------------------+

^^^ no Blog message listed above ^^^, only top level message CreateBlogRequest shown

Using desc command on CreateBlogRequest, shows it is using a field of blog of type message

    [email protected]:50051> desc CreateBlogRequest
    +-------+--------------+
    | FIELD |     TYPE     |
    +-------+--------------+
    | blog  | TYPE_MESSAGE |
    +-------+--------------+

How then do you get a description of Blog ? I would of assumed you could do something like this....

    [email protected]:50051> desc Blog
    +---------+-------------+
    |  FIELD  |    TYPE     |
    +---------+-------------+
    | id | TYPE_STRING |
    +---------+-------------+
    | author_id | TYPE_STRING |
    +---------+-------------+
    | title | TYPE_STRING |
    +---------+-------------+
    | content | TYPE_STRING |
    +---------+-------------+

Digging into the code -> https://github.com/ktr0731/evans/blob/master/adapter/protobuf/message_builder.go

I interpret the comment at line 15 of the above link as being able to handle these nested message blocks and being able to decode nested message blocks into there fields as my example of 'desc blog' above

On a separate note, There also seems to be some bug with auto suggestion see below image

screenshot from 2018-11-06 09-37-32

Thanks in advance

gRPC packages with '.' characters in their name break the fqrnToEndpoint logic

The fqrn logic uses a final form string and splits it apart to insert the '/' before method names. However it assumes a fixed length slice. When a package with '.' characters is selected in the UI then a call is invoked the 'invalid FQRN format' error is raised and the call fails.

The logic should, contain a minimum length check, and the return should read something like:

return fmt.Sprintf("/%s/%s", strings.Join(sp[:len(sp)-1], "."), sp[len(sp)-1])

Not able to download file from URL :https://github.com/ktr0731/evans/releases/download/0.6.10/evans_darwin_amd64.tar.gz

Hi I am trying to install Evans on Mac for the latest release but it is giving the following error.

$ brew install evans
==> Installing evans from ktr0731/evans
==> Downloading https://github.com/ktr0731/evans/releases/download/0.6.10/evans_darwin_amd64.t

curl: (22) The requested URL returned error: 404 Not Found
Error: An exception occurred within a child process:
DownloadError: Failed to download resource "evans"
Download failed: https://github.com/ktr0731/evans/releases/download/0.6.10/evans_darwin_amd64.tar.gz

key mappings for inputting

Problem

Evans uses c-bata/go-prompt as the input method in REPL mode.
c-bata/go-prompt doesn't return C-d (io.EOF), only returns empty string.
so, Evans cannot determine whether empty input is C-d or just entered.
therefore, currently, Evans doesn't use C-d to notify end of input.

Currently key mappings

mapping result
enter inputs default value (in repeated fields, this mapping is disabled.)
enter + enter terminates inputting repeated fields

New key mappings for new features

I planning streaming modes.
for these features, I will introduce new key mappings to terminate stream.

mapping result
C-c terminates each streaming mode

also to fix behavior of enter mapping in repeated fields, I considering abolish enter + enter mapping.
instead of the mapping, C-c mapping terminates repeated fields inputting.

if you have any idea, please tell me.

thanks.

Note

the final mapping table is:

mapping result
enter inputs default value
C-c terminates each mode (if current field is not repeated fields)
C-c terminates inputting repeated fields

if you want to terminate streaming mode in repeated fields inputting, you need to input C-c two times.

Imports fail

I'd like to try evans out but I can't load any proto files that have imports. Is there some trick to tell it where to look for imported proto files?

evans x.proto
github.com/golang/protobuf/ptypes/timestamp/timestamp.proto: File not found.
x.proto: Import "github.com/golang/protobuf/ptypes/timestamp/timestamp.proto" was not found or had errors.
x.proto:11:3: "google.protobuf.Timestamp" is not defined.

And here's the proto file

syntax = "proto3";

package simpleproto;

import "github.com/golang/protobuf/ptypes/timestamp/timestamp.proto";

service PersonService {
    rpc SimpleRequest(Req) returns (Resp) {} 
}
message Req {
  google.protobuf.Timestamp Time = 1;
}

message Resp {
}

reflection: "show message" gives 0 lines

$ 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

Pressing enter without entering a value should assume the type default

I have a Boolean field for example, or int, and if I press enter without entering a value I get an error. In gRPC it's fine not to enter values for fields as they'll be assumed by protocol buffers to be default, so it'd be good for our personal efficiency to have the same behaviour with Evans

Not able to input streaming messages in cli mode

I'm trying to send a stream of messages in cli mode, but I can't find any information about how this is done. I tried the two most obvious ways (in my mind at least):

  • Sending objects as an array [{}], but evans complain about an unexpected character [. (failed to read input from JSON: Bad input. Expecting start of JSON object: '{'. Instead got: [.)
  • Sending objects as a JSON stream (one JSON object per line), e.g. the regular output from jq, but evans complains about unexpected EOF. (failed to read input from JSON: EOF)

Is this even possible, and if it is, could you point me in the right direction to get this to work? And possibly add some documentation somewhere about it?

Circular messages

I have found two issues around circular messages.

Take the following rpc definition:

package visor.admin.service;
syntax = "proto3";
package example;
service Example {
  rpc BigInput(Node) returns (Empty);
}
message Empty {}
// A node is a part of a linked list.
message Node {
  // The value of this node.
  string value = 1;
  // Reference to the next node, present unless this is the last node.
  Node next = 2;
}

When I attempt to call BigInput, I am stuck in an infinite loop:

$ evans --package example --service Example foo.proto

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

 more expressive universal gRPC client


[email protected]:50051> call BigInput
value (TYPE_STRING) => a
next::value (TYPE_STRING) => b
next::next::value (TYPE_STRING) => c
next::next::next::value (TYPE_STRING) => d
next::next::next::next::value (TYPE_STRING) => e
next::next::next::next::next::value (TYPE_STRING) => f
next::next::next::next::next::next::value (TYPE_STRING) => g
next::next::next::next::next::next::next::value (TYPE_STRING) =>
next::next::next::next::next::next::next::next::value (TYPE_STRING) =>
next::next::next::next::next::next::next::next::next::value (TYPE_STRING) =>
next::next::next::next::next::next::next::next::next::next::value (TYPE_STRING) =>
next::next::next::next::next::next::next::next::next::next::next::value (TYPE_STRING) =>

Similarly, take the following rpc definition:

syntax = "proto3";
package example;
service Example {}
message A { B b = 1; }
message B { A a = 1; }

Then, I simple start up evans and this leads to a panic:

Click to show full stacktrace.
$ evans --package example --service Example foo.proto                                                                                                                                                            146 ↵

runtime: goroutine stack exceeds 1000000000-byte limit
fatal error: stack overflow

runtime stack:
runtime.throw(0x177911d, 0xe)
        /usr/local/go/src/runtime/panic.go:616 +0x81
runtime.newstack()
        /usr/local/go/src/runtime/stack.go:1054 +0x71f
runtime.morestack()
        /usr/local/go/src/runtime/asm_amd64.s:480 +0x89

goroutine 1 [running]:
github.com/ktr0731/evans/adapter/protobuf.newMessage(0xc4202f80e0, 0x0, 0x0)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message.go:17 +0xb27 fp=0xc440300520 sp=0xc440300518 pc=0x14a9047
github.com/ktr0731/evans/adapter/protobuf.newMessageField(0xc4202c8f50, 0x10, 0x16b7780)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message_field.go:14 +0x33 fp=0xc440300558 sp=0xc440300520 pc=0x14a90e3
github.com/ktr0731/evans/adapter/protobuf.newField(0xc4202c8f50, 0xc4202c2508, 0x1)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/field.go:13 +0xf3 fp=0xc440300590 sp=0xc440300558 pc=0x14a84e3
github.com/ktr0731/evans/adapter/protobuf.newMessage(0xc4202f8000, 0x0, 0x0)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message.go:56 +0x80a fp=0xc4403007c8 sp=0xc440300590 pc=0x14a8d2a
github.com/ktr0731/evans/adapter/protobuf.newMessageField(0xc4202c8fc0, 0x10, 0x16b7780)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message_field.go:14 +0x33 fp=0xc440300800 sp=0xc4403007c8 pc=0x14a90e3
github.com/ktr0731/evans/adapter/protobuf.newField(0xc4202c8fc0, 0xc4202c2628, 0x1)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/field.go:13 +0xf3 fp=0xc440300838 sp=0xc440300800 pc=0x14a84e3
github.com/ktr0731/evans/adapter/protobuf.newMessage(0xc4202f80e0, 0x0, 0x0)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message.go:56 +0x80a fp=0xc440300a70 sp=0xc440300838 pc=0x14a8d2a
github.com/ktr0731/evans/adapter/protobuf.newMessageField(0xc4202c8f50, 0x10, 0x16b7780)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message_field.go:14 +0x33 fp=0xc440300aa8 sp=0xc440300a70 pc=0x14a90e3
github.com/ktr0731/evans/adapter/protobuf.newField(0xc4202c8f50, 0xc4202c2508, 0x1)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/field.go:13 +0xf3 fp=0xc440300ae0 sp=0xc440300aa8 pc=0x14a84e3
github.com/ktr0731/evans/adapter/protobuf.newMessage(0xc4202f8000, 0x0, 0x0)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message.go:56 +0x80a fp=0xc440300d18 sp=0xc440300ae0 pc=0x14a8d2a
github.com/ktr0731/evans/adapter/protobuf.newMessageField(0xc4202c8fc0, 0x10, 0x16b7780)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message_field.go:14 +0x33 fp=0xc440300d50 sp=0xc440300d18 pc=0x14a90e3
github.com/ktr0731/evans/adapter/protobuf.newField(0xc4202c8fc0, 0xc4202c2628, 0x1)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/field.go:13 +0xf3 fp=0xc440300d88 sp=0xc440300d50 pc=0x14a84e3
github.com/ktr0731/evans/adapter/protobuf.newMessage(0xc4202f80e0, 0x0, 0x0)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message.go:56 +0x80a fp=0xc440300fc0 sp=0xc440300d88 pc=0x14a8d2a
github.com/ktr0731/evans/adapter/protobuf.newMessageField(0xc4202c8f50, 0x10, 0x16b7780)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message_field.go:14 +0x33 fp=0xc440300ff8 sp=0xc440300fc0 pc=0x14a90e3
github.com/ktr0731/evans/adapter/protobuf.newField(0xc4202c8f50, 0xc4202c2508, 0x1)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/field.go:13 +0xf3 fp=0xc440301030 sp=0xc440300ff8 pc=0x14a84e3
github.com/ktr0731/evans/adapter/protobuf.newMessage(0xc4202f8000, 0x0, 0x0)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message.go:56 +0x80a fp=0xc440301268 sp=0xc440301030 pc=0x14a8d2a
github.com/ktr0731/evans/adapter/protobuf.newMessageField(0xc4202c8fc0, 0x10, 0x16b7780)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message_field.go:14 +0x33 fp=0xc4403012a0 sp=0xc440301268 pc=0x14a90e3
github.com/ktr0731/evans/adapter/protobuf.newField(0xc4202c8fc0, 0xc4202c2628, 0x1)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/field.go:13 +0xf3 fp=0xc4403012d8 sp=0xc4403012a0 pc=0x14a84e3
github.com/ktr0731/evans/adapter/protobuf.newMessage(0xc4202f80e0, 0x0, 0x0)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message.go:56 +0x80a fp=0xc440301510 sp=0xc4403012d8 pc=0x14a8d2a
github.com/ktr0731/evans/adapter/protobuf.newMessageField(0xc4202c8f50, 0x10, 0x16b7780)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message_field.go:14 +0x33 fp=0xc440301548 sp=0xc440301510 pc=0x14a90e3
github.com/ktr0731/evans/adapter/protobuf.newField(0xc4202c8f50, 0xc4202c2508, 0x1)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/field.go:13 +0xf3 fp=0xc440301580 sp=0xc440301548 pc=0x14a84e3
github.com/ktr0731/evans/adapter/protobuf.newMessage(0xc4202f8000, 0x0, 0x0)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message.go:56 +0x80a fp=0xc4403017b8 sp=0xc440301580 pc=0x14a8d2a
github.com/ktr0731/evans/adapter/protobuf.newMessageField(0xc4202c8fc0, 0x10, 0x16b7780)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message_field.go:14 +0x33 fp=0xc4403017f0 sp=0xc4403017b8 pc=0x14a90e3
github.com/ktr0731/evans/adapter/protobuf.newField(0xc4202c8fc0, 0xc4202c2628, 0x1)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/field.go:13 +0xf3 fp=0xc440301828 sp=0xc4403017f0 pc=0x14a84e3
github.com/ktr0731/evans/adapter/protobuf.newMessage(0xc4202f80e0, 0x0, 0x0)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message.go:56 +0x80a fp=0xc440301a60 sp=0xc440301828 pc=0x14a8d2a
github.com/ktr0731/evans/adapter/protobuf.newMessageField(0xc4202c8f50, 0x10, 0x16b7780)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message_field.go:14 +0x33 fp=0xc440301a98 sp=0xc440301a60 pc=0x14a90e3
github.com/ktr0731/evans/adapter/protobuf.newField(0xc4202c8f50, 0xc4202c2508, 0x1)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/field.go:13 +0xf3 fp=0xc440301ad0 sp=0xc440301a98 pc=0x14a84e3
github.com/ktr0731/evans/adapter/protobuf.newMessage(0xc4202f8000, 0x0, 0x0)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message.go:56 +0x80a fp=0xc440301d08 sp=0xc440301ad0 pc=0x14a8d2a
github.com/ktr0731/evans/adapter/protobuf.newMessageField(0xc4202c8fc0, 0x10, 0x16b7780)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message_field.go:14 +0x33 fp=0xc440301d40 sp=0xc440301d08 pc=0x14a90e3
github.com/ktr0731/evans/adapter/protobuf.newField(0xc4202c8fc0, 0xc4202c2628, 0x1)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/field.go:13 +0xf3 fp=0xc440301d78 sp=0xc440301d40 pc=0x14a84e3
github.com/ktr0731/evans/adapter/protobuf.newMessage(0xc4202f80e0, 0x0, 0x0)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message.go:56 +0x80a fp=0xc440301fb0 sp=0xc440301d78 pc=0x14a8d2a
github.com/ktr0731/evans/adapter/protobuf.newMessageField(0xc4202c8f50, 0x10, 0x16b7780)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message_field.go:14 +0x33 fp=0xc440301fe8 sp=0xc440301fb0 pc=0x14a90e3
github.com/ktr0731/evans/adapter/protobuf.newField(0xc4202c8f50, 0xc4202c2508, 0x1)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/field.go:13 +0xf3 fp=0xc440302020 sp=0xc440301fe8 pc=0x14a84e3
github.com/ktr0731/evans/adapter/protobuf.newMessage(0xc4202f8000, 0x0, 0x0)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message.go:56 +0x80a fp=0xc440302258 sp=0xc440302020 pc=0x14a8d2a
github.com/ktr0731/evans/adapter/protobuf.newMessageField(0xc4202c8fc0, 0x10, 0x16b7780)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message_field.go:14 +0x33 fp=0xc440302290 sp=0xc440302258 pc=0x14a90e3
github.com/ktr0731/evans/adapter/protobuf.newField(0xc4202c8fc0, 0xc4202c2628, 0x1)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/field.go:13 +0xf3 fp=0xc4403022c8 sp=0xc440302290 pc=0x14a84e3
github.com/ktr0731/evans/adapter/protobuf.newMessage(0xc4202f80e0, 0x0, 0x0)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message.go:56 +0x80a fp=0xc440302500 sp=0xc4403022c8 pc=0x14a8d2a
github.com/ktr0731/evans/adapter/protobuf.newMessageField(0xc4202c8f50, 0x10, 0x16b7780)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message_field.go:14 +0x33 fp=0xc440302538 sp=0xc440302500 pc=0x14a90e3
github.com/ktr0731/evans/adapter/protobuf.newField(0xc4202c8f50, 0xc4202c2508, 0x1)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/field.go:13 +0xf3 fp=0xc440302570 sp=0xc440302538 pc=0x14a84e3
github.com/ktr0731/evans/adapter/protobuf.newMessage(0xc4202f8000, 0x0, 0x0)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message.go:56 +0x80a fp=0xc4403027a8 sp=0xc440302570 pc=0x14a8d2a
github.com/ktr0731/evans/adapter/protobuf.newMessageField(0xc4202c8fc0, 0x10, 0x16b7780)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message_field.go:14 +0x33 fp=0xc4403027e0 sp=0xc4403027a8 pc=0x14a90e3
github.com/ktr0731/evans/adapter/protobuf.newField(0xc4202c8fc0, 0xc4202c2628, 0x1)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/field.go:13 +0xf3 fp=0xc440302818 sp=0xc4403027e0 pc=0x14a84e3
github.com/ktr0731/evans/adapter/protobuf.newMessage(0xc4202f80e0, 0x0, 0x0)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message.go:56 +0x80a fp=0xc440302a50 sp=0xc440302818 pc=0x14a8d2a
github.com/ktr0731/evans/adapter/protobuf.newMessageField(0xc4202c8f50, 0x10, 0x16b7780)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message_field.go:14 +0x33 fp=0xc440302a88 sp=0xc440302a50 pc=0x14a90e3
github.com/ktr0731/evans/adapter/protobuf.newField(0xc4202c8f50, 0xc4202c2508, 0x1)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/field.go:13 +0xf3 fp=0xc440302ac0 sp=0xc440302a88 pc=0x14a84e3
github.com/ktr0731/evans/adapter/protobuf.newMessage(0xc4202f8000, 0x0, 0x0)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message.go:56 +0x80a fp=0xc440302cf8 sp=0xc440302ac0 pc=0x14a8d2a
github.com/ktr0731/evans/adapter/protobuf.newMessageField(0xc4202c8fc0, 0x10, 0x16b7780)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message_field.go:14 +0x33 fp=0xc440302d30 sp=0xc440302cf8 pc=0x14a90e3
github.com/ktr0731/evans/adapter/protobuf.newField(0xc4202c8fc0, 0xc4202c2628, 0x1)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/field.go:13 +0xf3 fp=0xc440302d68 sp=0xc440302d30 pc=0x14a84e3
github.com/ktr0731/evans/adapter/protobuf.newMessage(0xc4202f80e0, 0x0, 0x0)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message.go:56 +0x80a fp=0xc440302fa0 sp=0xc440302d68 pc=0x14a8d2a
github.com/ktr0731/evans/adapter/protobuf.newMessageField(0xc4202c8f50, 0x10, 0x16b7780)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message_field.go:14 +0x33 fp=0xc440302fd8 sp=0xc440302fa0 pc=0x14a90e3
github.com/ktr0731/evans/adapter/protobuf.newField(0xc4202c8f50, 0xc4202c2508, 0x1)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/field.go:13 +0xf3 fp=0xc440303010 sp=0xc440302fd8 pc=0x14a84e3
github.com/ktr0731/evans/adapter/protobuf.newMessage(0xc4202f8000, 0x0, 0x0)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message.go:56 +0x80a fp=0xc440303248 sp=0xc440303010 pc=0x14a8d2a
github.com/ktr0731/evans/adapter/protobuf.newMessageField(0xc4202c8fc0, 0x10, 0x16b7780)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message_field.go:14 +0x33 fp=0xc440303280 sp=0xc440303248 pc=0x14a90e3
github.com/ktr0731/evans/adapter/protobuf.newField(0xc4202c8fc0, 0xc4202c2628, 0x1)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/field.go:13 +0xf3 fp=0xc4403032b8 sp=0xc440303280 pc=0x14a84e3
github.com/ktr0731/evans/adapter/protobuf.newMessage(0xc4202f80e0, 0x0, 0x0)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message.go:56 +0x80a fp=0xc4403034f0 sp=0xc4403032b8 pc=0x14a8d2a
github.com/ktr0731/evans/adapter/protobuf.newMessageField(0xc4202c8f50, 0x10, 0x16b7780)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message_field.go:14 +0x33 fp=0xc440303528 sp=0xc4403034f0 pc=0x14a90e3
github.com/ktr0731/evans/adapter/protobuf.newField(0xc4202c8f50, 0xc4202c2508, 0x1)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/field.go:13 +0xf3 fp=0xc440303560 sp=0xc440303528 pc=0x14a84e3
github.com/ktr0731/evans/adapter/protobuf.newMessage(0xc4202f8000, 0x0, 0x0)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message.go:56 +0x80a fp=0xc440303798 sp=0xc440303560 pc=0x14a8d2a
github.com/ktr0731/evans/adapter/protobuf.newMessageField(0xc4202c8fc0, 0x10, 0x16b7780)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message_field.go:14 +0x33 fp=0xc4403037d0 sp=0xc440303798 pc=0x14a90e3
github.com/ktr0731/evans/adapter/protobuf.newField(0xc4202c8fc0, 0xc4202c2628, 0x1)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/field.go:13 +0xf3 fp=0xc440303808 sp=0xc4403037d0 pc=0x14a84e3
github.com/ktr0731/evans/adapter/protobuf.newMessage(0xc4202f80e0, 0x0, 0x0)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message.go:56 +0x80a fp=0xc440303a40 sp=0xc440303808 pc=0x14a8d2a
github.com/ktr0731/evans/adapter/protobuf.newMessageField(0xc4202c8f50, 0x10, 0x16b7780)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message_field.go:14 +0x33 fp=0xc440303a78 sp=0xc440303a40 pc=0x14a90e3
github.com/ktr0731/evans/adapter/protobuf.newField(0xc4202c8f50, 0xc4202c2508, 0x1)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/field.go:13 +0xf3 fp=0xc440303ab0 sp=0xc440303a78 pc=0x14a84e3
github.com/ktr0731/evans/adapter/protobuf.newMessage(0xc4202f8000, 0x0, 0x0)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message.go:56 +0x80a fp=0xc440303ce8 sp=0xc440303ab0 pc=0x14a8d2a
github.com/ktr0731/evans/adapter/protobuf.newMessageField(0xc4202c8fc0, 0x10, 0x16b7780)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message_field.go:14 +0x33 fp=0xc440303d20 sp=0xc440303ce8 pc=0x14a90e3
github.com/ktr0731/evans/adapter/protobuf.newField(0xc4202c8fc0, 0xc4202c2628, 0x1)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/field.go:13 +0xf3 fp=0xc440303d58 sp=0xc440303d20 pc=0x14a84e3
github.com/ktr0731/evans/adapter/protobuf.newMessage(0xc4202f80e0, 0x0, 0x0)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message.go:56 +0x80a fp=0xc440303f90 sp=0xc440303d58 pc=0x14a8d2a
github.com/ktr0731/evans/adapter/protobuf.newMessageField(0xc4202c8f50, 0x10, 0x16b7780)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message_field.go:14 +0x33 fp=0xc440303fc8 sp=0xc440303f90 pc=0x14a90e3
github.com/ktr0731/evans/adapter/protobuf.newField(0xc4202c8f50, 0xc4202c2508, 0x1)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/field.go:13 +0xf3 fp=0xc440304000 sp=0xc440303fc8 pc=0x14a84e3
github.com/ktr0731/evans/adapter/protobuf.newMessage(0xc4202f8000, 0x0, 0x0)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message.go:56 +0x80a fp=0xc440304238 sp=0xc440304000 pc=0x14a8d2a
github.com/ktr0731/evans/adapter/protobuf.newMessageField(0xc4202c8fc0, 0x10, 0x16b7780)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message_field.go:14 +0x33 fp=0xc440304270 sp=0xc440304238 pc=0x14a90e3
github.com/ktr0731/evans/adapter/protobuf.newField(0xc4202c8fc0, 0xc4202c2628, 0x1)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/field.go:13 +0xf3 fp=0xc4403042a8 sp=0xc440304270 pc=0x14a84e3
github.com/ktr0731/evans/adapter/protobuf.newMessage(0xc4202f80e0, 0x0, 0x0)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message.go:56 +0x80a fp=0xc4403044e0 sp=0xc4403042a8 pc=0x14a8d2a
github.com/ktr0731/evans/adapter/protobuf.newMessageField(0xc4202c8f50, 0x10, 0x16b7780)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message_field.go:14 +0x33 fp=0xc440304518 sp=0xc4403044e0 pc=0x14a90e3
github.com/ktr0731/evans/adapter/protobuf.newField(0xc4202c8f50, 0xc4202c2508, 0x1)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/field.go:13 +0xf3 fp=0xc440304550 sp=0xc440304518 pc=0x14a84e3
github.com/ktr0731/evans/adapter/protobuf.newMessage(0xc4202f8000, 0x0, 0x0)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message.go:56 +0x80a fp=0xc440304788 sp=0xc440304550 pc=0x14a8d2a
github.com/ktr0731/evans/adapter/protobuf.newMessageField(0xc4202c8fc0, 0x10, 0x16b7780)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message_field.go:14 +0x33 fp=0xc4403047c0 sp=0xc440304788 pc=0x14a90e3
github.com/ktr0731/evans/adapter/protobuf.newField(0xc4202c8fc0, 0xc4202c2628, 0x1)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/field.go:13 +0xf3 fp=0xc4403047f8 sp=0xc4403047c0 pc=0x14a84e3
github.com/ktr0731/evans/adapter/protobuf.newMessage(0xc4202f80e0, 0x0, 0x0)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message.go:56 +0x80a fp=0xc440304a30 sp=0xc4403047f8 pc=0x14a8d2a
github.com/ktr0731/evans/adapter/protobuf.newMessageField(0xc4202c8f50, 0x10, 0x16b7780)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message_field.go:14 +0x33 fp=0xc440304a68 sp=0xc440304a30 pc=0x14a90e3
github.com/ktr0731/evans/adapter/protobuf.newField(0xc4202c8f50, 0xc4202c2508, 0x1)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/field.go:13 +0xf3 fp=0xc440304aa0 sp=0xc440304a68 pc=0x14a84e3
github.com/ktr0731/evans/adapter/protobuf.newMessage(0xc4202f8000, 0x0, 0x0)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message.go:56 +0x80a fp=0xc440304cd8 sp=0xc440304aa0 pc=0x14a8d2a
github.com/ktr0731/evans/adapter/protobuf.newMessageField(0xc4202c8fc0, 0x10, 0x16b7780)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message_field.go:14 +0x33 fp=0xc440304d10 sp=0xc440304cd8 pc=0x14a90e3
github.com/ktr0731/evans/adapter/protobuf.newField(0xc4202c8fc0, 0xc4202c2628, 0x1)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/field.go:13 +0xf3 fp=0xc440304d48 sp=0xc440304d10 pc=0x14a84e3
github.com/ktr0731/evans/adapter/protobuf.newMessage(0xc4202f80e0, 0x0, 0x0)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message.go:56 +0x80a fp=0xc440304f80 sp=0xc440304d48 pc=0x14a8d2a
github.com/ktr0731/evans/adapter/protobuf.newMessageField(0xc4202c8f50, 0x10, 0x16b7780)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message_field.go:14 +0x33 fp=0xc440304fb8 sp=0xc440304f80 pc=0x14a90e3
github.com/ktr0731/evans/adapter/protobuf.newField(0xc4202c8f50, 0xc4202c2508, 0x1)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/field.go:13 +0xf3 fp=0xc440304ff0 sp=0xc440304fb8 pc=0x14a84e3
github.com/ktr0731/evans/adapter/protobuf.newMessage(0xc4202f8000, 0x0, 0x0)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message.go:56 +0x80a fp=0xc440305228 sp=0xc440304ff0 pc=0x14a8d2a
github.com/ktr0731/evans/adapter/protobuf.newMessageField(0xc4202c8fc0, 0x10, 0x16b7780)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message_field.go:14 +0x33 fp=0xc440305260 sp=0xc440305228 pc=0x14a90e3
github.com/ktr0731/evans/adapter/protobuf.newField(0xc4202c8fc0, 0xc4202c2628, 0x1)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/field.go:13 +0xf3 fp=0xc440305298 sp=0xc440305260 pc=0x14a84e3
github.com/ktr0731/evans/adapter/protobuf.newMessage(0xc4202f80e0, 0x0, 0x0)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message.go:56 +0x80a fp=0xc4403054d0 sp=0xc440305298 pc=0x14a8d2a
github.com/ktr0731/evans/adapter/protobuf.newMessageField(0xc4202c8f50, 0x10, 0x16b7780)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message_field.go:14 +0x33 fp=0xc440305508 sp=0xc4403054d0 pc=0x14a90e3
github.com/ktr0731/evans/adapter/protobuf.newField(0xc4202c8f50, 0xc4202c2508, 0x1)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/field.go:13 +0xf3 fp=0xc440305540 sp=0xc440305508 pc=0x14a84e3
github.com/ktr0731/evans/adapter/protobuf.newMessage(0xc4202f8000, 0x0, 0x0)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message.go:56 +0x80a fp=0xc440305778 sp=0xc440305540 pc=0x14a8d2a
github.com/ktr0731/evans/adapter/protobuf.newMessageField(0xc4202c8fc0, 0x10, 0x16b7780)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message_field.go:14 +0x33 fp=0xc4403057b0 sp=0xc440305778 pc=0x14a90e3
github.com/ktr0731/evans/adapter/protobuf.newField(0xc4202c8fc0, 0xc4202c2628, 0x1)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/field.go:13 +0xf3 fp=0xc4403057e8 sp=0xc4403057b0 pc=0x14a84e3
github.com/ktr0731/evans/adapter/protobuf.newMessage(0xc4202f80e0, 0x0, 0x0)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message.go:56 +0x80a fp=0xc440305a20 sp=0xc4403057e8 pc=0x14a8d2a
github.com/ktr0731/evans/adapter/protobuf.newMessageField(0xc4202c8f50, 0x10, 0x16b7780)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message_field.go:14 +0x33 fp=0xc440305a58 sp=0xc440305a20 pc=0x14a90e3
github.com/ktr0731/evans/adapter/protobuf.newField(0xc4202c8f50, 0xc4202c2508, 0x1)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/field.go:13 +0xf3 fp=0xc440305a90 sp=0xc440305a58 pc=0x14a84e3
github.com/ktr0731/evans/adapter/protobuf.newMessage(0xc4202f8000, 0x0, 0x0)
        /go/src/github.com/ktr0731/evans/adapter/protobuf/message.go:56 +0x80a fp=0xc440305cc8 sp=0xc440305a90 pc=0x14a8d2a
...additional frames elided...

goroutine 5 [syscall]:
os/signal.signal_recv(0x0)
        /usr/local/go/src/runtime/sigqueue.go:139 +0xa7
os/signal.loop()
        /usr/local/go/src/os/signal/signal_unix.go:22 +0x22
created by os/signal.init.0
        /usr/local/go/src/os/signal/signal_unix.go:28 +0x41

I guess these are separate bugs, but I suspect a single fix could address them holistically.

Thanks!

Try reconnecting if connection is lost

In iterative development cycle, it is common to shutdown and restart a gRPC server.
What I'd like is to be able to keep using the evans cli when this happens.

Right now, it crashes on the next RPC call with:

rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: Error while dialing dial tcp 127.0.0.1:50051: connect: connection refused"

It could be nice to try reconnecting in these cases

Failure on spaces for strings

Seems to fail when entering a string with spaces

image

My proto:

message Blog {
    string id = 1;
    string author_id = 2;
    string title = 3;
    string content = 4;
}

message CreateBlogRequest {
    Blog blog = 1; // the id shouldn't matter
}

message CreateBlogResponse {
    Blog blog = 1; // the id will correspond to the one in MongoDB
}

service BlogService {
    rpc CreateBlog(CreateBlogRequest) returns (CreateBlogResponse){};
}

Unignore vendor directory

I can't go get evans because the vendor directory is in .gitignore. It's supposed to be in the tree for go get to work.

tty doesn’t display keyboard input after exiting Evans

After quitting Evans, keyboard input fails to display on the screen. This is on Ubuntu 16.04.4 LTS (GNU/Linux 4.4.0-1057-aws x86_64).

To reproduce this problem:

$ curl -OL https://github.com/ktr0731/evans/releases/download/0.4.1/evans_linux_amd64.tar.gz
$ tar -xf evans_linux_amd64.tar.gz
$ ./evans --host localhost --port 50052 --package myservice --service MyService --path protos protos/myservice/MyService.proto

new update available:
  current version: 0.4.1
   latest version: 0.4.1
? update? No
? update? (y/N) n
  ______
 |  ____|
 | |__    __   __   __ _   _ __    ___
 |  __|   \ \ / /  / _. | | '_ \  / __|
 | |____   \ V /  | (_| | | | | | \__ \
 |______|   \_/    \__,_| |_| |_| |___/

 more expressive universal gRPC client


[email protected]:50051> exit
[email protected]:50051> Good Bye :)

$ <-- cursor is now here

Now, when I type into the terminal, I don’t see output.

Only when I run $ stty sane to reset all tty settings does it fix the problem.

Cannot load more than one proto file

I have a need to load more than one proto file because the definitions I'm loading are not contained in one file. I happen to be trying to load the proto files from gobgp. This is what I get.

# evans api/*.proto
1 error occurred:

* gobgp.proto:292:3: duplicate symbol gobgpapi.AddBmpRequest.port: already defined as field in "api/gobgp.proto"

These symbols are not defined twice. Any ideas?

# evans --version
evans 0.5.1

error with Envoy grpc

Put .evans.toml with following code under https://github.com/envoyproxy/java-control-plane/tree/master/api/src/main/proto

[default]
protoFile = ["envoy/api/v2/lds.proto"]
package = "envoy.api.v2"
service = "ListenerDiscoveryService"

with following stacktrace:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x14fded9]

goroutine 20 [running]:
github.com/ktr0731/evans/vendor/github.com/jhump/protoreflect/desc/protoparse.(*parseResult).addMessageDecls(0xc4203a06a0, 0xc4202a4690, 0xc420384ca0, 0xc420371740, 0x6, 0x8, 0xc4200f9c01)
	/go/src/github.com/ktr0731/evans/vendor/github.com/jhump/protoreflect/desc/protoparse/parser.go:844 +0xbd9
github.com/ktr0731/evans/vendor/github.com/jhump/protoreflect/desc/protoparse.(*parseResult).asMessageDescriptor(0xc4203a06a0, 0xc420384c60, 0x1, 0x0)
	/go/src/github.com/ktr0731/evans/vendor/github.com/jhump/protoreflect/desc/protoparse/parser.go:812 +0x17e
github.com/ktr0731/evans/vendor/github.com/jhump/protoreflect/desc/protoparse.(*parseResult).asFileDescriptor(0xc4203a06a0, 0xc420282940, 0x1f, 0xc42039c5a0, 0xc420324500, 0x17f1f00, 0xc420357380)
	/go/src/github.com/ktr0731/evans/vendor/github.com/jhump/protoreflect/desc/protoparse/parser.go:522 +0xa04
github.com/ktr0731/evans/vendor/github.com/jhump/protoreflect/desc/protoparse.createParseResult(0xc420282940, 0x1f, 0xc42039c5a0, 0xc4202f5000, 0x1000, 0x1000)
	/go/src/github.com/ktr0731/evans/vendor/github.com/jhump/protoreflect/desc/protoparse/parser.go:493 +0xa6
github.com/ktr0731/evans/vendor/github.com/jhump/protoreflect/desc/protoparse.parseProto(0xc420282940, 0x1f, 0x17f0020, 0xc4200be8f0, 0xc4200be8f0, 0xc4202437f0, 0x176d164)
	/go/src/github.com/ktr0731/evans/vendor/github.com/jhump/protoreflect/desc/protoparse/parser.go:478 +0x1ee
github.com/ktr0731/evans/vendor/github.com/jhump/protoreflect/desc/protoparse.parseProtoFiles.func1(0x17f34c0, 0xc4200be8f0, 0xc4201036d8, 0xc4202b86f0, 0xc4201036e8)
	/go/src/github.com/ktr0731/evans/vendor/github.com/jhump/protoreflect/desc/protoparse/parser.go:288 +0xb5
github.com/ktr0731/evans/vendor/github.com/jhump/protoreflect/desc/protoparse.parseProtoFiles(0xc4202b86c0, 0xc4200f9600, 0x8, 0x8, 0xc4202b86f0, 0x0, 0x28)
	/go/src/github.com/ktr0731/evans/vendor/github.com/jhump/protoreflect/desc/protoparse/parser.go:289 +0x241
github.com/ktr0731/evans/vendor/github.com/jhump/protoreflect/desc/protoparse.parseProtoFiles(0xc4202b86c0, 0xc4202997d0, 0x1, 0x1, 0xc4202b86f0, 0x20, 0x3265000001642340)
	/go/src/github.com/ktr0731/evans/vendor/github.com/jhump/protoreflect/desc/protoparse/parser.go:293 +0x2cc
github.com/ktr0731/evans/vendor/github.com/jhump/protoreflect/desc/protoparse.Parser.ParseFiles(0xc4202437e0, 0x2, 0x2, 0x0, 0x0, 0x0, 0xc4202997d0, 0x1, 0x1, 0x0, ...)
	/go/src/github.com/ktr0731/evans/vendor/github.com/jhump/protoreflect/desc/protoparse/parser.go:140 +0xb7
github.com/ktr0731/evans/adapter/internal/protoparser.ParseFile(0xc4202997d0, 0x1, 0x1, 0xc4202437e0, 0x2, 0x2, 0x15379ce, 0x1642340, 0x0, 0x1, ...)
	/go/src/github.com/ktr0731/evans/adapter/internal/protoparser/parser.go:28 +0x40e
github.com/ktr0731/evans/adapter/parser.ParseFile(0xc4202997d0, 0x1, 0x1, 0xc4202997c0, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, ...)
	/go/src/github.com/ktr0731/evans/adapter/parser/parser.go:10 +0x81
github.com/ktr0731/evans/di.initEnv.func1()
	/go/src/github.com/ktr0731/evans/di/dependency.go:32 +0x10e
sync.(*Once).Do(0x1bc76f0, 0xc420055cd0)
	/usr/local/go/src/sync/once.go:44 +0xbe
github.com/ktr0731/evans/di.initEnv(0xc42024b900, 0x0, 0x0)
	/go/src/github.com/ktr0731/evans/di/dependency.go:24 +0x5f
github.com/ktr0731/evans/di.Env(0xc42024b900, 0xc420055d58, 0x1027b09, 0xc4200ac070, 0xc420055d78)
	/go/src/github.com/ktr0731/evans/di/dependency.go:59 +0x2b
github.com/ktr0731/evans/di.initPromptInputter.func1()
	/go/src/github.com/ktr0731/evans/di/dependency.go:149 +0x3c
sync.(*Once).Do(0x1bc7740, 0xc420055db0)
	/usr/local/go/src/sync/once.go:44 +0xbe
github.com/ktr0731/evans/di.initPromptInputter(0xc42024b900, 0x0, 0x0)
	/go/src/github.com/ktr0731/evans/di/dependency.go:147 +0x5f
github.com/ktr0731/evans/di.initDependencies.func1.2(0x0, 0x0)
	/go/src/github.com/ktr0731/evans/di/dependency.go:217 +0x2a
github.com/ktr0731/evans/di.(*initializer).init(0xc4202b8660, 0xc420055e90, 0x1050700)
	/go/src/github.com/ktr0731/evans/di/dependency.go:200 +0x8d
github.com/ktr0731/evans/di.initDependencies(0xc42024b900, 0x17f0020, 0xc4200be000, 0x0, 0xc420055f00)
	/go/src/github.com/ktr0731/evans/di/dependency.go:224 +0x7e
github.com/ktr0731/evans/di.NewREPLInteractorParams(0xc42024b900, 0x17f0020, 0xc4200be000, 0x0, 0x0, 0x0)
	/go/src/github.com/ktr0731/evans/di/interactor.go:24 +0x43
github.com/ktr0731/evans/adapter/controller.(*CLI).runAsREPL.func2(0xc420299720, 0xc4200c5c20, 0xc4202c0360, 0x17f6700, 0xc42024b980, 0xc42009e120)
	/go/src/github.com/ktr0731/evans/adapter/controller/cli.go:375 +0xe3
created by github.com/ktr0731/evans/adapter/controller.(*CLI).runAsREPL
	/go/src/github.com/ktr0731/evans/adapter/controller/cli.go:359 +0x185

Repeated enum fails

message Request {
  User user = 1;
  repeated Attribute attributes = 2;
}

enum Attribute {
  ...
}

This causes Evans to do the following:

failed to input request message: Value for repeated field must be a slice; instead was int32

header REPL command

in command-line mode, --header option is implemented yet, but not implemented yet in REPL mode.

panic: unknown update level

running 0.6.3 on fedora 28 (amd64)

evans -p 8150 api/service.proto                   
panic: unknown update level

goroutine 34 [running]:
github.com/ktr0731/evans/adapter/controller.newUpdater(0xc42022b6c0, 0xc4200b2810, 0xc38f60, 0xc4202b6030, 0x0)
        /go/src/github.com/ktr0731/evans/adapter/controller/updater.go:139 +0x1a9
github.com/ktr0731/evans/adapter/controller.checkUpdate.func1(0x100d380, 0xc377a0, 0xc42022b740, 0xc4202c4000, 0xc42022b6c0)
        /go/src/github.com/ktr0731/evans/adapter/controller/updater.go:58 +0x1c0
created by github.com/ktr0731/evans/adapter/controller.checkUpdate
        /go/src/github.com/ktr0731/evans/adapter/controller/updater.go:25 +0xa3

-h HOSTオプションが利用できない

英語不得意なので日本語で失礼します。

helpでは-h HOSTオプションが利用できるように見えるが、指定するとhelpが表示されてしまいます。
hostとhelpのオプションがコンフリクトしているためかと思われます。

evans -h
evans 0.2.8
Usage: evans [--interactive] [--editconfig] [--host HOST] [--port PORT] [--package PACKAGE] [--service SERVICE] [--call CALL] [--file FILE] [--path PATH] [--header HEADER] [PROTO [PROTO ...]]

Positional arguments:
  PROTO                  .proto files

Options:
  --interactive, -i      use interactive mode
  --editconfig, -e       edit config file by $EDITOR
  --host HOST, -h HOST   gRPC host
  --port PORT, -p PORT   gRPC port [default: 50051]
  --package PACKAGE      default package
  --service SERVICE      default service. evans parse package from this if --package is nothing.
  --call CALL, -c CALL   call specified RPC
  --file FILE, -f FILE   the script file which will be executed (used only command-line mode)
  --path PATH            proto file path
  --header HEADER        headers set to each requests
  --help, -h             display this help and exit
  --version              display version and exit

Use OptionLivePrefix added from go-prompt v0.2.0

Hi @ktr0731!
First, I want to say congrats that evans reached 100 stars. I was sure that this will be popular.

Yesterday I released go-prompt v0.2.0 which includes a feature to change prefix string dynamically. I hope evans use this and the implementation will be more simple.

Thanks.

Windows support

These changes are required. (WIP)

  • colored output for Windows
  • isatty for Cygwin environment
  • GitHub Releases
  • CI environment

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.