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 ReaderStream ¶
type ReaderStream struct { Type StreamType Info string }
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 StreamType ¶
type StreamType string
const ( Null StreamType = "null" PushStream StreamType = "push" HTTP StreamType = "http" )
Click to show internal directories.
Click to hide internal directories.