brpc

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func (*Client) ReadResponseMessage

func (c *Client) ReadResponseMessage(resp any, data []byte, ePubKey *bcrypt.NoisePublicKey, t int64) error

func (*Client) SetClientPrivateKey

func (c *Client) SetClientPrivateKey(pk bcrypt.NoisePrivateKey)

func (*Client) SetServerPublicKey

func (c *Client) SetServerPublicKey(pk bcrypt.NoisePublicKey)

func (*Client) WriteRequestMessage

func (c *Client) WriteRequestMessage(
	dst []byte, serviceName string, req any,
	ePubKeyOut *bcrypt.NoisePublicKey, tOut *int64,
) (dataOut []byte, err error)

type LogicError

type LogicError string

func (LogicError) Error

func (e LogicError) Error() string

type RpcClient

type RpcClient interface {
	Call(serviceName string, req any, resp any) error
	CallContext(ctx context.Context, serviceName string, req any, resp any) error
}

type Server

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

func NewServer

func NewServer() *Server

func (*Server) AddClientPublicKey

func (s *Server) AddClientPublicKey(pks ...bcrypt.NoisePublicKey)

func (*Server) ClearClientPublicKey

func (s *Server) ClearClientPublicKey()

func (*Server) Register

func (s *Server) Register(rcvr any) error

func (*Server) RegisterName

func (s *Server) RegisterName(name string, rcvr any) error

func (*Server) RemoveClientPublicKey

func (s *Server) RemoveClientPublicKey(pk bcrypt.NoisePublicKey)

func (*Server) ServeConn

func (s *Server) ServeConn(rw io.ReadWriter) error

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, req *http.Request)

func (*Server) ServeListener

func (s *Server) ServeListener(l net.Listener, connCallback func(net.Conn) error) error

func (*Server) SetServerPrivateKey

func (s *Server) SetServerPrivateKey(pk bcrypt.NoisePrivateKey)

Directories

Path Synopsis
example

Jump to

Keyboard shortcuts

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