mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-25 03:36:41 +00:00
118 lines
4.6 KiB
Go
118 lines
4.6 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.5.1
|
|
// - protoc (unknown)
|
|
// source: flow/flow.proto
|
|
|
|
package proto
|
|
|
|
import (
|
|
context "context"
|
|
grpc "google.golang.org/grpc"
|
|
codes "google.golang.org/grpc/codes"
|
|
status "google.golang.org/grpc/status"
|
|
)
|
|
|
|
// 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 (
|
|
FlowService_Events_FullMethodName = "/flow.FlowService/Events"
|
|
)
|
|
|
|
// FlowServiceClient is the client API for FlowService 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 FlowServiceClient interface {
|
|
// Client to receiver streams of events and acknowledgements
|
|
Events(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[FlowEvent, FlowEventAck], error)
|
|
}
|
|
|
|
type flowServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewFlowServiceClient(cc grpc.ClientConnInterface) FlowServiceClient {
|
|
return &flowServiceClient{cc}
|
|
}
|
|
|
|
func (c *flowServiceClient) Events(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[FlowEvent, FlowEventAck], error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
stream, err := c.cc.NewStream(ctx, &FlowService_ServiceDesc.Streams[0], FlowService_Events_FullMethodName, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &grpc.GenericClientStream[FlowEvent, FlowEventAck]{ClientStream: stream}
|
|
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 FlowService_EventsClient = grpc.BidiStreamingClient[FlowEvent, FlowEventAck]
|
|
|
|
// FlowServiceServer is the server API for FlowService service.
|
|
// All implementations must embed UnimplementedFlowServiceServer
|
|
// for forward compatibility.
|
|
type FlowServiceServer interface {
|
|
// Client to receiver streams of events and acknowledgements
|
|
Events(grpc.BidiStreamingServer[FlowEvent, FlowEventAck]) error
|
|
mustEmbedUnimplementedFlowServiceServer()
|
|
}
|
|
|
|
// UnimplementedFlowServiceServer 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 UnimplementedFlowServiceServer struct{}
|
|
|
|
func (UnimplementedFlowServiceServer) Events(grpc.BidiStreamingServer[FlowEvent, FlowEventAck]) error {
|
|
return status.Errorf(codes.Unimplemented, "method Events not implemented")
|
|
}
|
|
func (UnimplementedFlowServiceServer) mustEmbedUnimplementedFlowServiceServer() {}
|
|
func (UnimplementedFlowServiceServer) testEmbeddedByValue() {}
|
|
|
|
// UnsafeFlowServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to FlowServiceServer will
|
|
// result in compilation errors.
|
|
type UnsafeFlowServiceServer interface {
|
|
mustEmbedUnimplementedFlowServiceServer()
|
|
}
|
|
|
|
func RegisterFlowServiceServer(s grpc.ServiceRegistrar, srv FlowServiceServer) {
|
|
// If the following call pancis, it indicates UnimplementedFlowServiceServer 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(&FlowService_ServiceDesc, srv)
|
|
}
|
|
|
|
func _FlowService_Events_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
return srv.(FlowServiceServer).Events(&grpc.GenericServerStream[FlowEvent, FlowEventAck]{ServerStream: stream})
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type FlowService_EventsServer = grpc.BidiStreamingServer[FlowEvent, FlowEventAck]
|
|
|
|
// FlowService_ServiceDesc is the grpc.ServiceDesc for FlowService service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var FlowService_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "flow.FlowService",
|
|
HandlerType: (*FlowServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{},
|
|
Streams: []grpc.StreamDesc{
|
|
{
|
|
StreamName: "Events",
|
|
Handler: _FlowService_Events_Handler,
|
|
ServerStreams: true,
|
|
ClientStreams: true,
|
|
},
|
|
},
|
|
Metadata: "flow/flow.proto",
|
|
}
|