Documentation ¶
Overview ¶
Package nphttp2 transport powered by netpoll
Index ¶
- func GRPCHeader(ctx context.Context, md *metadata.MD) context.Context
- func GRPCTrailer(ctx context.Context, md *metadata.MD) context.Context
- func GetHeaderMetadataFromCtx(ctx context.Context) *metadata.MD
- func NewCliTransHandlerFactory() remote.ClientTransHandlerFactory
- func NewConnPool(remoteService string, size uint32, connOpts grpc.ConnectOptions) *connPool
- func NewStream(ctx context.Context, svcInfo *serviceinfo.ServiceInfo, conn net.Conn, ...) streaming.Stream
- func NewSvrTransHandlerFactory() remote.ServerTransHandlerFactory
- func SendHeader(ctx context.Context, md metadata.MD) error
- func SetHeader(ctx context.Context, md metadata.MD) error
- func SetTrailer(ctx context.Context, md metadata.MD) error
- type GRPCConn
- type Streamer
- type SvrTrans
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GRPCHeader ¶ added in v0.4.3
GRPCHeader is used for unary call client to get header from response.
func GRPCTrailer ¶ added in v0.4.3
GRPCTrailer is used for unary call client to get taiiler from response.
func GetHeaderMetadataFromCtx ¶ added in v0.6.0
GetHeaderMetadataFromCtx is used to get the metadata of stream Header from ctx.
func NewCliTransHandlerFactory ¶
func NewCliTransHandlerFactory() remote.ClientTransHandlerFactory
NewCliTransHandlerFactory ...
func NewConnPool ¶
func NewConnPool(remoteService string, size uint32, connOpts grpc.ConnectOptions) *connPool
NewConnPool ...
func NewStream ¶
func NewStream(ctx context.Context, svcInfo *serviceinfo.ServiceInfo, conn net.Conn, handler remote.TransReadWriter, ) streaming.Stream
NewStream ...
func NewSvrTransHandlerFactory ¶
func NewSvrTransHandlerFactory() remote.ServerTransHandlerFactory
NewSvrTransHandlerFactory ...
func SendHeader ¶ added in v0.4.3
SendHeader sends header metadata. It may be called at most once, and may not be called after any event that causes headers to be sent (see SetHeader for a complete list). The provided md and headers set by SetHeader() will be sent.
The error returned is compatible with the status package. However, the status code will often not match the RPC status as seen by the client application, and therefore, should not be relied upon for this purpose.
func SetHeader ¶ added in v0.4.3
SetHeader sets the header metadata to be sent from the server to the client. The context provided must be the context passed to the server's handler.
Streaming RPCs should prefer the SetHeader method of the ServerStream.
When called multiple times, all the provided metadata will be merged. All the metadata will be sent out when one of the following happens:
- grpc.SendHeader is called, or for streaming handlers, stream.SendHeader.
- The first response message is sent. For unary handlers, this occurs when the handler returns; for streaming handlers, this can happen when stream's SendMsg method is called.
- An RPC status is sent out (error or success). This occurs when the handler returns.
SetHeader will fail if called after any of the events above.
The error returned is compatible with the status package. However, the status code will often not match the RPC status as seen by the client application, and therefore, should not be relied upon for this purpose.
func SetTrailer ¶ added in v0.4.3
SetTrailer sets the trailer metadata that will be sent when an RPC returns. When called more than once, all the provided metadata will be merged.
The error returned is compatible with the status package. However, the status code will often not match the RPC status as seen by the client application, and therefore, should not be relied upon for this purpose.
Types ¶
type GRPCConn ¶ added in v0.3.3
type GRPCConn interface { net.Conn // WriteFrame set header and data buffer into frame with nocopy WriteFrame(hdr, data []byte) (n int, err error) // ReadFrame read a frame and return header and payload data ReadFrame() (hdr, data []byte, err error) }
GRPCConn implement WriteFrame and ReadFrame
type Streamer ¶
type Streamer func(ctx context.Context, svcInfo serviceinfo.ServiceInfo, conn net.Conn, handler remote.TransReadWriter) streaming.Stream
Streamer Stream creator
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package codes defines the canonical error codes used by gRPC.
|
Package codes defines the canonical error codes used by gRPC. |
The files in grpc package are forked from gRPC[github.com/grpc/grpc-go], and we keep the original Copyright[Copyright 2017 gRPC authors] and License of gRPC for those files.
|
The files in grpc package are forked from gRPC[github.com/grpc/grpc-go], and we keep the original Copyright[Copyright 2017 gRPC authors] and License of gRPC for those files. |
syscall
Package syscall provides functionalities that grpc uses to get low-level operating system stats/info.
|
Package syscall provides functionalities that grpc uses to get low-level operating system stats/info. |
testutils/leakcheck
Package leakcheck contains functions to check leaked goroutines.
|
Package leakcheck contains functions to check leaked goroutines. |
Package metadata define the structure of the metadata supported by gRPC library.
|
Package metadata define the structure of the metadata supported by gRPC library. |
Package status implements errors returned by gRPC.
|
Package status implements errors returned by gRPC. |