Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

The Go language implementation of gRPC. HTTP/2 based RPC

License

NotificationsYou must be signed in to change notification settings

grpc/grpc-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

GoDocGoReportCardcodecov

TheGo implementation ofgRPC: A high performance, open source, generalRPC framework that puts mobile and HTTP/2 first. For more information see theGo gRPC docs, or jump directly into thequick start.

Prerequisites

Installation

Simply add the following import to your code, and thengo [build|run|test]will automatically fetch the necessary dependencies:

import"google.golang.org/grpc"

Note: If you are trying to accessgrpc-go fromChina, see theFAQ below.

Learn more

FAQ

I/O Timeout Errors

Thegolang.org domain may be blocked from some countries.go get usuallyproduces an error like the following when this happens:

$go get -u google.golang.org/grpcpackage google.golang.org/grpc: unrecognized import path "google.golang.org/grpc" (https fetch: Get https://google.golang.org/grpc?go-get=1: dial tcp 216.239.37.1:443: i/o timeout)

To build Go code, there are several options:

  • Set up a VPN and access google.golang.org through that.

  • With Go module support: it is possible to use thereplace feature ofgo mod to create aliases for golang.org packages. In your project's directory:

    go mod edit -replace=google.golang.org/grpc=github.com/grpc/grpc-go@latestgo mod tidygo mod vendorgo build -mod=vendor

    Again, this will need to be done for all transitive dependencies hosted ongolang.org as well. For details, refer togolang/go issue#28652.

Compiling error, undefined: grpc.SupportPackageIsVersion

Please update to the latest version of gRPC-Go usinggo get google.golang.org/grpc.

How to turn on logging

The default logger is controlled by environment variables. Turn everything onlike this:

$export GRPC_GO_LOG_VERBOSITY_LEVEL=99$export GRPC_GO_LOG_SEVERITY_LEVEL=info

The RPC failed with error"code = Unavailable desc = transport is closing"

This error means the connection the RPC is using was closed, and there are manypossible reasons, including:

  1. mis-configured transport credentials, connection failed on handshaking
  2. bytes disrupted, possibly by a proxy in between
  3. server shutdown
  4. Keepalive parameters caused connection shutdown, for example if you haveconfigured your server to terminate connections regularly totrigger DNSlookups.If this is the case, you may want to increase yourMaxConnectionAgeGrace,to allow longer RPC calls to finish.

It can be tricky to debug this because the error happens on the client side butthe root cause of the connection being closed is on the server side. Turn onlogging onboth client and server, and see if there are any transporterrors.

About

The Go language implementation of gRPC. HTTP/2 based RPC

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors506

Languages


[8]ページ先頭

©2009-2025 Movatter.jp