linzhengen / tech-notes

My tech notes write in github issues🧲
1 stars 0 forks source link

[20210907] evans cliは対話式で入力できるのはいいね! #140

Open linzhengen opened 3 years ago

linzhengen commented 3 years ago

GitHub

https://github.com/ktr0731/evans

使い方

Usage: evans [global options ...] <command>

Options:
        --silent, -s                     hide redundant output (default "false")
        --path strings                   comma-separated proto file paths (default "[]")
        --proto strings                  comma-separated proto file names (default "[]")
        --host string                    gRPC server host
        --port, -p string                gRPC server port (default "50051")
        --header slice of strings        default headers that set to each requests (example: foo=bar) (default "[]")
        --web                            use gRPC-Web protocol (default "false")
        --reflection, -r                 use gRPC reflection (default "false")
        --tls, -t                        use a secure TLS connection (default "false")
        --cacert string                  the CA certificate file for verifying the server
        --cert string                    the certificate file for mutual TLS auth. it must be provided with --certkey.
        --certkey string                 the private key file for mutual TLS auth. it must be provided with --cert.
        --servername string              override the server name used to verify the hostname (ignored if --tls is disabled)
        --edit, -e                       edit the project config file by using $EDITOR (default "false")
        --edit-global                    edit the global config file by using $EDITOR (default "false")
        --verbose                        verbose output (default "false")
        --version, -v                    display version and exit (default "false")
        --help, -h                       display help text and exit (default "false")

使用例

evans \
  --path hoge/lib1.proto \
  --path hoge/lib2.proto \
  --host localhost \
  --port 50051
  --proto protobuf/*.proto
> call BidiStreaming
name (TYPE_STRING) => foo
{
  "message": "hello foo, I greet 0 times."
}

{
  "message": "hello foo, I greet 1 times."
}

{
  "message": "hello foo, I greet 2 times."
}

name (TYPE_STRING) => bar
{
  "message": "hello bar, I greet 0 times."
}

name (TYPE_STRING) =>