micro-logger-service/micro/service_micro_rpc.pb.go

55 lines
1.5 KiB
Go
Raw Normal View History

// Code generated by protoc-gen-go-micro. DO NOT EDIT.
// protoc-gen-go-micro version: v3.5.3
// source: service.proto
package servicepb
import (
context "context"
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"
)
type loggerServiceClient struct {
c client.Client
name string
}
func NewLoggerServiceClient(name string, c client.Client) LoggerServiceClient {
return &loggerServiceClient{c: c, name: name}
}
func (c *loggerServiceClient) Log(ctx context.Context, req *proto.Message, opts ...client.CallOption) (*proto.Empty, error) {
rsp := &proto.Empty{}
err := c.c.Call(ctx, c.c.NewRequest(c.name, "LoggerService.Log", req), rsp, opts...)
if err != nil {
return nil, err
}
return rsp, nil
}
type loggerServiceServer struct {
LoggerServiceServer
}
func (h *loggerServiceServer) Log(ctx context.Context, req *proto.Message, rsp *proto.Empty) error {
return h.LoggerServiceServer.Log(ctx, req, rsp)
}
func RegisterLoggerServiceServer(s server.Server, sh LoggerServiceServer, opts ...server.HandlerOption) error {
type loggerService interface {
Log(ctx context.Context, req *proto.Message, rsp *proto.Empty) error
}
type LoggerService struct {
loggerService
}
h := &loggerServiceServer{sh}
var nopts []server.HandlerOption
for _, endpoint := range LoggerServiceEndpoints {
nopts = append(nopts, api.WithEndpoint(&endpoint))
}
return s.Handle(s.NewHandler(&LoggerService{h}, append(nopts, opts...)...))
}