regen with never protoc-gen-go
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
@@ -1,13 +1,12 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0-devel
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc v3.6.1
|
||||
// source: service.proto
|
||||
|
||||
package service
|
||||
|
||||
import (
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
@@ -21,10 +20,6 @@ const (
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// This is a compile-time assertion that a sufficiently up-to-date version
|
||||
// of the legacy proto package is being used.
|
||||
const _ = proto.ProtoPackageIsVersion4
|
||||
|
||||
type LoadRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
@@ -234,11 +229,11 @@ var file_service_proto_rawDesc = []byte{
|
||||
0x61, 0x76, 0x65, 0x12, 0x14, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x61,
|
||||
0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x73, 0x65, 0x72, 0x76,
|
||||
0x69, 0x63, 0x65, 0x2e, 0x53, 0x61, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||
0x22, 0x00, 0x42, 0x36, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
|
||||
0x22, 0x00, 0x42, 0x3f, 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
|
||||
0x2f, 0x75, 0x6e, 0x69, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2d, 0x6f, 0x72, 0x67, 0x2f, 0x6d, 0x69,
|
||||
0x63, 0x72, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x69,
|
||||
0x63, 0x65, 0x3b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x33,
|
||||
0x63, 0x65, 0x2f, 0x76, 0x33, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x3b, 0x73, 0x65, 0x72, 0x76,
|
||||
0x69, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
@@ -1,7 +1,7 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package service;
|
||||
option go_package="github.com/unistack-org/micro-config-service;service";
|
||||
option go_package="github.com/unistack-org/micro-config-service/v3/proto;service";
|
||||
|
||||
service Config {
|
||||
rpc Load(LoadRequest) returns (LoadResponse) {};
|
||||
|
@@ -11,7 +11,8 @@ import (
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
const _ = grpc.SupportPackageIsVersion6
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
// ConfigClient is the client API for Config service.
|
||||
//
|
||||
@@ -60,16 +61,23 @@ type ConfigServer interface {
|
||||
type UnimplementedConfigServer struct {
|
||||
}
|
||||
|
||||
func (*UnimplementedConfigServer) Load(context.Context, *LoadRequest) (*LoadResponse, error) {
|
||||
func (UnimplementedConfigServer) Load(context.Context, *LoadRequest) (*LoadResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Load not implemented")
|
||||
}
|
||||
func (*UnimplementedConfigServer) Save(context.Context, *SaveRequest) (*SaveResponse, error) {
|
||||
func (UnimplementedConfigServer) Save(context.Context, *SaveRequest) (*SaveResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Save not implemented")
|
||||
}
|
||||
func (*UnimplementedConfigServer) mustEmbedUnimplementedConfigServer() {}
|
||||
func (UnimplementedConfigServer) mustEmbedUnimplementedConfigServer() {}
|
||||
|
||||
func RegisterConfigServer(s *grpc.Server, srv ConfigServer) {
|
||||
s.RegisterService(&_Config_serviceDesc, srv)
|
||||
// UnsafeConfigServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to ConfigServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeConfigServer interface {
|
||||
mustEmbedUnimplementedConfigServer()
|
||||
}
|
||||
|
||||
func RegisterConfigServer(s grpc.ServiceRegistrar, srv ConfigServer) {
|
||||
s.RegisterService(&Config_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _Config_Load_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
@@ -108,7 +116,10 @@ func _Config_Save_Handler(srv interface{}, ctx context.Context, dec func(interfa
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
var _Config_serviceDesc = grpc.ServiceDesc{
|
||||
// Config_ServiceDesc is the grpc.ServiceDesc for Config service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var Config_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "service.Config",
|
||||
HandlerType: (*ConfigServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
|
@@ -1,47 +0,0 @@
|
||||
// Code generated by protoc-gen-micro
|
||||
// source: service.proto
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
micro_api "github.com/unistack-org/micro/v3/api"
|
||||
micro_client "github.com/unistack-org/micro/v3/client"
|
||||
micro_server "github.com/unistack-org/micro/v3/server"
|
||||
)
|
||||
|
||||
// NewConfigEndpoints provides api endpoints metdata for Config service
|
||||
func NewConfigEndpoints() []*micro_api.Endpoint {
|
||||
var endpoints []*micro_api.Endpoint
|
||||
return endpoints
|
||||
}
|
||||
|
||||
// ConfigService interface
|
||||
type ConfigService interface {
|
||||
Load(context.Context, *LoadRequest, ...micro_client.CallOption) (*LoadResponse, error)
|
||||
Save(context.Context, *SaveRequest, ...micro_client.CallOption) (*SaveResponse, error)
|
||||
}
|
||||
|
||||
// Micro server stuff
|
||||
|
||||
// ConfigHandler server handler
|
||||
type ConfigHandler interface {
|
||||
Load(context.Context, *LoadRequest, *LoadResponse) error
|
||||
Save(context.Context, *SaveRequest, *SaveResponse) error
|
||||
}
|
||||
|
||||
// RegisterConfigHandler registers server handler
|
||||
func RegisterConfigHandler(s micro_server.Server, sh ConfigHandler, opts ...micro_server.HandlerOption) error {
|
||||
type config interface {
|
||||
Load(context.Context, *LoadRequest, *LoadResponse) error
|
||||
Save(context.Context, *SaveRequest, *SaveResponse) error
|
||||
}
|
||||
type Config struct {
|
||||
config
|
||||
}
|
||||
h := &configHandler{sh}
|
||||
for _, endpoint := range NewConfigEndpoints() {
|
||||
opts = append(opts, micro_api.WithEndpoint(endpoint))
|
||||
}
|
||||
return s.Handle(s.NewHandler(&Config{h}, opts...))
|
||||
}
|
@@ -1,58 +0,0 @@
|
||||
// Code generated by protoc-gen-micro
|
||||
// source: service.proto
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
micro_client "github.com/unistack-org/micro/v3/client"
|
||||
micro_server "github.com/unistack-org/micro/v3/server"
|
||||
)
|
||||
|
||||
var (
|
||||
_ micro_server.Option
|
||||
_ micro_client.Option
|
||||
)
|
||||
|
||||
type configService struct {
|
||||
c micro_client.Client
|
||||
name string
|
||||
}
|
||||
|
||||
// Micro client stuff
|
||||
|
||||
// NewConfigService create new service client
|
||||
func NewConfigService(name string, c micro_client.Client) ConfigService {
|
||||
return &configService{c: c, name: name}
|
||||
}
|
||||
|
||||
func (c *configService) Load(ctx context.Context, req *LoadRequest, opts ...micro_client.CallOption) (*LoadResponse, error) {
|
||||
rsp := &LoadResponse{}
|
||||
err := c.c.Call(ctx, c.c.NewRequest(c.name, "Config.Load", req), rsp, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rsp, nil
|
||||
}
|
||||
func (c *configService) Save(ctx context.Context, req *SaveRequest, opts ...micro_client.CallOption) (*SaveResponse, error) {
|
||||
rsp := &SaveResponse{}
|
||||
err := c.c.Call(ctx, c.c.NewRequest(c.name, "Config.Save", req), rsp, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rsp, nil
|
||||
}
|
||||
|
||||
// Micro server stuff
|
||||
|
||||
type configHandler struct {
|
||||
ConfigHandler
|
||||
}
|
||||
|
||||
func (h *configHandler) Load(ctx context.Context, req *LoadRequest, rsp *LoadResponse) error {
|
||||
return h.ConfigHandler.Load(ctx, req, rsp)
|
||||
}
|
||||
|
||||
func (h *configHandler) Save(ctx context.Context, req *SaveRequest, rsp *SaveResponse) error {
|
||||
return h.ConfigHandler.Save(ctx, req, rsp)
|
||||
}
|
Reference in New Issue
Block a user