move to micro v4
All checks were successful
test / test (push) Successful in 3m27s

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2025-03-07 12:52:22 +03:00
parent d6b0f1feb1
commit e1b73741be
9 changed files with 110 additions and 65 deletions

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.26.0
// protoc v3.21.12
// protoc v5.29.3
// source: service.proto
package servicepb
@@ -231,7 +231,7 @@ var file_service_proto_rawDesc = []byte{
0x69, 0x63, 0x65, 0x2e, 0x53, 0x61, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x22, 0x00, 0x42, 0x39, 0x5a, 0x37, 0x67, 0x6f, 0x2e, 0x75, 0x6e, 0x69, 0x73, 0x74, 0x61, 0x63,
0x6b, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x66,
0x69, 0x67, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, 0x33, 0x2f, 0x70, 0x72,
0x69, 0x67, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, 0x34, 0x2f, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x3b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x70, 0x62, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33,
}

View File

@@ -1,7 +1,7 @@
syntax = "proto3";
package service;
option go_package="go.unistack.org/micro-config-service/v3/proto;servicepb";
option go_package="go.unistack.org/micro-config-service/v4/proto;servicepb";
service Config {
rpc Load(LoadRequest) returns (LoadResponse) {};

View File

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc v3.21.12
// - protoc-gen-go-grpc v1.5.1
// - protoc v5.29.3
// source: service.proto
package servicepb
@@ -15,8 +15,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.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
Config_Load_FullMethodName = "/service.Config/Load"
@@ -40,8 +40,9 @@ func NewConfigClient(cc grpc.ClientConnInterface) ConfigClient {
}
func (c *configClient) Load(ctx context.Context, in *LoadRequest, opts ...grpc.CallOption) (*LoadResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(LoadResponse)
err := c.cc.Invoke(ctx, Config_Load_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, Config_Load_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
@@ -49,8 +50,9 @@ func (c *configClient) Load(ctx context.Context, in *LoadRequest, opts ...grpc.C
}
func (c *configClient) Save(ctx context.Context, in *SaveRequest, opts ...grpc.CallOption) (*SaveResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(SaveResponse)
err := c.cc.Invoke(ctx, Config_Save_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, Config_Save_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
@@ -59,16 +61,19 @@ func (c *configClient) Save(ctx context.Context, in *SaveRequest, opts ...grpc.C
// ConfigServer is the server API for Config service.
// All implementations must embed UnimplementedConfigServer
// for forward compatibility
// for forward compatibility.
type ConfigServer interface {
Load(context.Context, *LoadRequest) (*LoadResponse, error)
Save(context.Context, *SaveRequest) (*SaveResponse, error)
mustEmbedUnimplementedConfigServer()
}
// UnimplementedConfigServer must be embedded to have forward compatible implementations.
type UnimplementedConfigServer struct {
}
// UnimplementedConfigServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedConfigServer struct{}
func (UnimplementedConfigServer) Load(context.Context, *LoadRequest) (*LoadResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Load not implemented")
@@ -77,6 +82,7 @@ func (UnimplementedConfigServer) Save(context.Context, *SaveRequest) (*SaveRespo
return nil, status.Errorf(codes.Unimplemented, "method Save not implemented")
}
func (UnimplementedConfigServer) mustEmbedUnimplementedConfigServer() {}
func (UnimplementedConfigServer) testEmbeddedByValue() {}
// 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
@@ -86,6 +92,13 @@ type UnsafeConfigServer interface {
}
func RegisterConfigServer(s grpc.ServiceRegistrar, srv ConfigServer) {
// If the following call pancis, it indicates UnimplementedConfigServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&Config_ServiceDesc, srv)
}