Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrHasBody = errors.New("RPCReader has body, either already read from or from a client with no redirect support")
View Source
var ErrMustRedirect = errors.New("reader can't be read directly; marked as MustRedirect")
View Source
var Timeout = 30 * time.Second
Functions ¶
func ReaderParamDecoder ¶
func ReaderParamDecoder() (http.HandlerFunc, jsonrpc.ServerOption)
func ReaderParamEncoder ¶
func ReaderParamEncoder(addr string) jsonrpc.Option
Types ¶
type RPCReader ¶
type RPCReader struct {
// contains filtered or unexported fields
}
RPCReader watches the ReadCloser and closes the res channel when either: (1) the ReaderCloser fails on Read (including with a benign error like EOF), or (2) when Close is called.
Use it be notified of terminal states, in situations where a Read failure (or EOF) is considered a terminal state too (besides Close).
func (*RPCReader) MustRedirect ¶
MustRedirect marks the reader as required to be redirected. Will make local calls Read fail. MUST be called before this reader is used in any goroutine. If the reader can't be redirected will return ErrHasBody
type ReaderStream ¶
type ReaderStream struct { Type StreamType Info string }
type StreamType ¶
type StreamType string
const ( Null StreamType = "null" PushStream StreamType = "push" )
Click to show internal directories.
Click to hide internal directories.