Documentation
¶
Index ¶
- Variables
- func DecodePayload(ctx context.Context, payload []byte, msg any) error
- func EncodeException(ctx context.Context, method string, seq int32, ex error) ([]byte, error)
- func EncodeFrame(ctx context.Context, writer bufiox.Writer, fr *Frame) (err error)
- func EncodePayload(ctx context.Context, msg any) ([]byte, error)
- func NewCliTransHandlerFactory(opts ...ClientHandlerOption) remote.ClientStreamFactory
- func NewSvrTransHandlerFactory() remote.ServerTransHandlerFactory
- type ClientHandlerOption
- func WithClientHeaderFrameHandler(handler HeaderFrameWriteHandler) ClientHandlerOption
- func WithClientLongConnPool(config LongConnConfig) ClientHandlerOption
- func WithClientMetaFrameHandler(handler MetaFrameHandler) ClientHandlerOption
- func WithClientMuxConnPool(config MuxConnConfig) ClientHandlerOption
- func WithClientShortConnPool() ClientHandlerOption
- func WithClientTraceController(traceCtl *rpcinfo.TraceController) ClientHandlerOption
- type ClientProviderOptiondeprecated
- type ClientStreamMeta
- type Exception
- type Frame
- type HeaderFrameHandler
- type HeaderFrameReadHandler
- type HeaderFrameWriteHandler
- type IntHeader
- type LongConnConfig
- type MetaFrameHandler
- type MuxConnConfig
- type ServerHandlerOption
- type ServerProviderOptiondeprecated
- type ServerStreamMeta
- type StrHeader
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidStreamKind = errors.New("invalid stream kind") ErrClosedStream = errors.New("stream is closed") ErrCanceledStream = errors.New("stream is canceled") )
var DefaultLongConnConfig = LongConnConfig{ MaxIdleTimeout: time.Minute, }
var DefaultMuxConnConfig = MuxConnConfig{ PoolSize: runtime.GOMAXPROCS(0), MaxIdleTimeout: time.Minute, }
Functions ¶
func EncodeException ¶
func EncodeFrame ¶
EncodeFrame will not call Flush!
func NewCliTransHandlerFactory ¶ added in v0.15.0
func NewCliTransHandlerFactory(opts ...ClientHandlerOption) remote.ClientStreamFactory
NewCliTransHandlerFactory return a client trans handler factory.
func NewSvrTransHandlerFactory ¶ added in v0.14.0
func NewSvrTransHandlerFactory() remote.ServerTransHandlerFactory
NewSvrTransHandlerFactory ...
Types ¶
type ClientHandlerOption ¶ added in v0.15.0
type ClientHandlerOption func(cp *clientTransHandler)
ClientHandlerOption define client handler options
func WithClientHeaderFrameHandler ¶
func WithClientHeaderFrameHandler(handler HeaderFrameWriteHandler) ClientHandlerOption
WithClientHeaderFrameHandler register TTHeader Streaming header frame handler
func WithClientLongConnPool ¶
func WithClientLongConnPool(config LongConnConfig) ClientHandlerOption
WithClientLongConnPool using long connection pool for client
func WithClientMetaFrameHandler ¶
func WithClientMetaFrameHandler(handler MetaFrameHandler) ClientHandlerOption
WithClientMetaFrameHandler register TTHeader Streaming meta frame handler
func WithClientMuxConnPool ¶
func WithClientMuxConnPool(config MuxConnConfig) ClientHandlerOption
WithClientMuxConnPool using mux connection pool for client
func WithClientShortConnPool ¶
func WithClientShortConnPool() ClientHandlerOption
WithClientShortConnPool using short connection pool for client
func WithClientTraceController ¶ added in v0.16.0
func WithClientTraceController(traceCtl *rpcinfo.TraceController) ClientHandlerOption
WithClientTraceController configures TraceController to report detailed streaming events
type ClientProviderOption
deprecated
type ClientProviderOption = ClientHandlerOption
Deprecated: use ClientHandlerOption instead
type ClientStreamMeta ¶
type ClientStreamMeta interface {
streaming.ClientStream
Header() (streaming.Header, error)
Trailer() (streaming.Trailer, error)
}
ClientStreamMeta cannot send header directly, should send from ctx
type Exception ¶ added in v0.15.0
type Exception struct {
// contains filtered or unexported fields
}
type Frame ¶
type Frame struct {
// contains filtered or unexported fields
}
Frame define a TTHeader Streaming Frame
func DecodeFrame ¶
type HeaderFrameHandler ¶
type HeaderFrameHandler interface {
HeaderFrameReadHandler
HeaderFrameWriteHandler
}
type HeaderFrameReadHandler ¶
type HeaderFrameWriteHandler ¶
type LongConnConfig ¶
type MetaFrameHandler ¶
type MuxConnConfig ¶
type ServerHandlerOption ¶ added in v0.15.0
type ServerHandlerOption func(pc *svrTransHandler)
ServerHandlerOption define server provider options
func WithServerHeaderFrameHandler ¶
func WithServerHeaderFrameHandler(handler HeaderFrameReadHandler) ServerHandlerOption
WithServerHeaderFrameHandler register TTHeader Streaming header frame handler
type ServerProviderOption
deprecated
type ServerProviderOption = ServerHandlerOption
Deprecated: use ServerHandlerOption instead
Source Files
¶
- client_handler.go
- client_handler_option.go
- client_stream_cleanup.go
- client_trans_pool.go
- client_trans_pool_longconn.go
- client_trans_pool_muxconn.go
- client_trans_pool_shortconn.go
- context.go
- exception.go
- frame.go
- frame_handler.go
- metadata.go
- server_handler.go
- server_handler_option.go
- stream.go
- stream_client.go
- stream_reader.go
- stream_server.go
- stream_writer.go
- test_utils.go
- transport.go
- transport_buffer.go
- transport_client.go
- transport_server.go