// 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) }