trans

package
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 31, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMethodInfo

func GetMethodInfo(ri rpcinfo.RPCInfo, svcInfo *serviceinfo.ServiceInfo) (serviceinfo.MethodInfo, error)

GetMethodInfo is used to get method info from serviceinfo.MethodInfo by method name/

func GetReadTimeout

func GetReadTimeout(cfg rpcinfo.RPCConfig) time.Duration

GetReadTimeout is to make the read timeout longer, it is better for proxy case to receive error resp.

func NewDefaultCliTransHandler

func NewDefaultCliTransHandler(opt *remote.ClientOption, ext Extension) (remote.ClientTransHandler, error)

NewDefaultCliTransHandler to provide default impl of cliTransHandler, it can be reused in netpoll, shm-ipc, framework-sdk extensions

func NewDefaultSvrTransHandler

func NewDefaultSvrTransHandler(opt *remote.ServerOption, ext Extension) (remote.ServerTransHandler, error)

NewDefaultSvrTransHandler to provide default impl of svrTransHandler, it can be reused in netpoll, shm-ipc, framework-sdk extensions

func NewListenConfig

func NewListenConfig(opt *remote.ServerOption) net.ListenConfig

NewListenConfig return an new net.ListenConfig.

Types

type Extension

type Extension interface {
	SetReadTimeout(ctx context.Context, conn net.Conn, cfg rpcinfo.RPCConfig, role remote.RPCRole)
	NewWriteByteBuffer(ctx context.Context, conn net.Conn, msg remote.Message) remote.ByteBuffer
	NewReadByteBuffer(ctx context.Context, conn net.Conn, msg remote.Message) remote.ByteBuffer
	ReleaseBuffer(remote.ByteBuffer, error) error
	IsTimeoutErr(error) bool
	// IsRemoteClosedErr is to check if the error caused by connection closed when output log or report metric
	IsRemoteClosedErr(error) bool
}

Extension is the interface that trans extensions need to implement, it will make the extension of trans more easily. Normally if we want to extend transport layer we need to implement the trans interfaces which are defined in trans_handler.go. In fact most code logic is similar in same mode, so the Extension interface is the the differentiated part that need to be implemented separately. The default common trans implement is in default_client_handler.go and default_server_handler.go.

type MuxEnabledFlag

type MuxEnabledFlag interface {
	MuxEnabled() bool
}

MuxEnabledFlag is used to determine whether a serverHandlerFactory is multiplexing.

Directories

Path Synopsis
Package detection protocol detection, it is used for a scenario that switching KitexProtobuf to gRPC.
Package detection protocol detection, it is used for a scenario that switching KitexProtobuf to gRPC.
Package gonet contains server and client implementation for go net.
Package gonet contains server and client implementation for go net.
Package invoke .
Package invoke .
Package nphttp2 transport powered by netpoll
Package nphttp2 transport powered by netpoll
codes
Package codes defines the canonical error codes used by gRPC.
Package codes defines the canonical error codes used by gRPC.
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.
grpc/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.
grpc/testutils/leakcheck
Package leakcheck contains functions to check leaked goroutines.
Package leakcheck contains functions to check leaked goroutines.
metadata
Package metadata define the structure of the metadata supported by gRPC library.
Package metadata define the structure of the metadata supported by gRPC library.
status
Package status implements errors returned by gRPC.
Package status implements errors returned by gRPC.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL