surpc

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2024 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCipherReader

func NewCipherReader(underlying io.Reader, iv []byte) io.Reader

func NewCipherWriter

func NewCipherWriter(underlying io.Writer, iv []byte) io.Writer

func NewClientCodec

func NewClientCodec(conn io.ReadWriteCloser, iv []byte) rpc.ClientCodec

func NewServerCodec

func NewServerCodec(conn io.ReadWriteCloser, iv []byte) rpc.ServerCodec

Types

type CipherRWC

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

func NewCipherRWC

func NewCipherRWC(underlying io.ReadWriteCloser, iv []byte) *CipherRWC

func (*CipherRWC) Close

func (c *CipherRWC) Close() error

func (*CipherRWC) Read

func (c *CipherRWC) Read(p []byte) (n int, err error)

func (*CipherRWC) Write

func (c *CipherRWC) Write(p []byte) (n int, err error)

type Client

type Client struct {
	URL    *url.URL
	Http   *http.Client
	Ws     *rpc.Client
	Secure bool
	// contains filtered or unexported fields
}

func NewClient

func NewClient(hostname string) (client *Client)

func (*Client) Call

func (c *Client) Call(serviceMethod string, reply any, args any) error

func (*Client) Close

func (c *Client) Close()

func (*Client) Next

func (c *Client) Next() (h http.Header, iv []byte)

func (*Client) Open

func (c *Client) Open(force bool) (*rpc.Client, error)

type RWC

type RWC struct {
	Reader io.Reader
	Writer io.Writer
	Closer io.Closer
}

func (*RWC) Close

func (c *RWC) Close() error

func (*RWC) Read

func (c *RWC) Read(p []byte) (n int, err error)

func (*RWC) Write

func (c *RWC) Write(p []byte) (n int, err error)

type Server

type Server struct {
	RpcServer  *rpc.Server
	HttpServer *http.Server
	Router     *mux.Router
	// contains filtered or unexported fields
}

func NewServer

func NewServer() (s *Server)

func (*Server) Authorize

func (s *Server) Authorize(w http.ResponseWriter, r *http.Request) (secure []byte, ok bool)

func (*Server) Close

func (s *Server) Close()

func (*Server) Listen

func (s *Server) Listen(address string) error

func (*Server) ListenAll

func (s *Server) ListenAll() (e error)

func (*Server) ListenTo

func (s *Server) ListenTo(network string, address string) error

func (*Server) Register

func (s *Server) Register(name string, receiver any) error

func (*Server) RpcHandler

func (s *Server) RpcHandler(w http.ResponseWriter, r *http.Request)

func (*Server) Serve

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

Jump to

Keyboard shortcuts

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