rpc

package
v0.2.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ListenAddr string
}

func DefaultConfig

func DefaultConfig() Config

type Server

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

Server represents an RPC server on the Node. TODO @renaynay: eventually, rpc server should be able to be toggled on and off.

func NewServer

func NewServer() *Server

NewServer returns a new RPC Server.

func (*Server) RegisterHandler

func (s *Server) RegisterHandler(pattern string, handler http.Handler)

RegisterHandler registers the given handler on the Server's multiplexer on the given pattern.

func (*Server) ServeHTTP

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

ServeHTTP serves inbound requests on the Server.

func (*Server) Start

func (s *Server) Start(listenAddr string) error

Start starts the RPC Server, listening on the given address.

func (*Server) Stop

func (s *Server) Stop() error

Stop stops the RPC Server.

Jump to

Keyboard shortcuts

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