Versions in this module Expand all Collapse all v0 v0.12.0 Dec 10, 2024 Changes in this version + var DefaultLongConnConfig = LongConnConfig + var DefaultMuxConnConfig = MuxConnConfig + var ErrCanceledStream = errors.New("stream is canceled") + var ErrClosedStream = errors.New("stream is closed") + var ErrInvalidStreamKind = errors.New("invalid stream kind") + 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(cp *clientProvider) + 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 interface + Header func() (streamx.Header, error) + Trailer func() (streamx.Trailer, error) + type Frame struct + func DecodeFrame(ctx context.Context, reader bufiox.Reader) (fr *Frame, err error) + func (f *Frame) String() string + type HeaderFrameHandler interface + type HeaderFrameReadHandler interface + OnReadStream func(ctx context.Context, ihd IntHeader, shd StrHeader) (context.Context, error) + type HeaderFrameWriteHandler interface + OnWriteStream func(ctx context.Context) (ihd IntHeader, shd StrHeader, err error) + type IntHeader map[uint16]string + type LongConnConfig struct + MaxIdleTimeout time.Duration + type MetaFrameHandler interface + OnMetaFrame func(smeta StreamMeta, intHeader IntHeader, header streamx.Header, payload []byte) error + type MuxConnConfig struct + MaxIdleTimeout time.Duration + PoolSize int + type ServerProviderOption func(pc *serverProvider) + func WithServerHeaderFrameHandler(handler HeaderFrameReadHandler) ServerProviderOption + func WithServerMetaFrameHandler(handler MetaFrameHandler) ServerProviderOption + type ServerStreamMeta interface + SendHeader func(hd streamx.Header) error + SetHeader func(hd streamx.Header) error + SetTrailer func(hd streamx.Trailer) error + type StrHeader = streamx.Header + type StreamMeta interface + GetMeta func(k string) (string, bool) + Meta func() map[string]string + SetMeta func(k, v string, kvs ...string)