server

package
v0.90.0-pre Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2020 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	*http.Server
	// contains filtered or unexported fields
}

Server represents the JSON-RPC 2.0 server.

func New

func New(chain blockchainer.Blockchainer, conf rpc.Config, coreServer *network.Server, log *zap.Logger) Server

New creates a new Server struct.

func (*Server) Shutdown

func (s *Server) Shutdown() error

Shutdown overrides the http.Server Shutdown method.

func (*Server) Start

func (s *Server) Start(errChan chan error)

Start creates a new JSON-RPC server listening on the configured port.

func (*Server) WriteErrorResponse

func (s *Server) WriteErrorResponse(r *request.In, w http.ResponseWriter, err error)

WriteErrorResponse writes an error response to the ResponseWriter.

func (*Server) WriteResponse

func (s *Server) WriteResponse(r *request.In, w http.ResponseWriter, result interface{})

WriteResponse encodes the response and writes it to the ResponseWriter.

Jump to

Keyboard shortcuts

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