flow_grpc.pb.go 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
  2. // versions:
  3. // - protoc-gen-go-grpc v1.6.0
  4. // - protoc v3.21.12
  5. // source: grpc/flow/flow.proto
  6. package flow
  7. import (
  8. context "context"
  9. grpc "google.golang.org/grpc"
  10. codes "google.golang.org/grpc/codes"
  11. status "google.golang.org/grpc/status"
  12. )
  13. // This is a compile-time assertion to ensure that this generated file
  14. // is compatible with the grpc package it is being compiled against.
  15. // Requires gRPC-Go v1.64.0 or later.
  16. const _ = grpc.SupportPackageIsVersion9
  17. const (
  18. FlowService_StreamFlows_FullMethodName = "/netmaker.flow.FlowService/StreamFlows"
  19. )
  20. // FlowServiceClient is the client API for FlowService service.
  21. //
  22. // 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.
  23. //
  24. // *
  25. // Bidirectional streaming:
  26. // - Agents continuously send FlowEnvelope batches.
  27. // - Server replies with FlowResponse ACKs.
  28. type FlowServiceClient interface {
  29. StreamFlows(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[FlowEnvelope, FlowResponse], error)
  30. }
  31. type flowServiceClient struct {
  32. cc grpc.ClientConnInterface
  33. }
  34. func NewFlowServiceClient(cc grpc.ClientConnInterface) FlowServiceClient {
  35. return &flowServiceClient{cc}
  36. }
  37. func (c *flowServiceClient) StreamFlows(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[FlowEnvelope, FlowResponse], error) {
  38. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  39. stream, err := c.cc.NewStream(ctx, &FlowService_ServiceDesc.Streams[0], FlowService_StreamFlows_FullMethodName, cOpts...)
  40. if err != nil {
  41. return nil, err
  42. }
  43. x := &grpc.GenericClientStream[FlowEnvelope, FlowResponse]{ClientStream: stream}
  44. return x, nil
  45. }
  46. // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
  47. type FlowService_StreamFlowsClient = grpc.BidiStreamingClient[FlowEnvelope, FlowResponse]
  48. // FlowServiceServer is the server API for FlowService service.
  49. // All implementations must embed UnimplementedFlowServiceServer
  50. // for forward compatibility.
  51. //
  52. // *
  53. // Bidirectional streaming:
  54. // - Agents continuously send FlowEnvelope batches.
  55. // - Server replies with FlowResponse ACKs.
  56. type FlowServiceServer interface {
  57. StreamFlows(grpc.BidiStreamingServer[FlowEnvelope, FlowResponse]) error
  58. mustEmbedUnimplementedFlowServiceServer()
  59. }
  60. // UnimplementedFlowServiceServer must be embedded to have
  61. // forward compatible implementations.
  62. //
  63. // NOTE: this should be embedded by value instead of pointer to avoid a nil
  64. // pointer dereference when methods are called.
  65. type UnimplementedFlowServiceServer struct{}
  66. func (UnimplementedFlowServiceServer) StreamFlows(grpc.BidiStreamingServer[FlowEnvelope, FlowResponse]) error {
  67. return status.Error(codes.Unimplemented, "method StreamFlows not implemented")
  68. }
  69. func (UnimplementedFlowServiceServer) mustEmbedUnimplementedFlowServiceServer() {}
  70. func (UnimplementedFlowServiceServer) testEmbeddedByValue() {}
  71. // UnsafeFlowServiceServer may be embedded to opt out of forward compatibility for this service.
  72. // Use of this interface is not recommended, as added methods to FlowServiceServer will
  73. // result in compilation errors.
  74. type UnsafeFlowServiceServer interface {
  75. mustEmbedUnimplementedFlowServiceServer()
  76. }
  77. func RegisterFlowServiceServer(s grpc.ServiceRegistrar, srv FlowServiceServer) {
  78. // If the following call panics, it indicates UnimplementedFlowServiceServer was
  79. // embedded by pointer and is nil. This will cause panics if an
  80. // unimplemented method is ever invoked, so we test this at initialization
  81. // time to prevent it from happening at runtime later due to I/O.
  82. if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
  83. t.testEmbeddedByValue()
  84. }
  85. s.RegisterService(&FlowService_ServiceDesc, srv)
  86. }
  87. func _FlowService_StreamFlows_Handler(srv interface{}, stream grpc.ServerStream) error {
  88. return srv.(FlowServiceServer).StreamFlows(&grpc.GenericServerStream[FlowEnvelope, FlowResponse]{ServerStream: stream})
  89. }
  90. // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
  91. type FlowService_StreamFlowsServer = grpc.BidiStreamingServer[FlowEnvelope, FlowResponse]
  92. // FlowService_ServiceDesc is the grpc.ServiceDesc for FlowService service.
  93. // It's only intended for direct use with grpc.RegisterService,
  94. // and not to be introspected or modified (even as a copy)
  95. var FlowService_ServiceDesc = grpc.ServiceDesc{
  96. ServiceName: "netmaker.flow.FlowService",
  97. HandlerType: (*FlowServiceServer)(nil),
  98. Methods: []grpc.MethodDesc{},
  99. Streams: []grpc.StreamDesc{
  100. {
  101. StreamName: "StreamFlows",
  102. Handler: _FlowService_StreamFlows_Handler,
  103. ServerStreams: true,
  104. ClientStreams: true,
  105. },
  106. },
  107. Metadata: "grpc/flow/flow.proto",
  108. }