4 Commits

Author SHA1 Message Date
Sunil Thorat
59a32e5eb0 Upgrade to using golang 1.15 to build (#240) 2021-07-14 10:24:01 -04:00
Joshua Humphries
7e1cd16164 use newer protoreflect, v1.9.0 (#242) 2021-07-13 11:53:16 -04:00
Joshua Humphries
de25c89822 allow callers of BlockingDial to override grpc.FailOnNonTempDialError dial option (#241) 2021-07-12 15:27:33 -04:00
Joshua Humphries
f1d396c31e freshen README, point to 3rd party packages for install (#229) 2021-05-04 12:03:54 -04:00
6 changed files with 45 additions and 17 deletions

View File

@@ -15,6 +15,8 @@ matrix:
- VET=1 - VET=1
- go: 1.14.x - go: 1.14.x
env: GO111MODULE=on env: GO111MODULE=on
- go: 1.15.x
env: GO111MODULE=on
- go: tip - go: tip
env: GO111MODULE=on env: GO111MODULE=on

View File

@@ -1,4 +1,4 @@
FROM golang:1.13-alpine as builder FROM golang:1.15-alpine as builder
MAINTAINER FullStory Engineering MAINTAINER FullStory Engineering
# create non-privileged group and user # create non-privileged group and user

View File

@@ -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. Download the binary from the [releases](https://github.com/fullstorydev/grpcurl/releases) page.
### Homebrew (macOS)
On macOS, `grpcurl` is available via Homebrew: On macOS, `grpcurl` is available via Homebrew:
```shell ```shell
brew install grpcurl 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 ### 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 ```shell
go get github.com/fullstorydev/grpcurl/... go get github.com/fullstorydev/grpcurl/...
go install github.com/fullstorydev/grpcurl/cmd/grpcurl go install github.com/fullstorydev/grpcurl/cmd/grpcurl
``` ```
This installs the command into the `bin` sub-folder of wherever your `$GOPATH` 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 environment variable points. (If you have no `GOPATH` environment variable set,
you should be good to go. 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 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 `$GOPATH` and want to build from the sources, you can `cd` into the repo and then
run `make install`. run `make install`.
If you encounter compile errors, you could have out-dated versions of `grpcurl`'s If you encounter compile errors and are using a version of the Go SDK older than 1.13,
dependencies. You can update the dependencies by running `make updatedeps`. You can you could have out-dated versions of `grpcurl`'s dependencies. You can update the
also use [`vgo`](https://github.com/golang/vgo) to install, which will use the right dependencies by running `make updatedeps`. Or, if you are using Go 1.11 or 1.12, you
versions of dependencies. Or, if you are using Go 1.11, you can add `GO111MODULE=on` can add `GO111MODULE=on` as a prefix to the commands above, which will also build using
as a prefix to the commands above, which will also build using the right versions of the right versions of dependencies (vs. whatever you may already have in your `GOPATH`).
dependencies (vs. whatever you may already in your `GOPATH`).
## Usage ## Usage
The usage doc for the tool explains the numerous options: The usage doc for the tool explains the numerous options:

4
go.mod
View File

@@ -1,12 +1,12 @@
module github.com/fullstorydev/grpcurl module github.com/fullstorydev/grpcurl
go 1.13 go 1.15
require ( require (
github.com/golang/protobuf v1.4.2 github.com/golang/protobuf v1.4.2
github.com/gordonklaus/ineffassign v0.0.0-20200309095847-7953dde2c7bf // indirect github.com/gordonklaus/ineffassign v0.0.0-20200309095847-7953dde2c7bf // indirect
github.com/goreleaser/goreleaser v0.134.0 // 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 github.com/nishanths/predeclared v0.0.0-20200524104333-86fad755b4d3 // indirect
golang.org/x/net v0.0.0-20200625001655-4c5254603344 golang.org/x/net v0.0.0-20200625001655-4c5254603344
google.golang.org/api v0.29.0 // indirect google.golang.org/api v0.29.0 // indirect

2
go.sum
View File

@@ -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.6.1/go.mod h1:RZQ/lnuN+zqeRVpQigTwO6o0AJUkxbnSnpuG7toUTG4=
github.com/jhump/protoreflect v1.8.2 h1:k2xE7wcUomeqwY0LDCYA16y4WWfyTcMx5mKhk0d4ua0= 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.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-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 h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM=
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=

View File

@@ -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 // 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. // channel to either get the connection or fail-fast.
go func() { go func() {
opts = append(opts, // We put grpc.FailOnNonTempDialError *before* the explicitly provided
grpc.WithBlock(), // options so that it could be overridden.
grpc.FailOnNonTempDialError(true), opts = append([]grpc.DialOption{grpc.FailOnNonTempDialError(true)}, opts...)
grpc.WithContextDialer(dialer), // 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 { if creds == nil {
opts = append(opts, grpc.WithInsecure()) opts = append(opts, grpc.WithInsecure())
} else { } else {