2021-10-28 00:36:45 +03:00
|
|
|
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
|
|
|
// protoc-gen-go-micro version: v3.5.3
|
2021-03-22 09:48:12 +03:00
|
|
|
// source: service.proto
|
2021-10-28 00:36:45 +03:00
|
|
|
|
|
|
|
package servicepb
|
2021-03-22 09:48:12 +03:00
|
|
|
|
|
|
|
import (
|
|
|
|
context "context"
|
2021-10-28 00:36:45 +03:00
|
|
|
proto "go.unistack.org/micro-logger-service/v3/proto"
|
|
|
|
api "go.unistack.org/micro/v3/api"
|
|
|
|
client "go.unistack.org/micro/v3/client"
|
|
|
|
server "go.unistack.org/micro/v3/server"
|
2021-03-22 09:48:12 +03:00
|
|
|
)
|
|
|
|
|
2021-10-28 00:36:45 +03:00
|
|
|
type loggerServiceClient struct {
|
2021-03-22 09:48:12 +03:00
|
|
|
c client.Client
|
|
|
|
name string
|
|
|
|
}
|
|
|
|
|
2021-10-28 00:36:45 +03:00
|
|
|
func NewLoggerServiceClient(name string, c client.Client) LoggerServiceClient {
|
|
|
|
return &loggerServiceClient{c: c, name: name}
|
2021-03-22 09:48:12 +03:00
|
|
|
}
|
|
|
|
|
2022-03-13 11:34:39 +03:00
|
|
|
func (c *loggerServiceClient) Log(ctx context.Context, req *proto.LogReq, opts ...client.CallOption) (*proto.LogRsp, error) {
|
|
|
|
rsp := &proto.LogRsp{}
|
2021-10-28 00:36:45 +03:00
|
|
|
err := c.c.Call(ctx, c.c.NewRequest(c.name, "LoggerService.Log", req), rsp, opts...)
|
2021-03-22 09:48:12 +03:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return rsp, nil
|
|
|
|
}
|
|
|
|
|
2021-10-28 00:36:45 +03:00
|
|
|
type loggerServiceServer struct {
|
|
|
|
LoggerServiceServer
|
2021-03-22 09:48:12 +03:00
|
|
|
}
|
|
|
|
|
2022-03-13 11:34:39 +03:00
|
|
|
func (h *loggerServiceServer) Log(ctx context.Context, req *proto.LogReq, rsp *proto.LogRsp) error {
|
2021-10-28 00:36:45 +03:00
|
|
|
return h.LoggerServiceServer.Log(ctx, req, rsp)
|
2021-03-22 09:48:12 +03:00
|
|
|
}
|
|
|
|
|
2021-10-28 00:36:45 +03:00
|
|
|
func RegisterLoggerServiceServer(s server.Server, sh LoggerServiceServer, opts ...server.HandlerOption) error {
|
|
|
|
type loggerService interface {
|
2022-03-13 11:34:39 +03:00
|
|
|
Log(ctx context.Context, req *proto.LogReq, rsp *proto.LogRsp) error
|
2021-03-22 09:48:12 +03:00
|
|
|
}
|
2021-10-28 00:36:45 +03:00
|
|
|
type LoggerService struct {
|
|
|
|
loggerService
|
2021-03-22 09:48:12 +03:00
|
|
|
}
|
2021-10-28 00:36:45 +03:00
|
|
|
h := &loggerServiceServer{sh}
|
|
|
|
var nopts []server.HandlerOption
|
|
|
|
for _, endpoint := range LoggerServiceEndpoints {
|
|
|
|
nopts = append(nopts, api.WithEndpoint(&endpoint))
|
2021-03-22 09:48:12 +03:00
|
|
|
}
|
2021-10-28 00:36:45 +03:00
|
|
|
return s.Handle(s.NewHandler(&LoggerService{h}, append(nopts, opts...)...))
|
2021-03-22 09:48:12 +03:00
|
|
|
}
|