grpcutil

package
v1.3.9-279552a1d4fd1f5... Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2017 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrMustSpecifyRegisterFunc is used when a register func is nil.
	ErrMustSpecifyRegisterFunc = errors.New("must specify registerFunc")
)

Functions

func NewStreamingBytesReader added in v1.3.5

func NewStreamingBytesReader(streamingBytesClient StreamingBytesClient) io.Reader

NewStreamingBytesReader returns an io.Reader for a StreamingBytesClient.

func NewStreamingBytesWriter added in v1.3.5

func NewStreamingBytesWriter(streamingBytesServer StreamingBytesServer) io.Writer

NewStreamingBytesWriter returns an io.Writer for a StreamingBytesServer.

func Serve added in v1.3.5

func Serve(
	registerFunc func(*grpc.Server),
	options ServeOptions,
	serveEnv ServeEnv,
) (retErr error)

Serve serves stuff.

func WriteFromStreamingBytesClient added in v1.3.5

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

WriteFromStreamingBytesClient writes from the StreamingBytesClient to the io.Writer.

func WriteToStreamingBytesServer added in v1.3.5

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

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

Types

type Dialer

type Dialer interface {
	Dial(address string) (*grpc.ClientConn, error)
	CloseConns() error
}

Dialer defines a grpc.ClientConn connection dialer.

func NewDialer

func NewDialer(opts ...grpc.DialOption) Dialer

NewDialer creates a Dialer.

type ServeEnv added in v1.3.5

type ServeEnv struct {
	// Default is 7070.
	GRPCPort uint16 `env:"GRPC_PORT,default=7070"`
}

ServeEnv are environment variables for serving.

type ServeOptions added in v1.3.5

type ServeOptions struct {
	Version    *versionpb.Version
	MaxMsgSize int
}

ServeOptions represent optional fields for serving.

type StreamingBytesClient added in v1.3.5

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

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

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

type StreamingBytesServer added in v1.3.5

type StreamingBytesServer interface {
	Send(bytesValue *types.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