2022-07-08 17:01:13 +00:00
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc (unknown)
2023-02-17 21:14:46 +00:00
// source: private/pbpeerstream/peerstream.proto
2022-07-08 17:01:13 +00:00
package pbpeerstream
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.32.0 or later.
const _ = grpc . SupportPackageIsVersion7
// PeerStreamServiceClient is the client API for PeerStreamService 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 PeerStreamServiceClient interface {
// StreamResources opens an event stream for resources to share between peers, such as services.
// Events are streamed as they happen.
// buf:lint:ignore RPC_REQUEST_STANDARD_NAME
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
StreamResources ( ctx context . Context , opts ... grpc . CallOption ) ( PeerStreamService_StreamResourcesClient , error )
2022-08-01 14:33:18 +00:00
// ExchangeSecret is a unary RPC for exchanging the one-time establishment secret
// for a long-lived stream secret.
ExchangeSecret ( ctx context . Context , in * ExchangeSecretRequest , opts ... grpc . CallOption ) ( * ExchangeSecretResponse , error )
2022-07-08 17:01:13 +00:00
}
type peerStreamServiceClient struct {
cc grpc . ClientConnInterface
}
func NewPeerStreamServiceClient ( cc grpc . ClientConnInterface ) PeerStreamServiceClient {
return & peerStreamServiceClient { cc }
}
func ( c * peerStreamServiceClient ) StreamResources ( ctx context . Context , opts ... grpc . CallOption ) ( PeerStreamService_StreamResourcesClient , error ) {
2022-07-13 16:03:27 +00:00
stream , err := c . cc . NewStream ( ctx , & PeerStreamService_ServiceDesc . Streams [ 0 ] , "/hashicorp.consul.internal.peerstream.PeerStreamService/StreamResources" , opts ... )
2022-07-08 17:01:13 +00:00
if err != nil {
return nil , err
}
x := & peerStreamServiceStreamResourcesClient { stream }
return x , nil
}
type PeerStreamService_StreamResourcesClient interface {
Send ( * ReplicationMessage ) error
Recv ( ) ( * ReplicationMessage , error )
grpc . ClientStream
}
type peerStreamServiceStreamResourcesClient struct {
grpc . ClientStream
}
func ( x * peerStreamServiceStreamResourcesClient ) Send ( m * ReplicationMessage ) error {
return x . ClientStream . SendMsg ( m )
}
func ( x * peerStreamServiceStreamResourcesClient ) Recv ( ) ( * ReplicationMessage , error ) {
m := new ( ReplicationMessage )
if err := x . ClientStream . RecvMsg ( m ) ; err != nil {
return nil , err
}
return m , nil
}
2022-08-01 14:33:18 +00:00
func ( c * peerStreamServiceClient ) ExchangeSecret ( ctx context . Context , in * ExchangeSecretRequest , opts ... grpc . CallOption ) ( * ExchangeSecretResponse , error ) {
out := new ( ExchangeSecretResponse )
err := c . cc . Invoke ( ctx , "/hashicorp.consul.internal.peerstream.PeerStreamService/ExchangeSecret" , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
2022-07-08 17:01:13 +00:00
// PeerStreamServiceServer is the server API for PeerStreamService service.
// All implementations should embed UnimplementedPeerStreamServiceServer
// for forward compatibility
type PeerStreamServiceServer interface {
// StreamResources opens an event stream for resources to share between peers, such as services.
// Events are streamed as they happen.
// buf:lint:ignore RPC_REQUEST_STANDARD_NAME
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
StreamResources ( PeerStreamService_StreamResourcesServer ) error
2022-08-01 14:33:18 +00:00
// ExchangeSecret is a unary RPC for exchanging the one-time establishment secret
// for a long-lived stream secret.
ExchangeSecret ( context . Context , * ExchangeSecretRequest ) ( * ExchangeSecretResponse , error )
2022-07-08 17:01:13 +00:00
}
// UnimplementedPeerStreamServiceServer should be embedded to have forward compatible implementations.
type UnimplementedPeerStreamServiceServer struct {
}
func ( UnimplementedPeerStreamServiceServer ) StreamResources ( PeerStreamService_StreamResourcesServer ) error {
return status . Errorf ( codes . Unimplemented , "method StreamResources not implemented" )
}
2022-08-01 14:33:18 +00:00
func ( UnimplementedPeerStreamServiceServer ) ExchangeSecret ( context . Context , * ExchangeSecretRequest ) ( * ExchangeSecretResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method ExchangeSecret not implemented" )
}
2022-07-08 17:01:13 +00:00
// UnsafePeerStreamServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to PeerStreamServiceServer will
// result in compilation errors.
type UnsafePeerStreamServiceServer interface {
mustEmbedUnimplementedPeerStreamServiceServer ( )
}
func RegisterPeerStreamServiceServer ( s grpc . ServiceRegistrar , srv PeerStreamServiceServer ) {
s . RegisterService ( & PeerStreamService_ServiceDesc , srv )
}
func _PeerStreamService_StreamResources_Handler ( srv interface { } , stream grpc . ServerStream ) error {
return srv . ( PeerStreamServiceServer ) . StreamResources ( & peerStreamServiceStreamResourcesServer { stream } )
}
type PeerStreamService_StreamResourcesServer interface {
Send ( * ReplicationMessage ) error
Recv ( ) ( * ReplicationMessage , error )
grpc . ServerStream
}
type peerStreamServiceStreamResourcesServer struct {
grpc . ServerStream
}
func ( x * peerStreamServiceStreamResourcesServer ) Send ( m * ReplicationMessage ) error {
return x . ServerStream . SendMsg ( m )
}
func ( x * peerStreamServiceStreamResourcesServer ) Recv ( ) ( * ReplicationMessage , error ) {
m := new ( ReplicationMessage )
if err := x . ServerStream . RecvMsg ( m ) ; err != nil {
return nil , err
}
return m , nil
}
2022-08-01 14:33:18 +00:00
func _PeerStreamService_ExchangeSecret_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( ExchangeSecretRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( PeerStreamServiceServer ) . ExchangeSecret ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : "/hashicorp.consul.internal.peerstream.PeerStreamService/ExchangeSecret" ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( PeerStreamServiceServer ) . ExchangeSecret ( ctx , req . ( * ExchangeSecretRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
2022-07-08 17:01:13 +00:00
// PeerStreamService_ServiceDesc is the grpc.ServiceDesc for PeerStreamService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var PeerStreamService_ServiceDesc = grpc . ServiceDesc {
2022-07-13 16:03:27 +00:00
ServiceName : "hashicorp.consul.internal.peerstream.PeerStreamService" ,
2022-07-08 17:01:13 +00:00
HandlerType : ( * PeerStreamServiceServer ) ( nil ) ,
2022-08-01 14:33:18 +00:00
Methods : [ ] grpc . MethodDesc {
{
MethodName : "ExchangeSecret" ,
Handler : _PeerStreamService_ExchangeSecret_Handler ,
} ,
} ,
2022-07-08 17:01:13 +00:00
Streams : [ ] grpc . StreamDesc {
{
StreamName : "StreamResources" ,
Handler : _PeerStreamService_StreamResources_Handler ,
ServerStreams : true ,
ClientStreams : true ,
} ,
} ,
2023-02-17 21:14:46 +00:00
Metadata : "private/pbpeerstream/peerstream.proto" ,
2022-07-08 17:01:13 +00:00
}