app_conf.bm.go 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // Code generated by protoc-gen-bm v0.1, DO NOT EDIT.
  2. // source: app_conf.proto
  3. /*
  4. Package v1 is a generated blademaster stub package.
  5. This code was generated with go-common/app/tool/bmgen/protoc-gen-bm v0.1.
  6. It is generated from these files:
  7. app_conf.proto
  8. */
  9. package v1
  10. import (
  11. "context"
  12. bm "go-common/library/net/http/blademaster"
  13. "go-common/library/net/http/blademaster/binding"
  14. )
  15. // to suppressed 'imported but not used warning'
  16. var _ *bm.Context
  17. var _ context.Context
  18. var _ binding.StructValidator
  19. var PathConfigGetConf = "/live.appinterface.v1.config/getConf"
  20. // ================
  21. // Config Interface
  22. // ================
  23. type ConfigBMServer interface {
  24. GetConf(ctx context.Context, req *GetConfReq) (resp *GetConfResp, err error)
  25. }
  26. var v1ConfigSvc ConfigBMServer
  27. func configGetConf(c *bm.Context) {
  28. p := new(GetConfReq)
  29. if err := c.BindWith(p, binding.Default(c.Request.Method, c.Request.Header.Get("Content-Type"))); err != nil {
  30. return
  31. }
  32. resp, err := v1ConfigSvc.GetConf(c, p)
  33. c.JSON(resp, err)
  34. }
  35. // RegisterV1ConfigService Register the blademaster route with middleware map
  36. // midMap is the middleware map, the key is defined in proto
  37. func RegisterV1ConfigService(e *bm.Engine, svc ConfigBMServer, midMap map[string]bm.HandlerFunc) {
  38. v1ConfigSvc = svc
  39. e.GET("/xlive/app-interface/v1/config/getConf", configGetConf)
  40. }
  41. // RegisterConfigBMServer Register the blademaster route
  42. func RegisterConfigBMServer(e *bm.Engine, server ConfigBMServer) {
  43. v1ConfigSvc = server
  44. e.GET("/live.appinterface.v1.config/getConf", configGetConf)
  45. }