Exemple #1
0
func wsStatus(c *Connection, args []string) {
	type stats struct {
		Peers      int
		Identities int
	}

	type hello struct {
		Version         string
		Mode            string
		Status          stats
		IdentityTimeout int64
	}

	wsJson(c, hello{Version, Mode, stats{plong.PeerCount(), plong.IdentityCount()}, PlongConfig.IdentityTimeout}, false)
}
Exemple #2
0
func routeStatus(res http.ResponseWriter, req *http.Request) {
	log_request(req)

	type stats struct {
		Peers      int
		Identities int
	}

	type hello struct {
		Version         string
		Mode            string
		Status          stats
		IdentityTimeout int64
	}

	respond(res, 200, hello{Version, Mode, stats{plong.PeerCount(), plong.IdentityCount()}, PlongConfig.IdentityTimeout})
}