By allanger
Commit link: 53c5c44307
Pipeline link: https://ci.badhouseplants.net/repos/34/pipeline/68
311 lines
12 KiB
Go
311 lines
12 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.6.2
|
|
// - protoc (unknown)
|
|
// source: test/v1/test_v1.proto
|
|
|
|
package v1
|
|
|
|
import (
|
|
context "context"
|
|
grpc "google.golang.org/grpc"
|
|
codes "google.golang.org/grpc/codes"
|
|
status "google.golang.org/grpc/status"
|
|
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
|
)
|
|
|
|
// 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.64.0 or later.
|
|
const _ = grpc.SupportPackageIsVersion9
|
|
|
|
const (
|
|
PublicTestService_Ping_FullMethodName = "/test.v1.PublicTestService/Ping"
|
|
PublicTestService_PingStream_FullMethodName = "/test.v1.PublicTestService/PingStream"
|
|
)
|
|
|
|
// PublicTestServiceClient is the client API for PublicTestService service.
|
|
//
|
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
|
//
|
|
// *
|
|
// Service for handling environments
|
|
type PublicTestServiceClient interface {
|
|
Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error)
|
|
PingStream(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[PingStreamResponse], error)
|
|
}
|
|
|
|
type publicTestServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewPublicTestServiceClient(cc grpc.ClientConnInterface) PublicTestServiceClient {
|
|
return &publicTestServiceClient{cc}
|
|
}
|
|
|
|
func (c *publicTestServiceClient) Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(PingResponse)
|
|
err := c.cc.Invoke(ctx, PublicTestService_Ping_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *publicTestServiceClient) PingStream(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[PingStreamResponse], error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
stream, err := c.cc.NewStream(ctx, &PublicTestService_ServiceDesc.Streams[0], PublicTestService_PingStream_FullMethodName, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &grpc.GenericClientStream[emptypb.Empty, PingStreamResponse]{ClientStream: stream}
|
|
if err := x.ClientStream.SendMsg(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if err := x.ClientStream.CloseSend(); err != nil {
|
|
return nil, err
|
|
}
|
|
return x, nil
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type PublicTestService_PingStreamClient = grpc.ServerStreamingClient[PingStreamResponse]
|
|
|
|
// PublicTestServiceServer is the server API for PublicTestService service.
|
|
// All implementations should embed UnimplementedPublicTestServiceServer
|
|
// for forward compatibility.
|
|
//
|
|
// *
|
|
// Service for handling environments
|
|
type PublicTestServiceServer interface {
|
|
Ping(context.Context, *PingRequest) (*PingResponse, error)
|
|
PingStream(*emptypb.Empty, grpc.ServerStreamingServer[PingStreamResponse]) error
|
|
}
|
|
|
|
// UnimplementedPublicTestServiceServer should 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 UnimplementedPublicTestServiceServer struct{}
|
|
|
|
func (UnimplementedPublicTestServiceServer) Ping(context.Context, *PingRequest) (*PingResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method Ping not implemented")
|
|
}
|
|
func (UnimplementedPublicTestServiceServer) PingStream(*emptypb.Empty, grpc.ServerStreamingServer[PingStreamResponse]) error {
|
|
return status.Error(codes.Unimplemented, "method PingStream not implemented")
|
|
}
|
|
func (UnimplementedPublicTestServiceServer) testEmbeddedByValue() {}
|
|
|
|
// UnsafePublicTestServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to PublicTestServiceServer will
|
|
// result in compilation errors.
|
|
type UnsafePublicTestServiceServer interface {
|
|
mustEmbedUnimplementedPublicTestServiceServer()
|
|
}
|
|
|
|
func RegisterPublicTestServiceServer(s grpc.ServiceRegistrar, srv PublicTestServiceServer) {
|
|
// If the following call panics, it indicates UnimplementedPublicTestServiceServer 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(&PublicTestService_ServiceDesc, srv)
|
|
}
|
|
|
|
func _PublicTestService_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(PingRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(PublicTestServiceServer).Ping(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: PublicTestService_Ping_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(PublicTestServiceServer).Ping(ctx, req.(*PingRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _PublicTestService_PingStream_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
m := new(emptypb.Empty)
|
|
if err := stream.RecvMsg(m); err != nil {
|
|
return err
|
|
}
|
|
return srv.(PublicTestServiceServer).PingStream(m, &grpc.GenericServerStream[emptypb.Empty, PingStreamResponse]{ServerStream: stream})
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type PublicTestService_PingStreamServer = grpc.ServerStreamingServer[PingStreamResponse]
|
|
|
|
// PublicTestService_ServiceDesc is the grpc.ServiceDesc for PublicTestService service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var PublicTestService_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "test.v1.PublicTestService",
|
|
HandlerType: (*PublicTestServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "Ping",
|
|
Handler: _PublicTestService_Ping_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{
|
|
{
|
|
StreamName: "PingStream",
|
|
Handler: _PublicTestService_PingStream_Handler,
|
|
ServerStreams: true,
|
|
},
|
|
},
|
|
Metadata: "test/v1/test_v1.proto",
|
|
}
|
|
|
|
const (
|
|
TestService_Pong_FullMethodName = "/test.v1.TestService/Pong"
|
|
TestService_PongStream_FullMethodName = "/test.v1.TestService/PongStream"
|
|
)
|
|
|
|
// TestServiceClient is the client API for TestService service.
|
|
//
|
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
|
type TestServiceClient interface {
|
|
Pong(ctx context.Context, in *PongRequest, opts ...grpc.CallOption) (*PongResponse, error)
|
|
PongStream(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[PongStreamResponse], error)
|
|
}
|
|
|
|
type testServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewTestServiceClient(cc grpc.ClientConnInterface) TestServiceClient {
|
|
return &testServiceClient{cc}
|
|
}
|
|
|
|
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
|
|
}
|
|
|
|
func (c *testServiceClient) PongStream(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[PongStreamResponse], error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
stream, err := c.cc.NewStream(ctx, &TestService_ServiceDesc.Streams[0], TestService_PongStream_FullMethodName, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &grpc.GenericClientStream[emptypb.Empty, PongStreamResponse]{ClientStream: stream}
|
|
if err := x.ClientStream.SendMsg(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if err := x.ClientStream.CloseSend(); err != nil {
|
|
return nil, err
|
|
}
|
|
return x, nil
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type TestService_PongStreamClient = grpc.ServerStreamingClient[PongStreamResponse]
|
|
|
|
// TestServiceServer is the server API for TestService service.
|
|
// All implementations should embed UnimplementedTestServiceServer
|
|
// for forward compatibility.
|
|
type TestServiceServer interface {
|
|
Pong(context.Context, *PongRequest) (*PongResponse, error)
|
|
PongStream(*emptypb.Empty, grpc.ServerStreamingServer[PongStreamResponse]) error
|
|
}
|
|
|
|
// UnimplementedTestServiceServer should 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 UnimplementedTestServiceServer struct{}
|
|
|
|
func (UnimplementedTestServiceServer) Pong(context.Context, *PongRequest) (*PongResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method Pong not implemented")
|
|
}
|
|
func (UnimplementedTestServiceServer) PongStream(*emptypb.Empty, grpc.ServerStreamingServer[PongStreamResponse]) error {
|
|
return status.Error(codes.Unimplemented, "method PongStream not implemented")
|
|
}
|
|
func (UnimplementedTestServiceServer) testEmbeddedByValue() {}
|
|
|
|
// UnsafeTestServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to TestServiceServer will
|
|
// result in compilation errors.
|
|
type UnsafeTestServiceServer interface {
|
|
mustEmbedUnimplementedTestServiceServer()
|
|
}
|
|
|
|
func RegisterTestServiceServer(s grpc.ServiceRegistrar, srv TestServiceServer) {
|
|
// If the following call panics, it indicates UnimplementedTestServiceServer 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(&TestService_ServiceDesc, srv)
|
|
}
|
|
|
|
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)
|
|
}
|
|
|
|
func _TestService_PongStream_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
m := new(emptypb.Empty)
|
|
if err := stream.RecvMsg(m); err != nil {
|
|
return err
|
|
}
|
|
return srv.(TestServiceServer).PongStream(m, &grpc.GenericServerStream[emptypb.Empty, PongStreamResponse]{ServerStream: stream})
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type TestService_PongStreamServer = grpc.ServerStreamingServer[PongStreamResponse]
|
|
|
|
// 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)
|
|
var TestService_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "test.v1.TestService",
|
|
HandlerType: (*TestServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "Pong",
|
|
Handler: _TestService_Pong_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{
|
|
{
|
|
StreamName: "PongStream",
|
|
Handler: _TestService_PongStream_Handler,
|
|
ServerStreams: true,
|
|
},
|
|
},
|
|
Metadata: "test/v1/test_v1.proto",
|
|
}
|