Ejemplo n.º 1
0
func main() {
	r := gin.Default()

	//	r.Static("/assets", "assets")
	r.SetHTMLTemplate(html)

	r.GET("/", func(c *gin.Context) {
		sampleNode, err := master.LoadNode("example.com")
		gotools.PanicIf(err)

		m := make(map[string]int)
		m["k1"] = 7
		m["k2"] = 13

		//c.String(200, sampleNode.Dump())
		c.HTML(200, "page", gin.H{
			"dump":       sampleNode.Dump(),
			"identifier": sampleNode.Identifier,
			"m":          master.ReadNodeDirectory(),
		})
		//c.JSON(200, gin.H{"dump": sampleNode.Dump(), "identifier": sampleNode.Identifier})
	})

	r.GET("/info", func(c *gin.Context) {
		hostname, err := os.Hostname()
		if err != nil {
			c.String(500, err.Error())
		} else {
			c.String(200, hostname)
		}
	})

	r.Run("0.0.0.0:5812")
}
Ejemplo n.º 2
0
func main() {
	c := color.New(color.FgYellow)
	c.Println("[Manager::Main]\t\tStarted.")

	c.Println("[Manager::Main]\t\tVoodooDataPath: ", master.VoodooDataPath)

	fmt.Println("")
	/*	color.New(color.FgRed).Println(t.Files["memory_limit"])*/

	//	spew.Dump(t)
	sampleNode, err := master.LoadNode("random")
	gotools.PanicIf(err)

	for _, moduleString := range sampleNode.Modules {
		module := strings.Split(moduleString, "::")
		color.New(color.FgBlue).Print("Module:\t")
		color.New(color.FgHiBlue).Println(module)
	}
}