Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2024-12-11 02:00:29 +03:00
parent e7e1ff15f4
commit 1aa324c17f
63 changed files with 2488 additions and 1165 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.28.3
// source: ngpb.proto
package pb

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.28.3
// source: ngpb.proto
package pb
@@ -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 (
Test_Call_FullMethodName = "/test.v1.ngpb.Test/Call"
@@ -39,8 +39,9 @@ func NewTestClient(cc grpc.ClientConnInterface) TestClient {
}
func (c *testClient) Call(ctx context.Context, in *CallReq, opts ...grpc.CallOption) (*CallRsp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(CallRsp)
err := c.cc.Invoke(ctx, Test_Call_FullMethodName, in, out, opts...)
err := c.cc.Invoke(ctx, Test_Call_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
@@ -49,21 +50,25 @@ func (c *testClient) Call(ctx context.Context, in *CallReq, opts ...grpc.CallOpt
// TestServer is the server API for Test service.
// All implementations must embed UnimplementedTestServer
// for forward compatibility
// for forward compatibility.
type TestServer interface {
// option (micro.api.micro_service) = { client_wrappers: ["one","two"]; };
Call(context.Context, *CallReq) (*CallRsp, error)
mustEmbedUnimplementedTestServer()
}
// UnimplementedTestServer must be embedded to have forward compatible implementations.
type UnimplementedTestServer struct {
}
// UnimplementedTestServer 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 UnimplementedTestServer struct{}
func (UnimplementedTestServer) Call(context.Context, *CallReq) (*CallRsp, error) {
return nil, status.Errorf(codes.Unimplemented, "method Call not implemented")
}
func (UnimplementedTestServer) mustEmbedUnimplementedTestServer() {}
func (UnimplementedTestServer) testEmbeddedByValue() {}
// UnsafeTestServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to TestServer will
@@ -73,6 +78,13 @@ type UnsafeTestServer interface {
}
func RegisterTestServer(s grpc.ServiceRegistrar, srv TestServer) {
// If the following call pancis, it indicates UnimplementedTestServer 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(&Test_ServiceDesc, srv)
}