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