local.go 454 B

12345678910111213141516171819202122232425
  1. package http
  2. import (
  3. "net/http"
  4. "go-common/library/log"
  5. bm "go-common/library/net/http/blademaster"
  6. )
  7. // ping check server ok.
  8. func ping(c *bm.Context) {
  9. var (
  10. err error
  11. )
  12. if err = confSvc.Ping(c); err != nil {
  13. log.Error("config service ping error(%v)", err)
  14. c.JSON(nil, err)
  15. http.Error(c.Writer, "", http.StatusServiceUnavailable)
  16. }
  17. }
  18. // register check server ok.
  19. func register(c *bm.Context) {
  20. c.JSON(map[string]struct{}{}, nil)
  21. }