update import paths
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
@@ -1,22 +1,30 @@
|
||||
// Code generated by protoc-gen-micro
|
||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||
// protoc-gen-go-micro version: v3.5.3
|
||||
// source: service.proto
|
||||
package service
|
||||
|
||||
package servicepb
|
||||
|
||||
import (
|
||||
context "context"
|
||||
proto "github.com/unistack-org/micro-logger-service/v3/proto"
|
||||
api "github.com/unistack-org/micro/v3/api"
|
||||
client "github.com/unistack-org/micro/v3/client"
|
||||
proto "go.unistack.org/micro-logger-service/v3/proto"
|
||||
api "go.unistack.org/micro/v3/api"
|
||||
client "go.unistack.org/micro/v3/client"
|
||||
)
|
||||
|
||||
func NewLoggerEndpoints() []*api.Endpoint {
|
||||
return []*api.Endpoint{}
|
||||
var (
|
||||
LoggerServiceName = "LoggerService"
|
||||
|
||||
LoggerServiceEndpoints = []api.Endpoint{}
|
||||
)
|
||||
|
||||
func NewLoggerServiceEndpoints() []api.Endpoint {
|
||||
return LoggerServiceEndpoints
|
||||
}
|
||||
|
||||
type LoggerClient interface {
|
||||
type LoggerServiceClient interface {
|
||||
Log(ctx context.Context, req *proto.Message, opts ...client.CallOption) (*proto.Empty, error)
|
||||
}
|
||||
|
||||
type LoggerServer interface {
|
||||
type LoggerServiceServer interface {
|
||||
Log(ctx context.Context, req *proto.Message, rsp *proto.Empty) error
|
||||
}
|
||||
|
@@ -1,51 +1,54 @@
|
||||
// Code generated by protoc-gen-micro
|
||||
// Code generated by protoc-gen-go-micro. DO NOT EDIT.
|
||||
// protoc-gen-go-micro version: v3.5.3
|
||||
// source: service.proto
|
||||
package service
|
||||
|
||||
package servicepb
|
||||
|
||||
import (
|
||||
context "context"
|
||||
proto "github.com/unistack-org/micro-logger-service/v3/proto"
|
||||
api "github.com/unistack-org/micro/v3/api"
|
||||
client "github.com/unistack-org/micro/v3/client"
|
||||
server "github.com/unistack-org/micro/v3/server"
|
||||
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 loggerClient struct {
|
||||
type loggerServiceClient struct {
|
||||
c client.Client
|
||||
name string
|
||||
}
|
||||
|
||||
func NewLoggerClient(name string, c client.Client) LoggerClient {
|
||||
return &loggerClient{c: c, name: name}
|
||||
func NewLoggerServiceClient(name string, c client.Client) LoggerServiceClient {
|
||||
return &loggerServiceClient{c: c, name: name}
|
||||
}
|
||||
|
||||
func (c *loggerClient) Log(ctx context.Context, req *proto.Message, opts ...client.CallOption) (*proto.Empty, error) {
|
||||
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, "Logger.Log", req), rsp, opts...)
|
||||
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 loggerServer struct {
|
||||
LoggerServer
|
||||
type loggerServiceServer struct {
|
||||
LoggerServiceServer
|
||||
}
|
||||
|
||||
func (h *loggerServer) Log(ctx context.Context, req *proto.Message, rsp *proto.Empty) error {
|
||||
return h.LoggerServer.Log(ctx, req, rsp)
|
||||
func (h *loggerServiceServer) Log(ctx context.Context, req *proto.Message, rsp *proto.Empty) error {
|
||||
return h.LoggerServiceServer.Log(ctx, req, rsp)
|
||||
}
|
||||
|
||||
func RegisterLoggerServer(s server.Server, sh LoggerServer, opts ...server.HandlerOption) error {
|
||||
type logger interface {
|
||||
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 Logger struct {
|
||||
logger
|
||||
type LoggerService struct {
|
||||
loggerService
|
||||
}
|
||||
h := &loggerServer{sh}
|
||||
for _, endpoint := range NewLoggerEndpoints() {
|
||||
opts = append(opts, api.WithEndpoint(endpoint))
|
||||
h := &loggerServiceServer{sh}
|
||||
var nopts []server.HandlerOption
|
||||
for _, endpoint := range LoggerServiceEndpoints {
|
||||
nopts = append(nopts, api.WithEndpoint(&endpoint))
|
||||
}
|
||||
return s.Handle(s.NewHandler(&Logger{h}, opts...))
|
||||
return s.Handle(s.NewHandler(&LoggerService{h}, append(nopts, opts...)...))
|
||||
}
|
||||
|
Reference in New Issue
Block a user