Documentation ¶
Index ¶
- type ReadStream
- type Result
- type Stream
- type WriteStream
- func NewCloserStream(stream WriteStream, f func(WriteStream)) WriteStream
- func NewDecodingStream(stream WriteStream, encoder func(interface{}, error) (interface{}, error)) WriteStream
- func NewEncodingStream(stream WriteStream, encoder func(interface{}, error) (interface{}, error)) WriteStream
- func NewNilStream() WriteStream
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ReadStream ¶
type ReadStream interface { // Receive receives the next result Receive() (Result, bool) // Drain drains the stream Drain() }
ReadStream is a state machine read stream
type Result ¶
type Result struct { Value interface{} Error error }
Result is a stream result
type Stream ¶
type Stream interface { ReadStream WriteStream }
Stream is a read/write stream
func NewBufferedStream ¶
func NewBufferedStream() Stream
NewBufferedStream returns a new buffered read/write stream
func NewChannelStream ¶
NewChannelStream returns a new channel-based stream
func NewUnaryStream ¶
func NewUnaryStream() Stream
NewUnaryStream returns a new read/write stream that expects one result
type WriteStream ¶
type WriteStream interface { // Send sends an output on the stream Send(out Result) // Result sends a result on the stream Result(value interface{}, err error) // Value sends a value on the stream Value(value interface{}) // Error sends an error on the stream Error(err error) // Close closes the stream Close() }
WriteStream is a state machine write stream
func NewCloserStream ¶
func NewCloserStream(stream WriteStream, f func(WriteStream)) WriteStream
NewCloserStream returns a new stream that runs a function on close
func NewDecodingStream ¶
func NewDecodingStream(stream WriteStream, encoder func(interface{}, error) (interface{}, error)) WriteStream
NewDecodingStream returns a new decoding stream
func NewEncodingStream ¶
func NewEncodingStream(stream WriteStream, encoder func(interface{}, error) (interface{}, error)) WriteStream
NewEncodingStream returns a new encoding stream
Click to show internal directories.
Click to hide internal directories.