rpc

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Acceptor

type Acceptor interface {
	Accept() (net.Conn, error)
}

Acceptor is a simplified version of net.Listener geared towards multiplexers. It accepts new connections.

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(opener Opener) *Client

func (*Client) Invoke

func (c *Client) Invoke(method string) (ClientStream, error)

type ClientStream

type ClientStream interface {
	Send(interface{}) error
	// TODO: Document that Receive returns io.EOF unmodified (so long as the
	// stream is closed on a message boundary) and add a test to ensure this.
	// Prompting (and potentially other code) relies on this to identify clean
	// termination.
	Receive(interface{}) error
	// Close closes the stream. It may be called concurrently with the Send and
	// Receive methods, which it will unblock.
	Close() error
}

type Handler

type Handler func(HandlerStream) error

type HandlerStream

type HandlerStream interface {
	Send(interface{}) error
	// TODO: Document that Receive returns io.EOF unmodified (so long as the
	// stream is closed on a message boundary) and add a test to ensure this.
	// There isn't any code currently relying on this behavior, but we should
	// keep it symmetric with ClientStream because it's useful for the same
	// reason.
	Receive(interface{}) error
}

type Opener

type Opener interface {
	Open() (net.Conn, error)
}

Opener opens new connections.

type RemoteError

type RemoteError struct {
	// contains filtered or unexported fields
}

func (*RemoteError) Error

func (e *RemoteError) Error() string

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer() *Server

func (*Server) Register

func (s *Server) Register(service Service)

func (*Server) Serve

func (s *Server) Serve(acceptor Acceptor) error

type Service

type Service interface {
	Methods() map[string]Handler
}

Jump to

Keyboard shortcuts

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