github.com/cloudwan/edgelq-sdk@v1.15.4/alerting/client/v1/edge_watch_service/edge_watch_service_service.pb.client.go (about)

     1  // Code generated by protoc-gen-goten-client
     2  // API: EdgeWatchServiceService
     3  // DO NOT EDIT!!!
     4  
     5  package edge_watch_service_client
     6  
     7  import (
     8  	"context"
     9  
    10  	"google.golang.org/grpc"
    11  	"google.golang.org/protobuf/runtime/protoimpl"
    12  )
    13  
    14  // proto imports
    15  import ()
    16  
    17  // Reference imports to suppress errors if they are not otherwise used.
    18  var (
    19  	_ = protoimpl.DescBuilder{}
    20  	_ = new(context.Context)
    21  	_ = grpc.ClientConn{}
    22  )
    23  
    24  // make sure we're using proto imports
    25  var ()
    26  
    27  // This is a compile-time assertion to ensure that this generated file
    28  // is compatible with the proto package it is being compiled against.
    29  // A compilation error at this line likely means your copy of the
    30  // proto package needs to be updated.
    31  const (
    32  	// Verify that this generated code is sufficiently up-to-date.
    33  	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
    34  	// Verify that runtime/protoimpl is sufficiently up-to-date.
    35  	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
    36  )
    37  
    38  // This is a compile-time assertion to ensure that this generated file
    39  // is compatible with the grpc package it is being compiled against.
    40  const _ = grpc.SupportPackageIsVersion6
    41  
    42  // EdgeWatchServiceServiceClient is the client API for EdgeWatchServiceService.
    43  //
    44  // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
    45  type EdgeWatchServiceServiceClient interface {
    46  	WatchAlertData(ctx context.Context, in *WatchAlertDataRequest, opts ...grpc.CallOption) (WatchAlertDataClientStream, error)
    47  }
    48  
    49  type client struct {
    50  	cc grpc.ClientConnInterface
    51  }
    52  
    53  func NewEdgeWatchServiceServiceClient(cc grpc.ClientConnInterface) EdgeWatchServiceServiceClient {
    54  	return &client{cc}
    55  }
    56  
    57  func (c *client) WatchAlertData(ctx context.Context, in *WatchAlertDataRequest, opts ...grpc.CallOption) (WatchAlertDataClientStream, error) {
    58  	stream, err := c.cc.NewStream(ctx,
    59  		&grpc.StreamDesc{
    60  			StreamName:    "WatchAlertData",
    61  			ServerStreams: true,
    62  		},
    63  		"/ntt.alerting.v1.EdgeWatchServiceService/WatchAlertData", opts...)
    64  	if err != nil {
    65  		return nil, err
    66  	}
    67  	x := &watchAlertDataWatchAlertDataClient{stream}
    68  	if err := x.ClientStream.SendMsg(in); err != nil {
    69  		return nil, err
    70  	}
    71  	if err := x.ClientStream.CloseSend(); err != nil {
    72  		return nil, err
    73  	}
    74  	return x, nil
    75  }
    76  
    77  type WatchAlertDataClientStream interface {
    78  	Recv() (*WatchAlertDataResponse, error)
    79  	grpc.ClientStream
    80  }
    81  
    82  type watchAlertDataWatchAlertDataClient struct {
    83  	grpc.ClientStream
    84  }
    85  
    86  func (x *watchAlertDataWatchAlertDataClient) Recv() (*WatchAlertDataResponse, error) {
    87  	m := new(WatchAlertDataResponse)
    88  	if err := x.ClientStream.RecvMsg(m); err != nil {
    89  		return nil, err
    90  	}
    91  	return m, nil
    92  }