2021-08-16 18:57:19 +03:00
|
|
|
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
|
|
|
// protoc-gen-go-micro version: v3.4.2
|
2021-03-23 17:00:02 +03:00
|
|
|
// source: handler.proto
|
2021-08-16 18:57:19 +03:00
|
|
|
|
2021-03-28 19:28:01 +03:00
|
|
|
package handler
|
2021-03-23 17:00:02 +03:00
|
|
|
|
|
|
|
import (
|
|
|
|
context "context"
|
|
|
|
api "github.com/unistack-org/micro/v3/api"
|
|
|
|
codec "github.com/unistack-org/micro/v3/codec"
|
|
|
|
server "github.com/unistack-org/micro/v3/server"
|
|
|
|
)
|
|
|
|
|
|
|
|
type meterServer struct {
|
|
|
|
MeterServer
|
|
|
|
}
|
|
|
|
|
2021-03-25 12:34:34 +03:00
|
|
|
func (h *meterServer) Metrics(ctx context.Context, req *codec.Frame, rsp *codec.Frame) error {
|
2021-03-23 17:00:02 +03:00
|
|
|
return h.MeterServer.Metrics(ctx, req, rsp)
|
|
|
|
}
|
|
|
|
|
|
|
|
func RegisterMeterServer(s server.Server, sh MeterServer, opts ...server.HandlerOption) error {
|
|
|
|
type meter interface {
|
2021-03-25 12:34:34 +03:00
|
|
|
Metrics(ctx context.Context, req *codec.Frame, rsp *codec.Frame) error
|
2021-03-23 17:00:02 +03:00
|
|
|
}
|
|
|
|
type Meter struct {
|
|
|
|
meter
|
|
|
|
}
|
|
|
|
h := &meterServer{sh}
|
2021-03-26 15:45:09 +03:00
|
|
|
var nopts []server.HandlerOption
|
2021-08-16 18:57:19 +03:00
|
|
|
for _, endpoint := range MeterEndpoints {
|
|
|
|
nopts = append(nopts, api.WithEndpoint(&endpoint))
|
2021-03-23 17:00:02 +03:00
|
|
|
}
|
2021-03-26 15:45:09 +03:00
|
|
|
return s.Handle(s.NewHandler(&Meter{h}, append(nopts, opts...)...))
|
2021-03-23 17:00:02 +03:00
|
|
|
}
|