module_index.go 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. package modules
  2. import (
  3. "fmt"
  4. "net/http"
  5. "golang-fave/engine/wrapper"
  6. )
  7. func (this *Modules) RegisterModule_Index() *Module {
  8. return this.newModule(false, "index", "Pages", func(wrap *wrapper.Wrapper) {
  9. //fmt.Printf("FrontEnd func call\n")
  10. wrap.W.WriteHeader(http.StatusOK)
  11. wrap.W.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
  12. wrap.W.Header().Set("Content-Type", "text/html; charset=utf-8")
  13. wrap.W.Write([]byte(`FrontEnd func call`))
  14. }, func(wrap *wrapper.Wrapper) {
  15. //fmt.Printf("BackEnd func call\n")
  16. wrap.W.WriteHeader(http.StatusOK)
  17. wrap.W.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
  18. wrap.W.Header().Set("Content-Type", "text/html; charset=utf-8")
  19. wrap.W.Write([]byte(`BackEnd func call`))
  20. })
  21. }
  22. func (this *Modules) RegisterAction_MysqlSetup() *Action {
  23. return this.newAction(false, "mysql", func(wrap *wrapper.Wrapper) {
  24. fmt.Printf("ActFunc func call\n")
  25. })
  26. }
  27. // All actions here...
  28. // MySQL install
  29. // MySQL first user
  30. // User login
  31. // User logout