Documentation
¶
Index ¶
Constants ¶
View Source
const ( ServerPort = "8080" RootServerDir = "/chain/config" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
This struct handles socket connection to the hub
type CollectHandler ¶
Collect member infos and return nil until the amount of members is reached
type GenerateHandler ¶
Generate genesis if the amount of members is reached
type Hub ¶
type Hub struct {
// contains filtered or unexported fields
}
This struct handles multiple members socket to collect their infos and then send them back the output of the gathering (aka a genesis)
func NewHub ¶
func NewHub(collect CollectHandler, generate GenerateHandler, complete CompleteHandler) *Hub
Create a hub
func (*Hub) HandleConnection ¶
func (hub *Hub) HandleConnection(resp http.ResponseWriter, req *http.Request)
Handle a new member socket connection
type Member ¶
type Member struct {
// contains filtered or unexported fields
}
This struct handles socket connection in the Hub
type WebsocketHandler ¶
type WebsocketHandler func(resp http.ResponseWriter, req *http.Request)
Click to show internal directories.
Click to hide internal directories.