Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnectConnAndStreamingServer ¶
func ConnectConnAndStreamingServer[RecvT BlobRequest, SendT any](conn net.Conn, strm StreamServer[RecvT, SendT], sendFactory func([]byte) SendT, startWrite <-chan struct{}, options ...WrapperOptions)
Connect a golang net.Conn interface with a grpc bi-directional streaming API. This function blocks until the connection is terminated or errored out. The caller is responsible for making sure that after this function call, with the exception of startWrite, the bi-directional stream only sends and receives bytes, not any other data types. Caller is responsible for closing both conn and strm.
Types ¶
type BlobRequest ¶
type BlobRequest interface {
GetBlob() []byte
}
type StreamServer ¶
type StreamServer[RecvT BlobRequest, SendT any] interface { Recv() (RecvT, error) Send(SendT) error }
type WrapperOptions ¶
type WrapperOptions func(wrapperOptions) wrapperOptions
func WithLogger ¶
func WithLogger(logger *log.Logger) WrapperOptions
Click to show internal directories.
Click to hide internal directories.