tcprpc

package module
v0.0.0-...-117c8a9 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2019 License: GPL-3.0 Imports: 16 Imported by: 20

README

godoc Build Status

tcprpc

tcprpc is an RPC framework and protobuf service generator. It's a part of qdp project. You only need this to have plutos system compiled successfully.

It's designed to be simple, lightwait and optimized for lots of parallel requests. It uses protobuf encoded requests and responses over raw tcp connection.

If you are looking for some general purpose RPC framework you'd better to use gRPC

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrConnClosed = errors.New("connection closed")
View Source
var ErrSingleListenerEOF = errors.New("single listener: EOF")

Functions

func RegisterHostnameHandler

func RegisterHostnameHandler()

func SetDialer

func SetDialer(d Dialer)

Types

type BufConn

type BufConn struct {
	*bufio.Reader
	net.Conn
}

func BufferConnection

func BufferConnection(c net.Conn) BufConn

func (BufConn) Read

func (b BufConn) Read(p []byte) (int, error)

type Client

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

func NewClient

func NewClient(addr string) *Client

func (*Client) Addr

func (c *Client) Addr() string

func (*Client) Call

func (c *Client) Call(ctx context.Context, meth string, args, reply interface{}) error

func (*Client) Close

func (c *Client) Close() error

type Dialer

type Dialer func(net, addr string) (net.Conn, error)

type Handler

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

func NewHandler

func NewHandler(alloc func() proto.Message, process func(context.Context, proto.Message) (proto.Message, error)) Handler

type Peeker

type Peeker interface {
	Peek(int) ([]byte, error)
}

type Reader

type Reader interface {
	io.Reader
	io.ByteReader
}

type Server

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

func NewServer

func NewServer() *Server

func (*Server) Close

func (s *Server) Close() error

func (*Server) Handle

func (s *Server) Handle(meth string, h Handler)

func (*Server) HandleHTTP

func (s *Server) HandleHTTP(h http.Handler)

func (*Server) Serve

func (s *Server) Serve(l net.Listener) error

func (*Server) Shutdown

func (s *Server) Shutdown() error

type SingleListener

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

func (*SingleListener) Accept

func (l *SingleListener) Accept() (net.Conn, error)

func (*SingleListener) Addr

func (l *SingleListener) Addr() net.Addr

func (*SingleListener) Close

func (l *SingleListener) Close() error

Directories

Path Synopsis
cmd
Package tcprpcpb is a generated protocol buffer package.
Package tcprpcpb is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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