agones.dev/agones@v1.53.0/pkg/allocation/go/processor_grpc.pb.go (about)

     1  // Copyright 2024 Google LLC All Rights Reserved.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  // This code was autogenerated. Do not edit directly.
    16  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
    17  // versions:
    18  // - protoc-gen-go-grpc v1.2.0
    19  // - protoc             v6.30.0
    20  // source: proto/allocation/processor.proto
    21  
    22  package allocation
    23  
    24  import (
    25  	context "context"
    26  
    27  	grpc "google.golang.org/grpc"
    28  	codes "google.golang.org/grpc/codes"
    29  	status "google.golang.org/grpc/status"
    30  )
    31  
    32  // This is a compile-time assertion to ensure that this generated file
    33  // is compatible with the grpc package it is being compiled against.
    34  // Requires gRPC-Go v1.32.0 or later.
    35  const _ = grpc.SupportPackageIsVersion7
    36  
    37  // ProcessorClient is the client API for Processor service.
    38  //
    39  // 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.
    40  type ProcessorClient interface {
    41  	// StreamBatches processes a stream of ProcessorMessage requests and returns a stream of ProcessorMessage responses.
    42  	StreamBatches(ctx context.Context, opts ...grpc.CallOption) (Processor_StreamBatchesClient, error)
    43  }
    44  
    45  type processorClient struct {
    46  	cc grpc.ClientConnInterface
    47  }
    48  
    49  func NewProcessorClient(cc grpc.ClientConnInterface) ProcessorClient {
    50  	return &processorClient{cc}
    51  }
    52  
    53  func (c *processorClient) StreamBatches(ctx context.Context, opts ...grpc.CallOption) (Processor_StreamBatchesClient, error) {
    54  	stream, err := c.cc.NewStream(ctx, &Processor_ServiceDesc.Streams[0], "/allocation.Processor/StreamBatches", opts...)
    55  	if err != nil {
    56  		return nil, err
    57  	}
    58  	x := &processorStreamBatchesClient{stream}
    59  	return x, nil
    60  }
    61  
    62  type Processor_StreamBatchesClient interface {
    63  	Send(*ProcessorMessage) error
    64  	Recv() (*ProcessorMessage, error)
    65  	grpc.ClientStream
    66  }
    67  
    68  type processorStreamBatchesClient struct {
    69  	grpc.ClientStream
    70  }
    71  
    72  func (x *processorStreamBatchesClient) Send(m *ProcessorMessage) error {
    73  	return x.ClientStream.SendMsg(m)
    74  }
    75  
    76  func (x *processorStreamBatchesClient) Recv() (*ProcessorMessage, error) {
    77  	m := new(ProcessorMessage)
    78  	if err := x.ClientStream.RecvMsg(m); err != nil {
    79  		return nil, err
    80  	}
    81  	return m, nil
    82  }
    83  
    84  // ProcessorServer is the server API for Processor service.
    85  // All implementations should embed UnimplementedProcessorServer
    86  // for forward compatibility
    87  type ProcessorServer interface {
    88  	// StreamBatches processes a stream of ProcessorMessage requests and returns a stream of ProcessorMessage responses.
    89  	StreamBatches(Processor_StreamBatchesServer) error
    90  }
    91  
    92  // UnimplementedProcessorServer should be embedded to have forward compatible implementations.
    93  type UnimplementedProcessorServer struct {
    94  }
    95  
    96  func (UnimplementedProcessorServer) StreamBatches(Processor_StreamBatchesServer) error {
    97  	return status.Errorf(codes.Unimplemented, "method StreamBatches not implemented")
    98  }
    99  
   100  // UnsafeProcessorServer may be embedded to opt out of forward compatibility for this service.
   101  // Use of this interface is not recommended, as added methods to ProcessorServer will
   102  // result in compilation errors.
   103  type UnsafeProcessorServer interface {
   104  	mustEmbedUnimplementedProcessorServer()
   105  }
   106  
   107  func RegisterProcessorServer(s grpc.ServiceRegistrar, srv ProcessorServer) {
   108  	s.RegisterService(&Processor_ServiceDesc, srv)
   109  }
   110  
   111  func _Processor_StreamBatches_Handler(srv interface{}, stream grpc.ServerStream) error {
   112  	return srv.(ProcessorServer).StreamBatches(&processorStreamBatchesServer{stream})
   113  }
   114  
   115  type Processor_StreamBatchesServer interface {
   116  	Send(*ProcessorMessage) error
   117  	Recv() (*ProcessorMessage, error)
   118  	grpc.ServerStream
   119  }
   120  
   121  type processorStreamBatchesServer struct {
   122  	grpc.ServerStream
   123  }
   124  
   125  func (x *processorStreamBatchesServer) Send(m *ProcessorMessage) error {
   126  	return x.ServerStream.SendMsg(m)
   127  }
   128  
   129  func (x *processorStreamBatchesServer) Recv() (*ProcessorMessage, error) {
   130  	m := new(ProcessorMessage)
   131  	if err := x.ServerStream.RecvMsg(m); err != nil {
   132  		return nil, err
   133  	}
   134  	return m, nil
   135  }
   136  
   137  // Processor_ServiceDesc is the grpc.ServiceDesc for Processor service.
   138  // It's only intended for direct use with grpc.RegisterService,
   139  // and not to be introspected or modified (even as a copy)
   140  var Processor_ServiceDesc = grpc.ServiceDesc{
   141  	ServiceName: "allocation.Processor",
   142  	HandlerType: (*ProcessorServer)(nil),
   143  	Methods:     []grpc.MethodDesc{},
   144  	Streams: []grpc.StreamDesc{
   145  		{
   146  			StreamName:    "StreamBatches",
   147  			Handler:       _Processor_StreamBatches_Handler,
   148  			ServerStreams: true,
   149  			ClientStreams: true,
   150  		},
   151  	},
   152  	Metadata: "proto/allocation/processor.proto",
   153  }