rpcenc

package
v0.1.18 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 15 Imported by: 0

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) Close

func (w *RPCReader) Close() error

func (*RPCReader) MustRedirect

func (w *RPCReader) MustRedirect() error

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

func (*RPCReader) Read

func (w *RPCReader) Read(p []byte) (int, error)

type ReaderStream

type ReaderStream struct {
	Type StreamType
	Info string
}

type StreamType

type StreamType string
const (
	Null       StreamType = "null"
	PushStream StreamType = "push"
)

Jump to

Keyboard shortcuts

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