rpc

package
v0.3.0-rc1 Latest Latest
Warning

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

Go to latest
Published: May 25, 2022 License: Apache-2.0 Imports: 16 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 {
	Address string
	Port    string
}

func DefaultConfig

func DefaultConfig() Config

type Handler

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

func NewHandler

func NewHandler(state *state.Service, share *share.Service, header *header.Service) *Handler

func (*Handler) RegisterEndpoints

func (h *Handler) RegisterEndpoints(rpc *Server)

type NamespacedDataResponse

type NamespacedDataResponse struct {
	Data   [][]byte `json:"data"`
	Height uint64   `json:"height"`
}

NamespacedDataResponse represents the response to a DataByNamespace request.

type NamespacedSharesResponse

type NamespacedSharesResponse struct {
	Shares []share.Share `json:"shares"`
	Height uint64        `json:"height"`
}

NamespacedSharesResponse represents the response to a SharesByNamespace request.

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(cfg Config) *Server

NewServer returns a new RPC Server.

func (*Server) ListenAddr

func (s *Server) ListenAddr() string

ListenAddr returns the listen address of the server.

func (*Server) RegisterHandlerFunc

func (s *Server) RegisterHandlerFunc(pattern string, handlerFunc http.HandlerFunc, method string)

RegisterHandlerFunc registers the given http.HandlerFunc 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(context.Context) error

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

func (*Server) Stop

func (s *Server) Stop(context.Context) error

Stop stops the RPC Server.

Jump to

Keyboard shortcuts

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