protostream

package
v0.0.0-...-c5da4db Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2017 License: MIT Imports: 10 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrAlreadyClosed is the error returned if CloseSend() is called twice on a StreamingBytesRelayer.
	ErrAlreadyClosed = errors.New("protostream: already closed")
)

Functions

func NewStreamingBytesReader

func NewStreamingBytesReader(streamingBytesClient StreamingBytesClient) io.Reader

NewStreamingBytesReader returns an io.Reader for a StreamingBytesClient.

func NewStreamingBytesWriter

func NewStreamingBytesWriter(streamingBytesServer StreamingBytesServer) io.Writer

NewStreamingBytesWriter returns an io.Writer for a StreamingBytesServer.

func RelayFromStreamingBytesClient

func RelayFromStreamingBytesClient(streamingBytesClient StreamingBytesClient, streamingBytesServer StreamingBytesServer) error

RelayFromStreamingBytesClient relays *google_protobuf.BytesValues from the StreamingBytesClient to the StreamingBytesServer.

func WriteFromStreamingBytesClient

func WriteFromStreamingBytesClient(streamingBytesClient StreamingBytesClient, writer io.Writer) error

WriteFromStreamingBytesClient writes from the StreamingBytesClient to the io.Writer.

func WriteToStreamingBytesServer

func WriteToStreamingBytesServer(reader io.Reader, streamingBytesServer StreamingBytesServer) error

WriteToStreamingBytesServer writes the data from the io.Reader to the StreamingBytesServer.

Types

type StreamingBytesClient

type StreamingBytesClient interface {
	Recv() (*google_protobuf.BytesValue, error)
}

StreamingBytesClient represents a client for an rpc method of the form:

rpc Foo(Bar) returns (stream google.protobuf.BytesValue) {}

type StreamingBytesClientHandler

type StreamingBytesClientHandler interface {
	Handle(streamingBytesClient StreamingBytesClient) error
}

StreamingBytesClientHandler handles a StreamingBytesClient.

func NewStreamingBytesClientHandler

func NewStreamingBytesClientHandler(handleFunc func(*google_protobuf.BytesValue) error) StreamingBytesClientHandler

NewStreamingBytesClientHandler returns a StreamingBytesClientHandler for the given handleFunc.

type StreamingBytesDuplexCloser

type StreamingBytesDuplexCloser interface {
	StreamingBytesClient
	StreamingBytesServeCloser
}

StreamingBytesDuplexCloser is a StreamingBytesDuplexer with close.

type StreamingBytesDuplexer

type StreamingBytesDuplexer interface {
	StreamingBytesClient
	StreamingBytesServer
}

StreamingBytesDuplexer is both a StreamingBytesClient and StreamingBytesServer.

type StreamingBytesRelayer

type StreamingBytesRelayer interface {
	StreamingBytesDuplexer
	Header() (metadata.MD, error)
	Trailer() metadata.MD
	CloseSend() error
	SendHeader(metadata.MD) error
	SetTrailer(metadata.MD)
	grpc.Stream
}

StreamingBytesRelayer represents both generated Clients and servers for streams of *google_protobuf.BytesValue.

func NewStreamingBytesRelayer

func NewStreamingBytesRelayer(ctx context.Context) StreamingBytesRelayer

NewStreamingBytesRelayer returns a new StreamingBytesRelayer for the context.Context.

type StreamingBytesServeCloser

type StreamingBytesServeCloser interface {
	StreamingBytesServer
	CloseSend() error
}

StreamingBytesServeCloser is a StreamingBytesServer with close.

type StreamingBytesServer

type StreamingBytesServer interface {
	Send(bytesValue *google_protobuf.BytesValue) error
}

StreamingBytesServer represents a server for an rpc method of the form:

rpc Foo(Bar) returns (stream google.protobuf.BytesValue) {}

Jump to

Keyboard shortcuts

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