connectbridge

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package connectbridge adapts Connect server streams to the gRPC streaming server interfaces that protobuf-generated code expects.

Use it when a connectrpc.com/connect handler needs to delegate a server-streaming RPC to a gRPC-shape service implementation. The adapter wraps a *connect.ServerStream[T] so it satisfies grpc.ServerStreamingServer[T].

Metadata methods (SetHeader, SendHeader, SetTrailer) are no-ops in v1; header and trailer propagation is a future concern.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectStreamBridge

type ConnectStreamBridge[T any] struct {
	// contains filtered or unexported fields
}

ConnectStreamBridge adapts a *connect.ServerStream[T] to satisfy grpc.ServerStreamingServer[T]. It lets a Connect handler delegate a server-streaming RPC to a gRPC-shape service implementation.

SetHeader, SendHeader, and SetTrailer are no-ops; header and trailer propagation is deferred until a consumer needs it.

func NewConnectStreamBridge

func NewConnectStreamBridge[T any](ctx context.Context, s *connect.ServerStream[T]) *ConnectStreamBridge[T]

NewConnectStreamBridge wraps a Connect server stream so it can be passed to gRPC-generated server-streaming code.

func (*ConnectStreamBridge[T]) Context

func (b *ConnectStreamBridge[T]) Context() context.Context

func (*ConnectStreamBridge[T]) RecvMsg

func (b *ConnectStreamBridge[T]) RecvMsg(m any) error

func (*ConnectStreamBridge[T]) Send

func (b *ConnectStreamBridge[T]) Send(msg *T) error

func (*ConnectStreamBridge[T]) SendHeader

func (b *ConnectStreamBridge[T]) SendHeader(metadata.MD) error

func (*ConnectStreamBridge[T]) SendMsg

func (b *ConnectStreamBridge[T]) SendMsg(m any) error

func (*ConnectStreamBridge[T]) SetHeader

func (b *ConnectStreamBridge[T]) SetHeader(metadata.MD) error

func (*ConnectStreamBridge[T]) SetTrailer

func (b *ConnectStreamBridge[T]) SetTrailer(metadata.MD)

Jump to

Keyboard shortcuts

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