Exemplo n.º 1
0
func mainPageHandler(w http.ResponseWriter, r *http.Request) {
	t, err := template.ParseFiles("./Templates/MainPage.html")
	if err != nil {
		devopsutil.Print(w, err.Error())
	}
	err = t.Execute(w, "")
	if err != nil {
		devopsutil.Print(w, err.Error())
	}
}
Exemplo n.º 2
0
func validateFileHandler(w http.ResponseWriter, r *http.Request) {
	devopsutil.Print(w, "=======================================================")
	err := devopsutil.ValidateFile(w, r.FormValue("fileName"))
	devopsutil.Print(w, "=======================================================")
	if err != nil {
		devopsutil.Print(w, err.Error())
	} else {
		devopsutil.Print(w, "File validation success")
	}
}
Exemplo n.º 3
0
func osCommandHandler(w http.ResponseWriter, r *http.Request) {

	cmd := strings.Split(r.FormValue("cmd"), " ")

	err := devopsutil.OScommand(w, cmd)

	if err != nil {
		devopsutil.Print(w, err.Error())
	} else {
		devopsutil.Print(w, "Command executed successfully")
	}
}