Documentation
¶
Overview ¶
Package iorpc provides a way to serve and access io package interface implementations such as io.Reader over a net/rpc connection. The implementation strives for correctness over performance. For example, with the io.Reader implementation, if you request to Read one byte, it will perform a full RPC request/response to read only a single byte.
Accessing io implementations across the network can be extremely useful in certain environments. And, if used properly, can be performant as well.
Index ¶
- func RegisterReader(server *rpc.Server, r io.Reader) error
- func RegisterReaderName(s *rpc.Server, name string, r io.Reader) error
- func RegisterWriter(server *rpc.Server, r io.Writer) error
- func RegisterWriterName(s *rpc.Server, name string, r io.Writer) error
- type Reader
- type ReaderServer
- type Writer
- type WriterServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterReader ¶
RegisterReader registers the io.Reader on the RPC server.
func RegisterReaderName ¶
RegisterReaderName registers the io.Reader on the RPC server with the given type name instead of the default inferred type name.
func RegisterWriter ¶
RegisterWriter registers the io.Writer on the RPC server.
Types ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader is an implementation of io.Reader that performs its operations across an RPC connection.
func NewReaderName ¶
NewReaderName returns a new Reader that communicates with the given RPC client using name as the type name for the remote ReaderServer in RPC calls.
type ReaderServer ¶
type ReaderServer struct {
// contains filtered or unexported fields
}
ReaderServer wraps an io.Reader and serves it across an RPC connection. The ReaderServer can be accessed by a Reader.
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer is an implementation of io.Writer that performs its operations across an RPC connection.
func NewWriterName ¶
NewWriterName returns a new Writer that communicates with the given RPC client using name as the type name for the remote WriterServer in RPC calls.
type WriterServer ¶
type WriterServer struct {
// contains filtered or unexported fields
}
WriterServer wraps a io.Writer and serves it across an RPC connection. The WriterServer can be accessed using an RPC client and Writer. Use RegisterWriter and RegisterWriterName to serve a writer from your RPC server.