123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260 |
- // Package v1 Code generated by go-common/app/tool/protoc-gen-bm. DO NOT EDIT.
- package v1
- import (
- "bytes"
- "context"
- "encoding/json"
- "go-common/app/tool/protoc-gen-bm/jsonpb"
- bm "go-common/library/net/http/blademaster"
- )
- // BMDapperQueryServer interface as same as gGRPC server define
- type BMDapperQueryServer interface {
- ListServiceName(context.Context, *ListServiceNameReq) (*ListServiceNameReply, error)
- ListOperationName(context.Context, *ListOperationNameReq) (*ListOperationNameReply, error)
- ListSpan(context.Context, *ListSpanReq) (*ListSpanReply, error)
- Trace(context.Context, *TraceReq) (*TraceReply, error)
- RawTrace(context.Context, *RawTraceReq) (*RawTraceReply, error)
- OperationNameRank(context.Context, *OperationNameRankReq) (*OperationNameRankReply, error)
- DependsRank(context.Context, *DependsRankReq) (*DependsRankReply, error)
- SpanSeries(context.Context, *SpanSeriesReq) (*SpanSeriesReply, error)
- SamplePoint(context.Context, *SamplePointReq) (*SamplePointReply, error)
- CltStatus(context.Context, *CltStatusReq) (*CltStatusReply, error)
- DependsTopology(context.Context, *DependsTopologyReq) (*DependsTopologyReply, error)
- OpsLog(context.Context, *OpsLogReq) (*OpsLogReply, error)
- ServiceDepend(context.Context, *ServiceDependReq) (*ServiceDependReply, error)
- }
- // _BMServerDapperQueryserver
- type _BMServerDapperQuery struct {
- BMDapperQueryServer
- }
- func (b *_BMServerDapperQuery) bmDapperQueryListServiceNameHandler(c *bm.Context) {
- req := new(ListServiceNameReq)
- if err := c.Bind(req); err != nil {
- return
- }
- reply, err := b.ListServiceName(c.Context, req)
- if err != nil {
- c.JSON(nil, err)
- return
- }
- body := &bytes.Buffer{}
- marshaler := jsonpb.Marshaler{EmitDefaults: true, OrigName: true}
- err = marshaler.Marshal(body, reply)
- c.JSON(json.RawMessage(body.Bytes()), err)
- }
- func (b *_BMServerDapperQuery) bmDapperQueryListOperationNameHandler(c *bm.Context) {
- req := new(ListOperationNameReq)
- if err := c.Bind(req); err != nil {
- return
- }
- reply, err := b.ListOperationName(c.Context, req)
- if err != nil {
- c.JSON(nil, err)
- return
- }
- body := &bytes.Buffer{}
- marshaler := jsonpb.Marshaler{EmitDefaults: true, OrigName: true}
- err = marshaler.Marshal(body, reply)
- c.JSON(json.RawMessage(body.Bytes()), err)
- }
- func (b *_BMServerDapperQuery) bmDapperQueryListSpanHandler(c *bm.Context) {
- req := new(ListSpanReq)
- if err := c.Bind(req); err != nil {
- return
- }
- reply, err := b.ListSpan(c.Context, req)
- if err != nil {
- c.JSON(nil, err)
- return
- }
- body := &bytes.Buffer{}
- marshaler := jsonpb.Marshaler{EmitDefaults: true, OrigName: true}
- err = marshaler.Marshal(body, reply)
- c.JSON(json.RawMessage(body.Bytes()), err)
- }
- func (b *_BMServerDapperQuery) bmDapperQueryTraceHandler(c *bm.Context) {
- req := new(TraceReq)
- if err := c.Bind(req); err != nil {
- return
- }
- reply, err := b.Trace(c.Context, req)
- if err != nil {
- c.JSON(nil, err)
- return
- }
- body := &bytes.Buffer{}
- marshaler := jsonpb.Marshaler{EmitDefaults: true, OrigName: true}
- err = marshaler.Marshal(body, reply)
- c.JSON(json.RawMessage(body.Bytes()), err)
- }
- func (b *_BMServerDapperQuery) bmDapperQueryRawTraceHandler(c *bm.Context) {
- req := new(RawTraceReq)
- if err := c.Bind(req); err != nil {
- return
- }
- reply, err := b.RawTrace(c.Context, req)
- if err != nil {
- c.JSON(nil, err)
- return
- }
- body := &bytes.Buffer{}
- marshaler := jsonpb.Marshaler{EmitDefaults: true, OrigName: true}
- err = marshaler.Marshal(body, reply)
- c.JSON(json.RawMessage(body.Bytes()), err)
- }
- func (b *_BMServerDapperQuery) bmDapperQueryOperationNameRankHandler(c *bm.Context) {
- req := new(OperationNameRankReq)
- if err := c.Bind(req); err != nil {
- return
- }
- reply, err := b.OperationNameRank(c.Context, req)
- if err != nil {
- c.JSON(nil, err)
- return
- }
- body := &bytes.Buffer{}
- marshaler := jsonpb.Marshaler{EmitDefaults: true, OrigName: true}
- err = marshaler.Marshal(body, reply)
- c.JSON(json.RawMessage(body.Bytes()), err)
- }
- func (b *_BMServerDapperQuery) bmDapperQueryDependsRankHandler(c *bm.Context) {
- req := new(DependsRankReq)
- if err := c.Bind(req); err != nil {
- return
- }
- reply, err := b.DependsRank(c.Context, req)
- if err != nil {
- c.JSON(nil, err)
- return
- }
- body := &bytes.Buffer{}
- marshaler := jsonpb.Marshaler{EmitDefaults: true, OrigName: true}
- err = marshaler.Marshal(body, reply)
- c.JSON(json.RawMessage(body.Bytes()), err)
- }
- func (b *_BMServerDapperQuery) bmDapperQuerySpanSeriesHandler(c *bm.Context) {
- req := new(SpanSeriesReq)
- if err := c.Bind(req); err != nil {
- return
- }
- reply, err := b.SpanSeries(c.Context, req)
- if err != nil {
- c.JSON(nil, err)
- return
- }
- body := &bytes.Buffer{}
- marshaler := jsonpb.Marshaler{EmitDefaults: true, OrigName: true}
- err = marshaler.Marshal(body, reply)
- c.JSON(json.RawMessage(body.Bytes()), err)
- }
- func (b *_BMServerDapperQuery) bmDapperQuerySamplePointHandler(c *bm.Context) {
- req := new(SamplePointReq)
- if err := c.Bind(req); err != nil {
- return
- }
- reply, err := b.SamplePoint(c.Context, req)
- if err != nil {
- c.JSON(nil, err)
- return
- }
- body := &bytes.Buffer{}
- marshaler := jsonpb.Marshaler{EmitDefaults: true, OrigName: true}
- err = marshaler.Marshal(body, reply)
- c.JSON(json.RawMessage(body.Bytes()), err)
- }
- func (b *_BMServerDapperQuery) bmDapperQueryCltStatusHandler(c *bm.Context) {
- req := new(CltStatusReq)
- if err := c.Bind(req); err != nil {
- return
- }
- reply, err := b.CltStatus(c.Context, req)
- if err != nil {
- c.JSON(nil, err)
- return
- }
- body := &bytes.Buffer{}
- marshaler := jsonpb.Marshaler{EmitDefaults: true, OrigName: true}
- err = marshaler.Marshal(body, reply)
- c.JSON(json.RawMessage(body.Bytes()), err)
- }
- func (b *_BMServerDapperQuery) bmDapperQueryDependsTopologyHandler(c *bm.Context) {
- req := new(DependsTopologyReq)
- if err := c.Bind(req); err != nil {
- return
- }
- reply, err := b.DependsTopology(c.Context, req)
- if err != nil {
- c.JSON(nil, err)
- return
- }
- body := &bytes.Buffer{}
- marshaler := jsonpb.Marshaler{EmitDefaults: true, OrigName: true}
- err = marshaler.Marshal(body, reply)
- c.JSON(json.RawMessage(body.Bytes()), err)
- }
- func (b *_BMServerDapperQuery) bmDapperQueryOpsLogHandler(c *bm.Context) {
- req := new(OpsLogReq)
- if err := c.Bind(req); err != nil {
- return
- }
- reply, err := b.OpsLog(c.Context, req)
- if err != nil {
- c.JSON(nil, err)
- return
- }
- body := &bytes.Buffer{}
- marshaler := jsonpb.Marshaler{EmitDefaults: true, OrigName: true}
- err = marshaler.Marshal(body, reply)
- c.JSON(json.RawMessage(body.Bytes()), err)
- }
- func (b *_BMServerDapperQuery) bmDapperQueryServiceDependHandler(c *bm.Context) {
- req := new(ServiceDependReq)
- if err := c.Bind(req); err != nil {
- return
- }
- reply, err := b.ServiceDepend(c.Context, req)
- if err != nil {
- c.JSON(nil, err)
- return
- }
- body := &bytes.Buffer{}
- marshaler := jsonpb.Marshaler{EmitDefaults: true, OrigName: true}
- err = marshaler.Marshal(body, reply)
- c.JSON(json.RawMessage(body.Bytes()), err)
- }
- // RegisterDapperQueryBMServer register bm server
- func RegisterDapperQueryBMServer(e *bm.Engine, s BMDapperQueryServer) {
- bs := &_BMServerDapperQuery{s}
- e.GET("/x/internal/dapper/service-names", bs.bmDapperQueryListServiceNameHandler)
- e.GET("/x/internal/dapper/operation-names", bs.bmDapperQueryListOperationNameHandler)
- e.GET("/x/internal/dapper/list-span", bs.bmDapperQueryListSpanHandler)
- e.GET("/x/internal/dapper/trace", bs.bmDapperQueryTraceHandler)
- e.GET("/x/internal/dapper/raw-trace", bs.bmDapperQueryRawTraceHandler)
- e.GET("/x/internal/dapper/operation-names-rank", bs.bmDapperQueryOperationNameRankHandler)
- e.GET("/x/internal/dapper/depends-rank", bs.bmDapperQueryDependsRankHandler)
- e.GET("/x/internal/dapper/span-series", bs.bmDapperQuerySpanSeriesHandler)
- e.GET("/x/internal/dapper/sample-point", bs.bmDapperQuerySamplePointHandler)
- e.GET("/x/internal/dapper/clt-status", bs.bmDapperQueryCltStatusHandler)
- e.GET("/x/internal/dapper/depends-topology", bs.bmDapperQueryDependsTopologyHandler)
- e.GET("/x/internal/dapper/ops-log", bs.bmDapperQueryOpsLogHandler)
- e.GET("/x/internal/dapper/service-depend", bs.bmDapperQueryServiceDependHandler)
- }
|