stream

package
v0.0.0-...-49e5460 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StreamTest

func StreamTest(t *testing.T, c StreamPairCreator)

Types

type BrokenStream

type BrokenStream struct{}

BrokenStream means that the stream broke before we got the trailer. In practice this means that there was an interruption to the stream, meaning the results are not complete-- but all previously received results before the erorr are still valid they just don't constitute the full set of results

func (BrokenStream) Error

func (b BrokenStream) Error() string

type ClientStream

type ClientStream interface {
	Recv() (record.Record, error)
	// Close completes receiving of items
	Close() error
}

type ResultChunk

type ResultChunk struct {
	Results []record.Record `json:"results"`
	Error   string          `json:"error,omitempty"`
}

A chunk of results on the wire

type ServerStream

type ServerStream interface {
	// Methods to send items
	SendResult(record.Record) error
	SendError(error) error
	// Close completes sending of items-- no more items can be sent after Close() is called
	Close() error
}

type StreamPairCreator

type StreamPairCreator func(context.Context) (ServerStream, ClientStream)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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