github.com/tickoalcantara12/micro/v3@v3.0.0-20221007104245-9d75b9bcbab9/proto/alert/alert.pb.micro.go (about) 1 // Code generated by protoc-gen-micro. DO NOT EDIT. 2 // source: alert.proto 3 4 package alert 5 6 import ( 7 fmt "fmt" 8 proto "github.com/golang/protobuf/proto" 9 math "math" 10 ) 11 12 import ( 13 context "context" 14 api "github.com/tickoalcantara12/micro/v3/service/api" 15 client "github.com/tickoalcantara12/micro/v3/service/client" 16 server "github.com/tickoalcantara12/micro/v3/service/server" 17 ) 18 19 // Reference imports to suppress errors if they are not otherwise used. 20 var _ = proto.Marshal 21 var _ = fmt.Errorf 22 var _ = math.Inf 23 24 // This is a compile-time assertion to ensure that this generated file 25 // is compatible with the proto package it is being compiled against. 26 // A compilation error at this line likely means your copy of the 27 // proto package needs to be updated. 28 const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package 29 30 // Reference imports to suppress errors if they are not otherwise used. 31 var _ api.Endpoint 32 var _ context.Context 33 var _ client.Option 34 var _ server.Option 35 36 // Api Endpoints for Alert service 37 38 func NewAlertEndpoints() []*api.Endpoint { 39 return []*api.Endpoint{} 40 } 41 42 // Client API for Alert service 43 44 type AlertService interface { 45 // ReportEvent does event ingestions. 46 ReportEvent(ctx context.Context, in *ReportEventRequest, opts ...client.CallOption) (*ReportEventResponse, error) 47 } 48 49 type alertService struct { 50 c client.Client 51 name string 52 } 53 54 func NewAlertService(name string, c client.Client) AlertService { 55 return &alertService{ 56 c: c, 57 name: name, 58 } 59 } 60 61 func (c *alertService) ReportEvent(ctx context.Context, in *ReportEventRequest, opts ...client.CallOption) (*ReportEventResponse, error) { 62 req := c.c.NewRequest(c.name, "Alert.ReportEvent", in) 63 out := new(ReportEventResponse) 64 err := c.c.Call(ctx, req, out, opts...) 65 if err != nil { 66 return nil, err 67 } 68 return out, nil 69 } 70 71 // Server API for Alert service 72 73 type AlertHandler interface { 74 // ReportEvent does event ingestions. 75 ReportEvent(context.Context, *ReportEventRequest, *ReportEventResponse) error 76 } 77 78 func RegisterAlertHandler(s server.Server, hdlr AlertHandler, opts ...server.HandlerOption) error { 79 type alert interface { 80 ReportEvent(ctx context.Context, in *ReportEventRequest, out *ReportEventResponse) error 81 } 82 type Alert struct { 83 alert 84 } 85 h := &alertHandler{hdlr} 86 return s.Handle(s.NewHandler(&Alert{h}, opts...)) 87 } 88 89 type alertHandler struct { 90 AlertHandler 91 } 92 93 func (h *alertHandler) ReportEvent(ctx context.Context, in *ReportEventRequest, out *ReportEventResponse) error { 94 return h.AlertHandler.ReportEvent(ctx, in, out) 95 }