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 EncodeGenericPayload(ctx context.Context, msg any) ([]byte, error)
- func EncodePayload(ctx context.Context, msg any) ([]byte, error)
- func NewClientProvider(opts ...ClientProviderOption) streamx.ClientProvider
- func NewServerProvider(opts ...ServerProviderOption) streamx.ServerProvider
- type ClientProviderOption
- func WithClientDisableCancelingTransmit() ClientProviderOption
- func WithClientHeaderFrameHandler(handler HeaderFrameWriteHandler) ClientProviderOption
- func WithClientLongConnPool(config LongConnConfig) ClientProviderOption
- func WithClientMetaFrameHandler(handler MetaFrameHandler) ClientProviderOption
- func WithClientMuxConnPool(config MuxConnConfig) ClientProviderOption
- func WithClientShortConnPool() ClientProviderOption
- type ClientStreamMeta
- type Frame
- type HeaderFrameHandler
- type HeaderFrameReadHandler
- type HeaderFrameWriteHandler
- type IntHeader
- type LongConnConfig
- type MetaFrameHandler
- type MuxConnConfig
- type ServerProviderOption
- type ServerStreamMeta
- type StrHeader
- type StreamMeta
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 NewClientProvider ¶
func NewClientProvider(opts ...ClientProviderOption) streamx.ClientProvider
NewClientProvider return a client provider
func NewServerProvider ¶
func NewServerProvider(opts ...ServerProviderOption) streamx.ServerProvider
NewServerProvider return a server provider
Types ¶
type ClientProviderOption ¶
type ClientProviderOption func(cp *clientProvider)
ClientProviderOption define client provider options
func WithClientDisableCancelingTransmit ¶
func WithClientDisableCancelingTransmit() ClientProviderOption
WithClientDisableCancelingTransmit disable canceling transmit from upstream
func WithClientHeaderFrameHandler ¶
func WithClientHeaderFrameHandler(handler HeaderFrameWriteHandler) ClientProviderOption
WithClientHeaderFrameHandler register TTHeader Streaming header frame handler
func WithClientLongConnPool ¶
func WithClientLongConnPool(config LongConnConfig) ClientProviderOption
WithClientLongConnPool using long connection pool for client
func WithClientMetaFrameHandler ¶
func WithClientMetaFrameHandler(handler MetaFrameHandler) ClientProviderOption
WithClientMetaFrameHandler register TTHeader Streaming meta frame handler
func WithClientMuxConnPool ¶
func WithClientMuxConnPool(config MuxConnConfig) ClientProviderOption
WithClientMuxConnPool using mux connection pool for client
func WithClientShortConnPool ¶
func WithClientShortConnPool() ClientProviderOption
WithClientShortConnPool using short connection pool for client
type ClientStreamMeta ¶
type ClientStreamMeta interface { streamx.ClientStream Header() (streamx.Header, error) Trailer() (streamx.Trailer, error) }
ClientStreamMeta cannot send header directly, should send from ctx
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 ServerProviderOption ¶
type ServerProviderOption func(pc *serverProvider)
ServerProviderOption define server provider options
func WithServerHeaderFrameHandler ¶
func WithServerHeaderFrameHandler(handler HeaderFrameReadHandler) ServerProviderOption
WithServerHeaderFrameHandler register TTHeader Streaming header frame handler
func WithServerMetaFrameHandler ¶
func WithServerMetaFrameHandler(handler MetaFrameHandler) ServerProviderOption
WithServerMetaFrameHandler register TTHeader Streaming meta frame handler
Source Files ¶
- client_provider_option.go
- client_provier.go
- client_trans_pool.go
- client_trans_pool_longconn.go
- client_trans_pool_muxconn.go
- client_trans_pool_shortconn.go
- exception.go
- frame.go
- frame_handler.go
- metadata.go
- server_provider.go
- server_provider_option.go
- stream.go
- stream_client.go
- stream_reader.go
- stream_server.go
- stream_writer.go
- test_utils.go
- transport.go
- transport_buffer.go