Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RPC ¶
type RPC struct {
// contains filtered or unexported fields
}
func NewRPC ¶
func NewRPC(writer io.WriteCloser, reader io.Reader, logger *zap.SugaredLogger) *RPC
NewRPC creates and returns an RPC instance
func (*RPC) Call ¶
func (r *RPC) Call(method string, params json.RawMessage) (json.RawMessage, error)
Call sends a request with given parameters. Returns the Response.Result or an error.
Two different kinds of error can be returned:
- rpc.Error: Communication failed and future calls on this instance won't work and a new *RPC has to be created.
- Response.Error: The response contains an error (that's non-fatal for the RPC object).
func (*RPC) Close ¶
Close closes the RPC.writer. All further calls to Call lead to an error. The Process will be terminated as soon as all pending requests have been processed.
Click to show internal directories.
Click to hide internal directories.