Documentation ¶
Index ¶
- type Server
- func (s *Server) DoWork(req *restful.Request, resp *restful.Response)
- func (s *Server) GetHard() int
- func (s *Server) Hello(req *restful.Request, resp *restful.Response)
- func (s *Server) PoW(req *restful.Request, resp *restful.Response)
- func (s *Server) Register(req *restful.Request, resp *restful.Response)
- func (s *Server) RegisterRoutes(route, method string, function func(*restful.Request, *restful.Response))
- func (s *Server) SetHard(hard int)
- func (s *Server) Start()
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 (*Server) DoWork ¶
func (s *Server) DoWork(req *restful.Request, resp *restful.Response)
DoWork assigns PoW to registered node
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
Click to show internal directories.
Click to hide internal directories.