api.pb.bm.go 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. // Package v1 Code generated by go-common/app/tool/protoc-gen-bm. DO NOT EDIT.
  2. package v1
  3. import (
  4. "bytes"
  5. "context"
  6. "encoding/json"
  7. "go-common/app/tool/protoc-gen-bm/jsonpb"
  8. bm "go-common/library/net/http/blademaster"
  9. )
  10. // BMDapperQueryServer interface as same as gGRPC server define
  11. type BMDapperQueryServer interface {
  12. ListServiceName(context.Context, *ListServiceNameReq) (*ListServiceNameReply, error)
  13. ListOperationName(context.Context, *ListOperationNameReq) (*ListOperationNameReply, error)
  14. ListSpan(context.Context, *ListSpanReq) (*ListSpanReply, error)
  15. Trace(context.Context, *TraceReq) (*TraceReply, error)
  16. RawTrace(context.Context, *RawTraceReq) (*RawTraceReply, error)
  17. OperationNameRank(context.Context, *OperationNameRankReq) (*OperationNameRankReply, error)
  18. DependsRank(context.Context, *DependsRankReq) (*DependsRankReply, error)
  19. SpanSeries(context.Context, *SpanSeriesReq) (*SpanSeriesReply, error)
  20. SamplePoint(context.Context, *SamplePointReq) (*SamplePointReply, error)
  21. CltStatus(context.Context, *CltStatusReq) (*CltStatusReply, error)
  22. DependsTopology(context.Context, *DependsTopologyReq) (*DependsTopologyReply, error)
  23. OpsLog(context.Context, *OpsLogReq) (*OpsLogReply, error)
  24. ServiceDepend(context.Context, *ServiceDependReq) (*ServiceDependReply, error)
  25. }
  26. // _BMServerDapperQueryserver
  27. type _BMServerDapperQuery struct {
  28. BMDapperQueryServer
  29. }
  30. func (b *_BMServerDapperQuery) bmDapperQueryListServiceNameHandler(c *bm.Context) {
  31. req := new(ListServiceNameReq)
  32. if err := c.Bind(req); err != nil {
  33. return
  34. }
  35. reply, err := b.ListServiceName(c.Context, req)
  36. if err != nil {
  37. c.JSON(nil, err)
  38. return
  39. }
  40. body := &bytes.Buffer{}
  41. marshaler := jsonpb.Marshaler{EmitDefaults: true, OrigName: true}
  42. err = marshaler.Marshal(body, reply)
  43. c.JSON(json.RawMessage(body.Bytes()), err)
  44. }
  45. func (b *_BMServerDapperQuery) bmDapperQueryListOperationNameHandler(c *bm.Context) {
  46. req := new(ListOperationNameReq)
  47. if err := c.Bind(req); err != nil {
  48. return
  49. }
  50. reply, err := b.ListOperationName(c.Context, req)
  51. if err != nil {
  52. c.JSON(nil, err)
  53. return
  54. }
  55. body := &bytes.Buffer{}
  56. marshaler := jsonpb.Marshaler{EmitDefaults: true, OrigName: true}
  57. err = marshaler.Marshal(body, reply)
  58. c.JSON(json.RawMessage(body.Bytes()), err)
  59. }
  60. func (b *_BMServerDapperQuery) bmDapperQueryListSpanHandler(c *bm.Context) {
  61. req := new(ListSpanReq)
  62. if err := c.Bind(req); err != nil {
  63. return
  64. }
  65. reply, err := b.ListSpan(c.Context, req)
  66. if err != nil {
  67. c.JSON(nil, err)
  68. return
  69. }
  70. body := &bytes.Buffer{}
  71. marshaler := jsonpb.Marshaler{EmitDefaults: true, OrigName: true}
  72. err = marshaler.Marshal(body, reply)
  73. c.JSON(json.RawMessage(body.Bytes()), err)
  74. }
  75. func (b *_BMServerDapperQuery) bmDapperQueryTraceHandler(c *bm.Context) {
  76. req := new(TraceReq)
  77. if err := c.Bind(req); err != nil {
  78. return
  79. }
  80. reply, err := b.Trace(c.Context, req)
  81. if err != nil {
  82. c.JSON(nil, err)
  83. return
  84. }
  85. body := &bytes.Buffer{}
  86. marshaler := jsonpb.Marshaler{EmitDefaults: true, OrigName: true}
  87. err = marshaler.Marshal(body, reply)
  88. c.JSON(json.RawMessage(body.Bytes()), err)
  89. }
  90. func (b *_BMServerDapperQuery) bmDapperQueryRawTraceHandler(c *bm.Context) {
  91. req := new(RawTraceReq)
  92. if err := c.Bind(req); err != nil {
  93. return
  94. }
  95. reply, err := b.RawTrace(c.Context, req)
  96. if err != nil {
  97. c.JSON(nil, err)
  98. return
  99. }
  100. body := &bytes.Buffer{}
  101. marshaler := jsonpb.Marshaler{EmitDefaults: true, OrigName: true}
  102. err = marshaler.Marshal(body, reply)
  103. c.JSON(json.RawMessage(body.Bytes()), err)
  104. }
  105. func (b *_BMServerDapperQuery) bmDapperQueryOperationNameRankHandler(c *bm.Context) {
  106. req := new(OperationNameRankReq)
  107. if err := c.Bind(req); err != nil {
  108. return
  109. }
  110. reply, err := b.OperationNameRank(c.Context, req)
  111. if err != nil {
  112. c.JSON(nil, err)
  113. return
  114. }
  115. body := &bytes.Buffer{}
  116. marshaler := jsonpb.Marshaler{EmitDefaults: true, OrigName: true}
  117. err = marshaler.Marshal(body, reply)
  118. c.JSON(json.RawMessage(body.Bytes()), err)
  119. }
  120. func (b *_BMServerDapperQuery) bmDapperQueryDependsRankHandler(c *bm.Context) {
  121. req := new(DependsRankReq)
  122. if err := c.Bind(req); err != nil {
  123. return
  124. }
  125. reply, err := b.DependsRank(c.Context, req)
  126. if err != nil {
  127. c.JSON(nil, err)
  128. return
  129. }
  130. body := &bytes.Buffer{}
  131. marshaler := jsonpb.Marshaler{EmitDefaults: true, OrigName: true}
  132. err = marshaler.Marshal(body, reply)
  133. c.JSON(json.RawMessage(body.Bytes()), err)
  134. }
  135. func (b *_BMServerDapperQuery) bmDapperQuerySpanSeriesHandler(c *bm.Context) {
  136. req := new(SpanSeriesReq)
  137. if err := c.Bind(req); err != nil {
  138. return
  139. }
  140. reply, err := b.SpanSeries(c.Context, req)
  141. if err != nil {
  142. c.JSON(nil, err)
  143. return
  144. }
  145. body := &bytes.Buffer{}
  146. marshaler := jsonpb.Marshaler{EmitDefaults: true, OrigName: true}
  147. err = marshaler.Marshal(body, reply)
  148. c.JSON(json.RawMessage(body.Bytes()), err)
  149. }
  150. func (b *_BMServerDapperQuery) bmDapperQuerySamplePointHandler(c *bm.Context) {
  151. req := new(SamplePointReq)
  152. if err := c.Bind(req); err != nil {
  153. return
  154. }
  155. reply, err := b.SamplePoint(c.Context, req)
  156. if err != nil {
  157. c.JSON(nil, err)
  158. return
  159. }
  160. body := &bytes.Buffer{}
  161. marshaler := jsonpb.Marshaler{EmitDefaults: true, OrigName: true}
  162. err = marshaler.Marshal(body, reply)
  163. c.JSON(json.RawMessage(body.Bytes()), err)
  164. }
  165. func (b *_BMServerDapperQuery) bmDapperQueryCltStatusHandler(c *bm.Context) {
  166. req := new(CltStatusReq)
  167. if err := c.Bind(req); err != nil {
  168. return
  169. }
  170. reply, err := b.CltStatus(c.Context, req)
  171. if err != nil {
  172. c.JSON(nil, err)
  173. return
  174. }
  175. body := &bytes.Buffer{}
  176. marshaler := jsonpb.Marshaler{EmitDefaults: true, OrigName: true}
  177. err = marshaler.Marshal(body, reply)
  178. c.JSON(json.RawMessage(body.Bytes()), err)
  179. }
  180. func (b *_BMServerDapperQuery) bmDapperQueryDependsTopologyHandler(c *bm.Context) {
  181. req := new(DependsTopologyReq)
  182. if err := c.Bind(req); err != nil {
  183. return
  184. }
  185. reply, err := b.DependsTopology(c.Context, req)
  186. if err != nil {
  187. c.JSON(nil, err)
  188. return
  189. }
  190. body := &bytes.Buffer{}
  191. marshaler := jsonpb.Marshaler{EmitDefaults: true, OrigName: true}
  192. err = marshaler.Marshal(body, reply)
  193. c.JSON(json.RawMessage(body.Bytes()), err)
  194. }
  195. func (b *_BMServerDapperQuery) bmDapperQueryOpsLogHandler(c *bm.Context) {
  196. req := new(OpsLogReq)
  197. if err := c.Bind(req); err != nil {
  198. return
  199. }
  200. reply, err := b.OpsLog(c.Context, req)
  201. if err != nil {
  202. c.JSON(nil, err)
  203. return
  204. }
  205. body := &bytes.Buffer{}
  206. marshaler := jsonpb.Marshaler{EmitDefaults: true, OrigName: true}
  207. err = marshaler.Marshal(body, reply)
  208. c.JSON(json.RawMessage(body.Bytes()), err)
  209. }
  210. func (b *_BMServerDapperQuery) bmDapperQueryServiceDependHandler(c *bm.Context) {
  211. req := new(ServiceDependReq)
  212. if err := c.Bind(req); err != nil {
  213. return
  214. }
  215. reply, err := b.ServiceDepend(c.Context, req)
  216. if err != nil {
  217. c.JSON(nil, err)
  218. return
  219. }
  220. body := &bytes.Buffer{}
  221. marshaler := jsonpb.Marshaler{EmitDefaults: true, OrigName: true}
  222. err = marshaler.Marshal(body, reply)
  223. c.JSON(json.RawMessage(body.Bytes()), err)
  224. }
  225. // RegisterDapperQueryBMServer register bm server
  226. func RegisterDapperQueryBMServer(e *bm.Engine, s BMDapperQueryServer) {
  227. bs := &_BMServerDapperQuery{s}
  228. e.GET("/x/internal/dapper/service-names", bs.bmDapperQueryListServiceNameHandler)
  229. e.GET("/x/internal/dapper/operation-names", bs.bmDapperQueryListOperationNameHandler)
  230. e.GET("/x/internal/dapper/list-span", bs.bmDapperQueryListSpanHandler)
  231. e.GET("/x/internal/dapper/trace", bs.bmDapperQueryTraceHandler)
  232. e.GET("/x/internal/dapper/raw-trace", bs.bmDapperQueryRawTraceHandler)
  233. e.GET("/x/internal/dapper/operation-names-rank", bs.bmDapperQueryOperationNameRankHandler)
  234. e.GET("/x/internal/dapper/depends-rank", bs.bmDapperQueryDependsRankHandler)
  235. e.GET("/x/internal/dapper/span-series", bs.bmDapperQuerySpanSeriesHandler)
  236. e.GET("/x/internal/dapper/sample-point", bs.bmDapperQuerySamplePointHandler)
  237. e.GET("/x/internal/dapper/clt-status", bs.bmDapperQueryCltStatusHandler)
  238. e.GET("/x/internal/dapper/depends-topology", bs.bmDapperQueryDependsTopologyHandler)
  239. e.GET("/x/internal/dapper/ops-log", bs.bmDapperQueryOpsLogHandler)
  240. e.GET("/x/internal/dapper/service-depend", bs.bmDapperQueryServiceDependHandler)
  241. }