rpcenc

package
v1.20.3-hyperspace-nv21 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: Apache-2.0, MIT Imports: 20 Imported by: 8

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 added in v1.11.2

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 added in v1.11.2

func (w *RpcReader) Close() error

func (*RpcReader) MustRedirect added in v1.11.2

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 added in v1.11.2

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

type StreamType

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

Jump to

Keyboard shortcuts

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