mirror of
https://github.com/fullstorydev/grpcurl.git
synced 2026-05-25 21:21:46 +03:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
59a32e5eb0 | ||
|
|
7e1cd16164 | ||
|
|
de25c89822 | ||
|
|
f1d396c31e |
@@ -15,6 +15,8 @@ matrix:
|
||||
- VET=1
|
||||
- go: 1.14.x
|
||||
env: GO111MODULE=on
|
||||
- go: 1.15.x
|
||||
env: GO111MODULE=on
|
||||
- go: tip
|
||||
env: GO111MODULE=on
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM golang:1.13-alpine as builder
|
||||
FROM golang:1.15-alpine as builder
|
||||
MAINTAINER FullStory Engineering
|
||||
|
||||
# create non-privileged group and user
|
||||
|
||||
40
README.md
40
README.md
@@ -49,32 +49,54 @@ files (containing compiled descriptors, produced by `protoc`) to `grpcurl`.
|
||||
|
||||
Download the binary from the [releases](https://github.com/fullstorydev/grpcurl/releases) page.
|
||||
|
||||
### Homebrew (macOS)
|
||||
|
||||
On macOS, `grpcurl` is available via Homebrew:
|
||||
```shell
|
||||
brew install grpcurl
|
||||
```
|
||||
|
||||
### Docker
|
||||
|
||||
For platforms that support Docker, you can download an image that lets you run `grpcurl`:
|
||||
```shell
|
||||
# Download image
|
||||
docker pull fullstorydev/grpcurl:latest
|
||||
# Run the tool
|
||||
docker run fullstorydev/grpcurl api.grpc.me:443 list
|
||||
```
|
||||
|
||||
### Other Packages
|
||||
|
||||
There are numerous other ways to install `grpcurl`, thanks to support from third parties that
|
||||
have created recipes/packages for it. These include other ways to install `grpcurl` on a variety
|
||||
of environments, including Windows and myriad Linux distributions.
|
||||
|
||||
You can see more details and the full list of other packages for `grpcurl` at _repology.org_:
|
||||
https://repology.org/project/grpcurl/information
|
||||
|
||||
### From Source
|
||||
You can use the `go` tool to install `grpcurl`:
|
||||
If you already have the [Go SDK](https://golang.org/doc/install) installed, you can use the `go`
|
||||
tool to install `grpcurl`:
|
||||
```shell
|
||||
go get github.com/fullstorydev/grpcurl/...
|
||||
go install github.com/fullstorydev/grpcurl/cmd/grpcurl
|
||||
```
|
||||
|
||||
This installs the command into the `bin` sub-folder of wherever your `$GOPATH`
|
||||
environment variable points. If this directory is already in your `$PATH`, then
|
||||
you should be good to go.
|
||||
environment variable points. (If you have no `GOPATH` environment variable set,
|
||||
the default install location is `$HOME/go/bin`). If this directory is already in
|
||||
your `$PATH`, then you should be good to go.
|
||||
|
||||
If you have already pulled down this repo to a location that is not in your
|
||||
`$GOPATH` and want to build from the sources, you can `cd` into the repo and then
|
||||
run `make install`.
|
||||
|
||||
If you encounter compile errors, you could have out-dated versions of `grpcurl`'s
|
||||
dependencies. You can update the dependencies by running `make updatedeps`. You can
|
||||
also use [`vgo`](https://github.com/golang/vgo) to install, which will use the right
|
||||
versions of dependencies. Or, if you are using Go 1.11, you can add `GO111MODULE=on`
|
||||
as a prefix to the commands above, which will also build using the right versions of
|
||||
dependencies (vs. whatever you may already in your `GOPATH`).
|
||||
If you encounter compile errors and are using a version of the Go SDK older than 1.13,
|
||||
you could have out-dated versions of `grpcurl`'s dependencies. You can update the
|
||||
dependencies by running `make updatedeps`. Or, if you are using Go 1.11 or 1.12, you
|
||||
can add `GO111MODULE=on` as a prefix to the commands above, which will also build using
|
||||
the right versions of dependencies (vs. whatever you may already have in your `GOPATH`).
|
||||
|
||||
## Usage
|
||||
The usage doc for the tool explains the numerous options:
|
||||
|
||||
4
go.mod
4
go.mod
@@ -1,12 +1,12 @@
|
||||
module github.com/fullstorydev/grpcurl
|
||||
|
||||
go 1.13
|
||||
go 1.15
|
||||
|
||||
require (
|
||||
github.com/golang/protobuf v1.4.2
|
||||
github.com/gordonklaus/ineffassign v0.0.0-20200309095847-7953dde2c7bf // indirect
|
||||
github.com/goreleaser/goreleaser v0.134.0 // indirect
|
||||
github.com/jhump/protoreflect v1.8.2
|
||||
github.com/jhump/protoreflect v1.9.0
|
||||
github.com/nishanths/predeclared v0.0.0-20200524104333-86fad755b4d3 // indirect
|
||||
golang.org/x/net v0.0.0-20200625001655-4c5254603344
|
||||
google.golang.org/api v0.29.0 // indirect
|
||||
|
||||
2
go.sum
2
go.sum
@@ -235,6 +235,8 @@ github.com/jhump/protoreflect v1.6.1 h1:4/2yi5LyDPP7nN+Hiird1SAJ6YoxUm13/oxHGRnb
|
||||
github.com/jhump/protoreflect v1.6.1/go.mod h1:RZQ/lnuN+zqeRVpQigTwO6o0AJUkxbnSnpuG7toUTG4=
|
||||
github.com/jhump/protoreflect v1.8.2 h1:k2xE7wcUomeqwY0LDCYA16y4WWfyTcMx5mKhk0d4ua0=
|
||||
github.com/jhump/protoreflect v1.8.2/go.mod h1:7GcYQDdMU/O/BBrl/cX6PNHpXh6cenjd8pneu5yW7Tg=
|
||||
github.com/jhump/protoreflect v1.9.0 h1:npqHz788dryJiR/l6K/RUQAyh2SwV91+d1dnh4RjO9w=
|
||||
github.com/jhump/protoreflect v1.9.0/go.mod h1:7GcYQDdMU/O/BBrl/cX6PNHpXh6cenjd8pneu5yW7Tg=
|
||||
github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
|
||||
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM=
|
||||
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
|
||||
|
||||
12
grpcurl.go
12
grpcurl.go
@@ -635,11 +635,13 @@ func BlockingDial(ctx context.Context, network, address string, creds credential
|
||||
// know when we're done. So we run it in a goroutine and then use result
|
||||
// channel to either get the connection or fail-fast.
|
||||
go func() {
|
||||
opts = append(opts,
|
||||
grpc.WithBlock(),
|
||||
grpc.FailOnNonTempDialError(true),
|
||||
grpc.WithContextDialer(dialer),
|
||||
)
|
||||
// We put grpc.FailOnNonTempDialError *before* the explicitly provided
|
||||
// options so that it could be overridden.
|
||||
opts = append([]grpc.DialOption{grpc.FailOnNonTempDialError(true)}, opts...)
|
||||
// But we don't want caller to be able to override these two, so we put
|
||||
// them *after* the explicitly provided options.
|
||||
opts = append(opts, grpc.WithBlock(), grpc.WithContextDialer(dialer))
|
||||
|
||||
if creds == nil {
|
||||
opts = append(opts, grpc.WithInsecure())
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user