github.com/cloudwan/edgelq-sdk@v1.15.4/meta/client/v1alpha2/resource/resource_service.pb.client.go (about) 1 // Code generated by protoc-gen-goten-client 2 // API: ResourceService 3 // DO NOT EDIT!!! 4 5 package resource_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 resource "github.com/cloudwan/edgelq-sdk/meta/resources/v1alpha2/resource" 17 ) 18 19 // Reference imports to suppress errors if they are not otherwise used. 20 var ( 21 _ = protoimpl.DescBuilder{} 22 _ = new(context.Context) 23 _ = grpc.ClientConn{} 24 ) 25 26 // make sure we're using proto imports 27 var ( 28 _ = &resource.Resource{} 29 ) 30 31 // This is a compile-time assertion to ensure that this generated file 32 // is compatible with the proto package it is being compiled against. 33 // A compilation error at this line likely means your copy of the 34 // proto package needs to be updated. 35 const ( 36 // Verify that this generated code is sufficiently up-to-date. 37 _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 38 // Verify that runtime/protoimpl is sufficiently up-to-date. 39 _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 40 ) 41 42 // This is a compile-time assertion to ensure that this generated file 43 // is compatible with the grpc package it is being compiled against. 44 const _ = grpc.SupportPackageIsVersion6 45 46 // ResourceServiceClient is the client API for ResourceService. 47 // 48 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. 49 type ResourceServiceClient interface { 50 GetResource(ctx context.Context, in *GetResourceRequest, opts ...grpc.CallOption) (*resource.Resource, error) 51 BatchGetResources(ctx context.Context, in *BatchGetResourcesRequest, opts ...grpc.CallOption) (*BatchGetResourcesResponse, error) 52 ListResources(ctx context.Context, in *ListResourcesRequest, opts ...grpc.CallOption) (*ListResourcesResponse, error) 53 WatchResource(ctx context.Context, in *WatchResourceRequest, opts ...grpc.CallOption) (WatchResourceClientStream, error) 54 WatchResources(ctx context.Context, in *WatchResourcesRequest, opts ...grpc.CallOption) (WatchResourcesClientStream, error) 55 } 56 57 type client struct { 58 cc grpc.ClientConnInterface 59 } 60 61 func NewResourceServiceClient(cc grpc.ClientConnInterface) ResourceServiceClient { 62 return &client{cc} 63 } 64 65 func (c *client) GetResource(ctx context.Context, in *GetResourceRequest, opts ...grpc.CallOption) (*resource.Resource, error) { 66 out := new(resource.Resource) 67 err := c.cc.Invoke(ctx, "/ntt.meta.v1alpha2.ResourceService/GetResource", in, out, opts...) 68 if err != nil { 69 return nil, err 70 } 71 return out, nil 72 } 73 74 func (c *client) BatchGetResources(ctx context.Context, in *BatchGetResourcesRequest, opts ...grpc.CallOption) (*BatchGetResourcesResponse, error) { 75 out := new(BatchGetResourcesResponse) 76 err := c.cc.Invoke(ctx, "/ntt.meta.v1alpha2.ResourceService/BatchGetResources", in, out, opts...) 77 if err != nil { 78 return nil, err 79 } 80 return out, nil 81 } 82 83 func (c *client) ListResources(ctx context.Context, in *ListResourcesRequest, opts ...grpc.CallOption) (*ListResourcesResponse, error) { 84 out := new(ListResourcesResponse) 85 err := c.cc.Invoke(ctx, "/ntt.meta.v1alpha2.ResourceService/ListResources", in, out, opts...) 86 if err != nil { 87 return nil, err 88 } 89 return out, nil 90 } 91 92 func (c *client) WatchResource(ctx context.Context, in *WatchResourceRequest, opts ...grpc.CallOption) (WatchResourceClientStream, error) { 93 stream, err := c.cc.NewStream(ctx, 94 &grpc.StreamDesc{ 95 StreamName: "WatchResource", 96 ServerStreams: true, 97 }, 98 "/ntt.meta.v1alpha2.ResourceService/WatchResource", opts...) 99 if err != nil { 100 return nil, err 101 } 102 x := &watchResourceWatchResourceClient{stream} 103 if err := x.ClientStream.SendMsg(in); err != nil { 104 return nil, err 105 } 106 if err := x.ClientStream.CloseSend(); err != nil { 107 return nil, err 108 } 109 return x, nil 110 } 111 112 type WatchResourceClientStream interface { 113 Recv() (*WatchResourceResponse, error) 114 grpc.ClientStream 115 } 116 117 type watchResourceWatchResourceClient struct { 118 grpc.ClientStream 119 } 120 121 func (x *watchResourceWatchResourceClient) Recv() (*WatchResourceResponse, error) { 122 m := new(WatchResourceResponse) 123 if err := x.ClientStream.RecvMsg(m); err != nil { 124 return nil, err 125 } 126 return m, nil 127 } 128 129 func (c *client) WatchResources(ctx context.Context, in *WatchResourcesRequest, opts ...grpc.CallOption) (WatchResourcesClientStream, error) { 130 stream, err := c.cc.NewStream(ctx, 131 &grpc.StreamDesc{ 132 StreamName: "WatchResources", 133 ServerStreams: true, 134 }, 135 "/ntt.meta.v1alpha2.ResourceService/WatchResources", opts...) 136 if err != nil { 137 return nil, err 138 } 139 x := &watchResourcesWatchResourcesClient{stream} 140 if err := x.ClientStream.SendMsg(in); err != nil { 141 return nil, err 142 } 143 if err := x.ClientStream.CloseSend(); err != nil { 144 return nil, err 145 } 146 return x, nil 147 } 148 149 type WatchResourcesClientStream interface { 150 Recv() (*WatchResourcesResponse, error) 151 grpc.ClientStream 152 } 153 154 type watchResourcesWatchResourcesClient struct { 155 grpc.ClientStream 156 } 157 158 func (x *watchResourcesWatchResourcesClient) Recv() (*WatchResourcesResponse, error) { 159 m := new(WatchResourcesResponse) 160 if err := x.ClientStream.RecvMsg(m); err != nil { 161 return nil, err 162 } 163 return m, nil 164 }