2021-01-19 19:41:39 +03:00
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
2021-10-27 18:27:04 +03:00
package servicepb
2021-01-19 19:41:39 +03:00
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.
2021-03-22 09:00:44 +03:00
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc . SupportPackageIsVersion7
2021-01-19 19:41:39 +03:00
2021-10-27 18:47:36 +03:00
// BrokerServiceClient is the client API for BrokerService service.
2021-01-19 19:41:39 +03:00
//
// 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.
2021-10-27 18:47:36 +03:00
type BrokerServiceClient interface {
Publish ( ctx context . Context , in * PublishRequest , opts ... grpc . CallOption ) ( * PublishResponse , error )
BatchPublish ( ctx context . Context , in * BatchPublishRequest , opts ... grpc . CallOption ) ( * BatchPublishResponse , error )
Subscribe ( ctx context . Context , in * SubscribeRequest , opts ... grpc . CallOption ) ( BrokerService_SubscribeClient , error )
BatchSubscribe ( ctx context . Context , in * BatchSubscribeRequest , opts ... grpc . CallOption ) ( BrokerService_BatchSubscribeClient , error )
2021-01-19 19:41:39 +03:00
}
2021-10-27 18:47:36 +03:00
type brokerServiceClient struct {
2021-01-19 19:41:39 +03:00
cc grpc . ClientConnInterface
}
2021-10-27 18:47:36 +03:00
func NewBrokerServiceClient ( cc grpc . ClientConnInterface ) BrokerServiceClient {
return & brokerServiceClient { cc }
2021-01-19 19:41:39 +03:00
}
2021-10-27 18:47:36 +03:00
func ( c * brokerServiceClient ) Publish ( ctx context . Context , in * PublishRequest , opts ... grpc . CallOption ) ( * PublishResponse , error ) {
out := new ( PublishResponse )
err := c . cc . Invoke ( ctx , "/servicepb.BrokerService/Publish" , in , out , opts ... )
2021-01-19 19:41:39 +03:00
if err != nil {
return nil , err
}
return out , nil
}
2021-10-27 18:47:36 +03:00
func ( c * brokerServiceClient ) BatchPublish ( ctx context . Context , in * BatchPublishRequest , opts ... grpc . CallOption ) ( * BatchPublishResponse , error ) {
out := new ( BatchPublishResponse )
err := c . cc . Invoke ( ctx , "/servicepb.BrokerService/BatchPublish" , in , out , opts ... )
2021-01-19 19:41:39 +03:00
if err != nil {
return nil , err
}
2021-10-27 18:47:36 +03:00
return out , nil
}
func ( c * brokerServiceClient ) Subscribe ( ctx context . Context , in * SubscribeRequest , opts ... grpc . CallOption ) ( BrokerService_SubscribeClient , error ) {
stream , err := c . cc . NewStream ( ctx , & BrokerService_ServiceDesc . Streams [ 0 ] , "/servicepb.BrokerService/Subscribe" , opts ... )
if err != nil {
return nil , err
}
x := & brokerServiceSubscribeClient { 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 BrokerService_SubscribeClient interface {
Recv ( ) ( * Message , error )
grpc . ClientStream
}
type brokerServiceSubscribeClient struct {
grpc . ClientStream
}
func ( x * brokerServiceSubscribeClient ) Recv ( ) ( * Message , error ) {
m := new ( Message )
if err := x . ClientStream . RecvMsg ( m ) ; err != nil {
return nil , err
}
return m , nil
}
func ( c * brokerServiceClient ) BatchSubscribe ( ctx context . Context , in * BatchSubscribeRequest , opts ... grpc . CallOption ) ( BrokerService_BatchSubscribeClient , error ) {
stream , err := c . cc . NewStream ( ctx , & BrokerService_ServiceDesc . Streams [ 1 ] , "/servicepb.BrokerService/BatchSubscribe" , opts ... )
if err != nil {
return nil , err
}
x := & brokerServiceBatchSubscribeClient { stream }
2021-01-19 19:41:39 +03:00
if err := x . ClientStream . SendMsg ( in ) ; err != nil {
return nil , err
}
if err := x . ClientStream . CloseSend ( ) ; err != nil {
return nil , err
}
return x , nil
}
2021-10-27 18:47:36 +03:00
type BrokerService_BatchSubscribeClient interface {
2021-01-19 19:41:39 +03:00
Recv ( ) ( * Message , error )
grpc . ClientStream
}
2021-10-27 18:47:36 +03:00
type brokerServiceBatchSubscribeClient struct {
2021-01-19 19:41:39 +03:00
grpc . ClientStream
}
2021-10-27 18:47:36 +03:00
func ( x * brokerServiceBatchSubscribeClient ) Recv ( ) ( * Message , error ) {
2021-01-19 19:41:39 +03:00
m := new ( Message )
if err := x . ClientStream . RecvMsg ( m ) ; err != nil {
return nil , err
}
return m , nil
}
2021-10-27 18:47:36 +03:00
// BrokerServiceServer is the server API for BrokerService service.
// All implementations must embed UnimplementedBrokerServiceServer
2021-01-19 19:41:39 +03:00
// for forward compatibility
2021-10-27 18:47:36 +03:00
type BrokerServiceServer interface {
Publish ( context . Context , * PublishRequest ) ( * PublishResponse , error )
BatchPublish ( context . Context , * BatchPublishRequest ) ( * BatchPublishResponse , error )
Subscribe ( * SubscribeRequest , BrokerService_SubscribeServer ) error
BatchSubscribe ( * BatchSubscribeRequest , BrokerService_BatchSubscribeServer ) error
mustEmbedUnimplementedBrokerServiceServer ( )
2021-01-19 19:41:39 +03:00
}
2021-10-27 18:47:36 +03:00
// UnimplementedBrokerServiceServer must be embedded to have forward compatible implementations.
type UnimplementedBrokerServiceServer struct {
2021-01-19 19:41:39 +03:00
}
2021-10-27 18:47:36 +03:00
func ( UnimplementedBrokerServiceServer ) Publish ( context . Context , * PublishRequest ) ( * PublishResponse , error ) {
2021-01-19 19:41:39 +03:00
return nil , status . Errorf ( codes . Unimplemented , "method Publish not implemented" )
}
2021-10-27 18:47:36 +03:00
func ( UnimplementedBrokerServiceServer ) BatchPublish ( context . Context , * BatchPublishRequest ) ( * BatchPublishResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method BatchPublish not implemented" )
}
func ( UnimplementedBrokerServiceServer ) Subscribe ( * SubscribeRequest , BrokerService_SubscribeServer ) error {
2021-01-19 19:41:39 +03:00
return status . Errorf ( codes . Unimplemented , "method Subscribe not implemented" )
}
2021-10-27 18:47:36 +03:00
func ( UnimplementedBrokerServiceServer ) BatchSubscribe ( * BatchSubscribeRequest , BrokerService_BatchSubscribeServer ) error {
return status . Errorf ( codes . Unimplemented , "method BatchSubscribe not implemented" )
}
func ( UnimplementedBrokerServiceServer ) mustEmbedUnimplementedBrokerServiceServer ( ) { }
2021-01-19 19:41:39 +03:00
2021-10-27 18:47:36 +03:00
// UnsafeBrokerServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to BrokerServiceServer will
2021-03-22 09:00:44 +03:00
// result in compilation errors.
2021-10-27 18:47:36 +03:00
type UnsafeBrokerServiceServer interface {
mustEmbedUnimplementedBrokerServiceServer ( )
2021-03-22 09:00:44 +03:00
}
2021-10-27 18:47:36 +03:00
func RegisterBrokerServiceServer ( s grpc . ServiceRegistrar , srv BrokerServiceServer ) {
s . RegisterService ( & BrokerService_ServiceDesc , srv )
2021-01-19 19:41:39 +03:00
}
2021-10-27 18:47:36 +03:00
func _BrokerService_Publish_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
2021-01-19 19:41:39 +03:00
in := new ( PublishRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
2021-10-27 18:47:36 +03:00
return srv . ( BrokerServiceServer ) . Publish ( ctx , in )
2021-01-19 19:41:39 +03:00
}
info := & grpc . UnaryServerInfo {
Server : srv ,
2021-10-27 18:47:36 +03:00
FullMethod : "/servicepb.BrokerService/Publish" ,
2021-01-19 19:41:39 +03:00
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
2021-10-27 18:47:36 +03:00
return srv . ( BrokerServiceServer ) . Publish ( ctx , req . ( * PublishRequest ) )
2021-01-19 19:41:39 +03:00
}
return interceptor ( ctx , in , info , handler )
}
2021-10-27 18:47:36 +03:00
func _BrokerService_BatchPublish_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( BatchPublishRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( BrokerServiceServer ) . BatchPublish ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : "/servicepb.BrokerService/BatchPublish" ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( BrokerServiceServer ) . BatchPublish ( ctx , req . ( * BatchPublishRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
func _BrokerService_Subscribe_Handler ( srv interface { } , stream grpc . ServerStream ) error {
2021-01-19 19:41:39 +03:00
m := new ( SubscribeRequest )
if err := stream . RecvMsg ( m ) ; err != nil {
return err
}
2021-10-27 18:47:36 +03:00
return srv . ( BrokerServiceServer ) . Subscribe ( m , & brokerServiceSubscribeServer { stream } )
2021-01-19 19:41:39 +03:00
}
2021-10-27 18:47:36 +03:00
type BrokerService_SubscribeServer interface {
2021-01-19 19:41:39 +03:00
Send ( * Message ) error
grpc . ServerStream
}
2021-10-27 18:47:36 +03:00
type brokerServiceSubscribeServer struct {
2021-01-19 19:41:39 +03:00
grpc . ServerStream
}
2021-10-27 18:47:36 +03:00
func ( x * brokerServiceSubscribeServer ) Send ( m * Message ) error {
2021-01-19 19:41:39 +03:00
return x . ServerStream . SendMsg ( m )
}
2021-10-27 18:47:36 +03:00
func _BrokerService_BatchSubscribe_Handler ( srv interface { } , stream grpc . ServerStream ) error {
m := new ( BatchSubscribeRequest )
if err := stream . RecvMsg ( m ) ; err != nil {
return err
}
return srv . ( BrokerServiceServer ) . BatchSubscribe ( m , & brokerServiceBatchSubscribeServer { stream } )
}
type BrokerService_BatchSubscribeServer interface {
Send ( * Message ) error
grpc . ServerStream
}
type brokerServiceBatchSubscribeServer struct {
grpc . ServerStream
}
func ( x * brokerServiceBatchSubscribeServer ) Send ( m * Message ) error {
return x . ServerStream . SendMsg ( m )
}
// BrokerService_ServiceDesc is the grpc.ServiceDesc for BrokerService service.
2021-03-22 09:00:44 +03:00
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
2021-10-27 18:47:36 +03:00
var BrokerService_ServiceDesc = grpc . ServiceDesc {
ServiceName : "servicepb.BrokerService" ,
HandlerType : ( * BrokerServiceServer ) ( nil ) ,
2021-01-19 19:41:39 +03:00
Methods : [ ] grpc . MethodDesc {
{
MethodName : "Publish" ,
2021-10-27 18:47:36 +03:00
Handler : _BrokerService_Publish_Handler ,
} ,
{
MethodName : "BatchPublish" ,
Handler : _BrokerService_BatchPublish_Handler ,
2021-01-19 19:41:39 +03:00
} ,
} ,
Streams : [ ] grpc . StreamDesc {
{
StreamName : "Subscribe" ,
2021-10-27 18:47:36 +03:00
Handler : _BrokerService_Subscribe_Handler ,
ServerStreams : true ,
} ,
{
StreamName : "BatchSubscribe" ,
Handler : _BrokerService_BatchSubscribe_Handler ,
2021-01-19 19:41:39 +03:00
ServerStreams : true ,
} ,
} ,
Metadata : "broker.proto" ,
}