2022-11-28 23:01:03 +00:00
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
2023-03-09 02:48:16 +00:00
// - protoc-gen-go-grpc v1.3.0
// - protoc v4.22.1
2022-11-28 23:01:03 +00:00
// source: p2psentinel/sentinel.proto
package sentinel
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
2023-03-09 02:48:16 +00:00
const (
Sentinel_SubscribeGossip_FullMethodName = "/sentinel.Sentinel/SubscribeGossip"
Sentinel_SendRequest_FullMethodName = "/sentinel.Sentinel/SendRequest"
Sentinel_SetStatus_FullMethodName = "/sentinel.Sentinel/SetStatus"
Sentinel_GetPeers_FullMethodName = "/sentinel.Sentinel/GetPeers"
)
2022-11-28 23:01:03 +00:00
// SentinelClient is the client API for Sentinel 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 SentinelClient interface {
2022-12-05 02:55:18 +00:00
SubscribeGossip ( ctx context . Context , in * EmptyMessage , opts ... grpc . CallOption ) ( Sentinel_SubscribeGossipClient , error )
2022-11-28 23:01:03 +00:00
SendRequest ( ctx context . Context , in * RequestData , opts ... grpc . CallOption ) ( * ResponseData , error )
2022-12-05 02:55:18 +00:00
SetStatus ( ctx context . Context , in * Status , opts ... grpc . CallOption ) ( * EmptyMessage , error )
GetPeers ( ctx context . Context , in * EmptyMessage , opts ... grpc . CallOption ) ( * PeerCount , error )
2022-11-28 23:01:03 +00:00
}
type sentinelClient struct {
cc grpc . ClientConnInterface
}
func NewSentinelClient ( cc grpc . ClientConnInterface ) SentinelClient {
return & sentinelClient { cc }
}
2022-12-05 02:55:18 +00:00
func ( c * sentinelClient ) SubscribeGossip ( ctx context . Context , in * EmptyMessage , opts ... grpc . CallOption ) ( Sentinel_SubscribeGossipClient , error ) {
2023-03-09 02:48:16 +00:00
stream , err := c . cc . NewStream ( ctx , & Sentinel_ServiceDesc . Streams [ 0 ] , Sentinel_SubscribeGossip_FullMethodName , opts ... )
2022-11-28 23:01:03 +00:00
if err != nil {
return nil , err
}
x := & sentinelSubscribeGossipClient { 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
}
type Sentinel_SubscribeGossipClient interface {
Recv ( ) ( * GossipData , error )
grpc . ClientStream
}
type sentinelSubscribeGossipClient struct {
grpc . ClientStream
}
func ( x * sentinelSubscribeGossipClient ) Recv ( ) ( * GossipData , error ) {
m := new ( GossipData )
if err := x . ClientStream . RecvMsg ( m ) ; err != nil {
return nil , err
}
return m , nil
}
func ( c * sentinelClient ) SendRequest ( ctx context . Context , in * RequestData , opts ... grpc . CallOption ) ( * ResponseData , error ) {
out := new ( ResponseData )
2023-03-09 02:48:16 +00:00
err := c . cc . Invoke ( ctx , Sentinel_SendRequest_FullMethodName , in , out , opts ... )
2022-11-28 23:01:03 +00:00
if err != nil {
return nil , err
}
return out , nil
}
2022-12-05 02:55:18 +00:00
func ( c * sentinelClient ) SetStatus ( ctx context . Context , in * Status , opts ... grpc . CallOption ) ( * EmptyMessage , error ) {
out := new ( EmptyMessage )
2023-03-09 02:48:16 +00:00
err := c . cc . Invoke ( ctx , Sentinel_SetStatus_FullMethodName , in , out , opts ... )
2022-12-05 02:55:18 +00:00
if err != nil {
return nil , err
}
return out , nil
}
func ( c * sentinelClient ) GetPeers ( ctx context . Context , in * EmptyMessage , opts ... grpc . CallOption ) ( * PeerCount , error ) {
2022-11-28 23:01:03 +00:00
out := new ( PeerCount )
2023-03-09 02:48:16 +00:00
err := c . cc . Invoke ( ctx , Sentinel_GetPeers_FullMethodName , in , out , opts ... )
2022-11-28 23:01:03 +00:00
if err != nil {
return nil , err
}
return out , nil
}
// SentinelServer is the server API for Sentinel service.
// All implementations must embed UnimplementedSentinelServer
// for forward compatibility
type SentinelServer interface {
2022-12-05 02:55:18 +00:00
SubscribeGossip ( * EmptyMessage , Sentinel_SubscribeGossipServer ) error
2022-11-28 23:01:03 +00:00
SendRequest ( context . Context , * RequestData ) ( * ResponseData , error )
2022-12-05 02:55:18 +00:00
SetStatus ( context . Context , * Status ) ( * EmptyMessage , error )
GetPeers ( context . Context , * EmptyMessage ) ( * PeerCount , error )
2022-11-28 23:01:03 +00:00
mustEmbedUnimplementedSentinelServer ( )
}
// UnimplementedSentinelServer must be embedded to have forward compatible implementations.
type UnimplementedSentinelServer struct {
}
2022-12-05 02:55:18 +00:00
func ( UnimplementedSentinelServer ) SubscribeGossip ( * EmptyMessage , Sentinel_SubscribeGossipServer ) error {
2022-11-28 23:01:03 +00:00
return status . Errorf ( codes . Unimplemented , "method SubscribeGossip not implemented" )
}
func ( UnimplementedSentinelServer ) SendRequest ( context . Context , * RequestData ) ( * ResponseData , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method SendRequest not implemented" )
}
2022-12-05 02:55:18 +00:00
func ( UnimplementedSentinelServer ) SetStatus ( context . Context , * Status ) ( * EmptyMessage , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method SetStatus not implemented" )
}
func ( UnimplementedSentinelServer ) GetPeers ( context . Context , * EmptyMessage ) ( * PeerCount , error ) {
2022-11-28 23:01:03 +00:00
return nil , status . Errorf ( codes . Unimplemented , "method GetPeers not implemented" )
}
func ( UnimplementedSentinelServer ) mustEmbedUnimplementedSentinelServer ( ) { }
// UnsafeSentinelServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to SentinelServer will
// result in compilation errors.
type UnsafeSentinelServer interface {
mustEmbedUnimplementedSentinelServer ( )
}
func RegisterSentinelServer ( s grpc . ServiceRegistrar , srv SentinelServer ) {
s . RegisterService ( & Sentinel_ServiceDesc , srv )
}
func _Sentinel_SubscribeGossip_Handler ( srv interface { } , stream grpc . ServerStream ) error {
2022-12-05 02:55:18 +00:00
m := new ( EmptyMessage )
2022-11-28 23:01:03 +00:00
if err := stream . RecvMsg ( m ) ; err != nil {
return err
}
return srv . ( SentinelServer ) . SubscribeGossip ( m , & sentinelSubscribeGossipServer { stream } )
}
type Sentinel_SubscribeGossipServer interface {
Send ( * GossipData ) error
grpc . ServerStream
}
type sentinelSubscribeGossipServer struct {
grpc . ServerStream
}
func ( x * sentinelSubscribeGossipServer ) Send ( m * GossipData ) error {
return x . ServerStream . SendMsg ( m )
}
func _Sentinel_SendRequest_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( RequestData )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( SentinelServer ) . SendRequest ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
2023-03-09 02:48:16 +00:00
FullMethod : Sentinel_SendRequest_FullMethodName ,
2022-11-28 23:01:03 +00:00
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( SentinelServer ) . SendRequest ( ctx , req . ( * RequestData ) )
}
return interceptor ( ctx , in , info , handler )
}
2022-12-05 02:55:18 +00:00
func _Sentinel_SetStatus_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( Status )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( SentinelServer ) . SetStatus ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
2023-03-09 02:48:16 +00:00
FullMethod : Sentinel_SetStatus_FullMethodName ,
2022-12-05 02:55:18 +00:00
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( SentinelServer ) . SetStatus ( ctx , req . ( * Status ) )
}
return interceptor ( ctx , in , info , handler )
}
2022-11-28 23:01:03 +00:00
func _Sentinel_GetPeers_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
2022-12-05 02:55:18 +00:00
in := new ( EmptyMessage )
2022-11-28 23:01:03 +00:00
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( SentinelServer ) . GetPeers ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
2023-03-09 02:48:16 +00:00
FullMethod : Sentinel_GetPeers_FullMethodName ,
2022-11-28 23:01:03 +00:00
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
2022-12-05 02:55:18 +00:00
return srv . ( SentinelServer ) . GetPeers ( ctx , req . ( * EmptyMessage ) )
2022-11-28 23:01:03 +00:00
}
return interceptor ( ctx , in , info , handler )
}
// Sentinel_ServiceDesc is the grpc.ServiceDesc for Sentinel service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Sentinel_ServiceDesc = grpc . ServiceDesc {
ServiceName : "sentinel.Sentinel" ,
HandlerType : ( * SentinelServer ) ( nil ) ,
Methods : [ ] grpc . MethodDesc {
{
MethodName : "SendRequest" ,
Handler : _Sentinel_SendRequest_Handler ,
} ,
2022-12-05 02:55:18 +00:00
{
MethodName : "SetStatus" ,
Handler : _Sentinel_SetStatus_Handler ,
} ,
2022-11-28 23:01:03 +00:00
{
MethodName : "GetPeers" ,
Handler : _Sentinel_GetPeers_Handler ,
} ,
} ,
Streams : [ ] grpc . StreamDesc {
{
StreamName : "SubscribeGossip" ,
Handler : _Sentinel_SubscribeGossip_Handler ,
ServerStreams : true ,
} ,
} ,
Metadata : "p2psentinel/sentinel.proto" ,
}