Update protobuf definitions: 2b810cf630adde5acba195cc06eb00db99555893

This commit is contained in:
root
2026-04-20 20:03:39 +00:00
parent 17cffa789a
commit 308a757454
2 changed files with 124 additions and 7 deletions

View File

@@ -93,15 +93,90 @@ func (*PingResponse) Descriptor() ([]byte, []int) {
return file_test_v1_test_v1_proto_rawDescGZIP(), []int{1}
}
type PongRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *PongRequest) Reset() {
*x = PongRequest{}
mi := &file_test_v1_test_v1_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *PongRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PongRequest) ProtoMessage() {}
func (x *PongRequest) ProtoReflect() protoreflect.Message {
mi := &file_test_v1_test_v1_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use PongRequest.ProtoReflect.Descriptor instead.
func (*PongRequest) Descriptor() ([]byte, []int) {
return file_test_v1_test_v1_proto_rawDescGZIP(), []int{2}
}
type PongResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *PongResponse) Reset() {
*x = PongResponse{}
mi := &file_test_v1_test_v1_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *PongResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PongResponse) ProtoMessage() {}
func (x *PongResponse) ProtoReflect() protoreflect.Message {
mi := &file_test_v1_test_v1_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use PongResponse.ProtoReflect.Descriptor instead.
func (*PongResponse) Descriptor() ([]byte, []int) {
return file_test_v1_test_v1_proto_rawDescGZIP(), []int{3}
}
var File_test_v1_test_v1_proto protoreflect.FileDescriptor
const file_test_v1_test_v1_proto_rawDesc = "" +
"\n" +
"\x15test/v1/test_v1.proto\x12\atest.v1\"\r\n" +
"\vPingRequest\"\x0e\n" +
"\fPingResponse2D\n" +
"\fPingResponse\"\r\n" +
"\vPongRequest\"\x0e\n" +
"\fPongResponse2{\n" +
"\vTestService\x125\n" +
"\x04Ping\x12\x14.test.v1.PingRequest\x1a\x15.test.v1.PingResponse\"\x00BEZCgitea.badhouseplants.net/softplayer/softplayer-go-proto/pkg/test/v1b\x06proto3"
"\x04Ping\x12\x14.test.v1.PingRequest\x1a\x15.test.v1.PingResponse\"\x00\x125\n" +
"\x04Pong\x12\x14.test.v1.PongRequest\x1a\x15.test.v1.PongResponse\"\x00BEZCgitea.badhouseplants.net/softplayer/softplayer-go-proto/pkg/test/v1b\x06proto3"
var (
file_test_v1_test_v1_proto_rawDescOnce sync.Once
@@ -115,16 +190,20 @@ func file_test_v1_test_v1_proto_rawDescGZIP() []byte {
return file_test_v1_test_v1_proto_rawDescData
}
var file_test_v1_test_v1_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_test_v1_test_v1_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_test_v1_test_v1_proto_goTypes = []any{
(*PingRequest)(nil), // 0: test.v1.PingRequest
(*PingResponse)(nil), // 1: test.v1.PingResponse
(*PongRequest)(nil), // 2: test.v1.PongRequest
(*PongResponse)(nil), // 3: test.v1.PongResponse
}
var file_test_v1_test_v1_proto_depIdxs = []int32{
0, // 0: test.v1.TestService.Ping:input_type -> test.v1.PingRequest
1, // 1: test.v1.TestService.Ping:output_type -> test.v1.PingResponse
1, // [1:2] is the sub-list for method output_type
0, // [0:1] is the sub-list for method input_type
2, // 1: test.v1.TestService.Pong:input_type -> test.v1.PongRequest
1, // 2: test.v1.TestService.Ping:output_type -> test.v1.PingResponse
3, // 3: test.v1.TestService.Pong:output_type -> test.v1.PongResponse
2, // [2:4] is the sub-list for method output_type
0, // [0:2] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
@@ -141,7 +220,7 @@ func file_test_v1_test_v1_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_test_v1_test_v1_proto_rawDesc), len(file_test_v1_test_v1_proto_rawDesc)),
NumEnums: 0,
NumMessages: 2,
NumMessages: 4,
NumExtensions: 0,
NumServices: 1,
},

View File

@@ -20,6 +20,7 @@ const _ = grpc.SupportPackageIsVersion9
const (
TestService_Ping_FullMethodName = "/test.v1.TestService/Ping"
TestService_Pong_FullMethodName = "/test.v1.TestService/Pong"
)
// TestServiceClient is the client API for TestService service.
@@ -30,6 +31,7 @@ const (
// Service for handling environments
type TestServiceClient interface {
Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error)
Pong(ctx context.Context, in *PongRequest, opts ...grpc.CallOption) (*PongResponse, error)
}
type testServiceClient struct {
@@ -50,6 +52,16 @@ func (c *testServiceClient) Ping(ctx context.Context, in *PingRequest, opts ...g
return out, nil
}
func (c *testServiceClient) Pong(ctx context.Context, in *PongRequest, opts ...grpc.CallOption) (*PongResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(PongResponse)
err := c.cc.Invoke(ctx, TestService_Pong_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// TestServiceServer is the server API for TestService service.
// All implementations should embed UnimplementedTestServiceServer
// for forward compatibility.
@@ -58,6 +70,7 @@ func (c *testServiceClient) Ping(ctx context.Context, in *PingRequest, opts ...g
// Service for handling environments
type TestServiceServer interface {
Ping(context.Context, *PingRequest) (*PingResponse, error)
Pong(context.Context, *PongRequest) (*PongResponse, error)
}
// UnimplementedTestServiceServer should be embedded to have
@@ -70,6 +83,9 @@ type UnimplementedTestServiceServer struct{}
func (UnimplementedTestServiceServer) Ping(context.Context, *PingRequest) (*PingResponse, error) {
return nil, status.Error(codes.Unimplemented, "method Ping not implemented")
}
func (UnimplementedTestServiceServer) Pong(context.Context, *PongRequest) (*PongResponse, error) {
return nil, status.Error(codes.Unimplemented, "method Pong not implemented")
}
func (UnimplementedTestServiceServer) testEmbeddedByValue() {}
// UnsafeTestServiceServer may be embedded to opt out of forward compatibility for this service.
@@ -108,6 +124,24 @@ func _TestService_Ping_Handler(srv interface{}, ctx context.Context, dec func(in
return interceptor(ctx, in, info, handler)
}
func _TestService_Pong_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(PongRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TestServiceServer).Pong(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: TestService_Pong_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TestServiceServer).Pong(ctx, req.(*PongRequest))
}
return interceptor(ctx, in, info, handler)
}
// TestService_ServiceDesc is the grpc.ServiceDesc for TestService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
@@ -119,6 +153,10 @@ var TestService_ServiceDesc = grpc.ServiceDesc{
MethodName: "Ping",
Handler: _TestService_Ping_Handler,
},
{
MethodName: "Pong",
Handler: _TestService_Pong_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "test/v1/test_v1.proto",