calculatepool

package
v0.0.0-...-d924763 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2020 License: Apache-2.0 Imports: 12 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 {
	// contains filtered or unexported fields
}

Server define the server struct

func NewServer

func NewServer(port int) *Server

NewServer return an instance of the server

func (*Server) DoWork

func (s *Server) DoWork(req *restful.Request, resp *restful.Response)

DoWork assigns PoW to registered node

func (*Server) GetHard

func (s *Server) GetHard() int

GetHard get the difficilty

func (*Server) Hello

func (s *Server) Hello(req *restful.Request, resp *restful.Response)

Hello for testing if the service is alive

func (*Server) PoW

func (s *Server) PoW(req *restful.Request, resp *restful.Response)

PoW proof of work

func (*Server) Register

func (s *Server) Register(req *restful.Request, resp *restful.Response)

Register register the compute node

func (*Server) RegisterRoutes

func (s *Server) RegisterRoutes(route, method string, function func(*restful.Request, *restful.Response))

RegisterRoutes register routes to server

func (*Server) SetHard

func (s *Server) SetHard(hard int)

SetHard set the difficulty

func (*Server) Start

func (s *Server) Start()

Start run the server

Jump to

Keyboard shortcuts

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