Skip to content

Commit

Permalink
remove unix option
Browse files Browse the repository at this point in the history
  • Loading branch information
zhyuri committed Dec 19, 2024
1 parent b9a11e9 commit 0705db2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 29 deletions.
14 changes: 2 additions & 12 deletions cmd/grpcurl/grpcurl.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ var version = noVersion
var (
exit = os.Exit

isUnixSocket func() bool // nil when run on non-unix platform

flags = flag.NewFlagSet(os.Args[0], flag.ExitOnError)

help = flags.Bool("help", false, prettify(`
Expand Down Expand Up @@ -483,13 +481,6 @@ func main() {
if *maxMsgSz > 0 {
opts = append(opts, grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(*maxMsgSz)))
}
network := "tcp"
if isUnixSocket != nil && isUnixSocket() {
network = "unix"
if *authority == "" {
*authority = "localhost"
}
}
var creds credentials.TransportCredentials
if *plaintext {
if *authority != "" {
Expand Down Expand Up @@ -556,7 +547,7 @@ func main() {

blockingDialTiming := dialTiming.Child("BlockingDial")
defer blockingDialTiming.Done()
cc, err := grpcurl.BlockingDial(ctx, network, target, creds, opts...)
cc, err := grpcurl.BlockingDial(ctx, target, creds, opts...)
if err != nil {
fail(err, "Failed to dial target host %q", target)
}
Expand Down Expand Up @@ -881,8 +872,7 @@ method's request type will be sent.
The address will typically be in the form "host:port" where host can be an IP
address or a hostname and port is a numeric port or service name. If an IPv6
address is given, it must be surrounded by brackets, like "[2001:db8::1]". For
Unix variants, if a -unix=true flag is present, then the address must be the
path to the domain socket.
Unix variants, the address must start with schema "unix://" followed by the path.
Available flags:
`, os.Args[0])
Expand Down
15 changes: 0 additions & 15 deletions cmd/grpcurl/unix.go

This file was deleted.

2 changes: 1 addition & 1 deletion grpcurl.go
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ func ServerTransportCredentials(cacertFile, serverCertFile, serverKeyFile string
// BlockingDial is a helper method to dial the given address, using optional TLS credentials,
// and blocking until the returned connection is ready. If the given credentials are nil, the
// connection will be insecure (plain-text).
func BlockingDial(ctx context.Context, network, address string, creds credentials.TransportCredentials, opts ...grpc.DialOption) (*grpc.ClientConn, error) {
func BlockingDial(ctx context.Context, address string, creds credentials.TransportCredentials, opts ...grpc.DialOption) (*grpc.ClientConn, error) {
if creds == nil {
creds = insecure.NewCredentials()
}
Expand Down
2 changes: 1 addition & 1 deletion tls_settings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ func createTestServerAndClient(serverCreds, clientCreds credentials.TransportCre
ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
defer cancel()

cc, err := BlockingDial(ctx, "tcp", fmt.Sprintf("127.0.0.1:%d", port), clientCreds)
cc, err := BlockingDial(ctx, fmt.Sprintf("127.0.0.1:%d", port), clientCreds)
if err != nil {
return e, err
}
Expand Down

0 comments on commit 0705db2

Please sign in to comment.