http.go 554 B

123456789101112131415161718192021222324252627
  1. package http
  2. import (
  3. "go-common/app/job/main/archive/conf"
  4. "go-common/app/job/main/archive/service"
  5. "go-common/library/log"
  6. bm "go-common/library/net/http/blademaster"
  7. )
  8. // Init init http router.
  9. func Init(c *conf.Config, s *service.Service) {
  10. e := bm.DefaultServer(c.BM)
  11. innerRouter(e)
  12. // init internal server
  13. if err := e.Start(); err != nil {
  14. log.Error("xhttp.Serve error(%v)", err)
  15. panic(err)
  16. }
  17. }
  18. // innerRouter init inner router.
  19. func innerRouter(e *bm.Engine) {
  20. e.Ping(ping)
  21. }
  22. // ping check server ok.
  23. func ping(c *bm.Context) {}