@dedcinema/contracts 1.1.4 → 1.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,425 @@
1
+ // Code generated by protoc-gen-go. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-go v1.36.11
4
+ // protoc v3.12.4
5
+ // source: media.proto
6
+
7
+ package media_media
8
+
9
+ import (
10
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
11
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
12
+ reflect "reflect"
13
+ sync "sync"
14
+ unsafe "unsafe"
15
+ )
16
+
17
+ const (
18
+ // Verify that this generated code is sufficiently up-to-date.
19
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
20
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
21
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
22
+ )
23
+
24
+ type UploadRequest struct {
25
+ state protoimpl.MessageState `protogen:"open.v1"`
26
+ FileName string `protobuf:"bytes,1,opt,name=file_name,json=fileName,proto3" json:"file_name,omitempty"`
27
+ Folder string `protobuf:"bytes,2,opt,name=folder,proto3" json:"folder,omitempty"`
28
+ ContentType string `protobuf:"bytes,3,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"`
29
+ Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"`
30
+ ResizeWidth *int32 `protobuf:"varint,5,opt,name=resize_width,json=resizeWidth,proto3,oneof" json:"resize_width,omitempty"`
31
+ ResizeHeight *int32 `protobuf:"varint,6,opt,name=resize_height,json=resizeHeight,proto3,oneof" json:"resize_height,omitempty"`
32
+ unknownFields protoimpl.UnknownFields
33
+ sizeCache protoimpl.SizeCache
34
+ }
35
+
36
+ func (x *UploadRequest) Reset() {
37
+ *x = UploadRequest{}
38
+ mi := &file_media_proto_msgTypes[0]
39
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
40
+ ms.StoreMessageInfo(mi)
41
+ }
42
+
43
+ func (x *UploadRequest) String() string {
44
+ return protoimpl.X.MessageStringOf(x)
45
+ }
46
+
47
+ func (*UploadRequest) ProtoMessage() {}
48
+
49
+ func (x *UploadRequest) ProtoReflect() protoreflect.Message {
50
+ mi := &file_media_proto_msgTypes[0]
51
+ if x != nil {
52
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
53
+ if ms.LoadMessageInfo() == nil {
54
+ ms.StoreMessageInfo(mi)
55
+ }
56
+ return ms
57
+ }
58
+ return mi.MessageOf(x)
59
+ }
60
+
61
+ // Deprecated: Use UploadRequest.ProtoReflect.Descriptor instead.
62
+ func (*UploadRequest) Descriptor() ([]byte, []int) {
63
+ return file_media_proto_rawDescGZIP(), []int{0}
64
+ }
65
+
66
+ func (x *UploadRequest) GetFileName() string {
67
+ if x != nil {
68
+ return x.FileName
69
+ }
70
+ return ""
71
+ }
72
+
73
+ func (x *UploadRequest) GetFolder() string {
74
+ if x != nil {
75
+ return x.Folder
76
+ }
77
+ return ""
78
+ }
79
+
80
+ func (x *UploadRequest) GetContentType() string {
81
+ if x != nil {
82
+ return x.ContentType
83
+ }
84
+ return ""
85
+ }
86
+
87
+ func (x *UploadRequest) GetData() []byte {
88
+ if x != nil {
89
+ return x.Data
90
+ }
91
+ return nil
92
+ }
93
+
94
+ func (x *UploadRequest) GetResizeWidth() int32 {
95
+ if x != nil && x.ResizeWidth != nil {
96
+ return *x.ResizeWidth
97
+ }
98
+ return 0
99
+ }
100
+
101
+ func (x *UploadRequest) GetResizeHeight() int32 {
102
+ if x != nil && x.ResizeHeight != nil {
103
+ return *x.ResizeHeight
104
+ }
105
+ return 0
106
+ }
107
+
108
+ type UploadResponse struct {
109
+ state protoimpl.MessageState `protogen:"open.v1"`
110
+ Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
111
+ unknownFields protoimpl.UnknownFields
112
+ sizeCache protoimpl.SizeCache
113
+ }
114
+
115
+ func (x *UploadResponse) Reset() {
116
+ *x = UploadResponse{}
117
+ mi := &file_media_proto_msgTypes[1]
118
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
119
+ ms.StoreMessageInfo(mi)
120
+ }
121
+
122
+ func (x *UploadResponse) String() string {
123
+ return protoimpl.X.MessageStringOf(x)
124
+ }
125
+
126
+ func (*UploadResponse) ProtoMessage() {}
127
+
128
+ func (x *UploadResponse) ProtoReflect() protoreflect.Message {
129
+ mi := &file_media_proto_msgTypes[1]
130
+ if x != nil {
131
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
132
+ if ms.LoadMessageInfo() == nil {
133
+ ms.StoreMessageInfo(mi)
134
+ }
135
+ return ms
136
+ }
137
+ return mi.MessageOf(x)
138
+ }
139
+
140
+ // Deprecated: Use UploadResponse.ProtoReflect.Descriptor instead.
141
+ func (*UploadResponse) Descriptor() ([]byte, []int) {
142
+ return file_media_proto_rawDescGZIP(), []int{1}
143
+ }
144
+
145
+ func (x *UploadResponse) GetKey() string {
146
+ if x != nil {
147
+ return x.Key
148
+ }
149
+ return ""
150
+ }
151
+
152
+ type GetRequest struct {
153
+ state protoimpl.MessageState `protogen:"open.v1"`
154
+ Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
155
+ unknownFields protoimpl.UnknownFields
156
+ sizeCache protoimpl.SizeCache
157
+ }
158
+
159
+ func (x *GetRequest) Reset() {
160
+ *x = GetRequest{}
161
+ mi := &file_media_proto_msgTypes[2]
162
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
163
+ ms.StoreMessageInfo(mi)
164
+ }
165
+
166
+ func (x *GetRequest) String() string {
167
+ return protoimpl.X.MessageStringOf(x)
168
+ }
169
+
170
+ func (*GetRequest) ProtoMessage() {}
171
+
172
+ func (x *GetRequest) ProtoReflect() protoreflect.Message {
173
+ mi := &file_media_proto_msgTypes[2]
174
+ if x != nil {
175
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
176
+ if ms.LoadMessageInfo() == nil {
177
+ ms.StoreMessageInfo(mi)
178
+ }
179
+ return ms
180
+ }
181
+ return mi.MessageOf(x)
182
+ }
183
+
184
+ // Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.
185
+ func (*GetRequest) Descriptor() ([]byte, []int) {
186
+ return file_media_proto_rawDescGZIP(), []int{2}
187
+ }
188
+
189
+ func (x *GetRequest) GetKey() string {
190
+ if x != nil {
191
+ return x.Key
192
+ }
193
+ return ""
194
+ }
195
+
196
+ type GetResponse struct {
197
+ state protoimpl.MessageState `protogen:"open.v1"`
198
+ Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
199
+ ContentType string `protobuf:"bytes,2,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"`
200
+ unknownFields protoimpl.UnknownFields
201
+ sizeCache protoimpl.SizeCache
202
+ }
203
+
204
+ func (x *GetResponse) Reset() {
205
+ *x = GetResponse{}
206
+ mi := &file_media_proto_msgTypes[3]
207
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
208
+ ms.StoreMessageInfo(mi)
209
+ }
210
+
211
+ func (x *GetResponse) String() string {
212
+ return protoimpl.X.MessageStringOf(x)
213
+ }
214
+
215
+ func (*GetResponse) ProtoMessage() {}
216
+
217
+ func (x *GetResponse) ProtoReflect() protoreflect.Message {
218
+ mi := &file_media_proto_msgTypes[3]
219
+ if x != nil {
220
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
221
+ if ms.LoadMessageInfo() == nil {
222
+ ms.StoreMessageInfo(mi)
223
+ }
224
+ return ms
225
+ }
226
+ return mi.MessageOf(x)
227
+ }
228
+
229
+ // Deprecated: Use GetResponse.ProtoReflect.Descriptor instead.
230
+ func (*GetResponse) Descriptor() ([]byte, []int) {
231
+ return file_media_proto_rawDescGZIP(), []int{3}
232
+ }
233
+
234
+ func (x *GetResponse) GetData() []byte {
235
+ if x != nil {
236
+ return x.Data
237
+ }
238
+ return nil
239
+ }
240
+
241
+ func (x *GetResponse) GetContentType() string {
242
+ if x != nil {
243
+ return x.ContentType
244
+ }
245
+ return ""
246
+ }
247
+
248
+ type DeleteRequest struct {
249
+ state protoimpl.MessageState `protogen:"open.v1"`
250
+ Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
251
+ unknownFields protoimpl.UnknownFields
252
+ sizeCache protoimpl.SizeCache
253
+ }
254
+
255
+ func (x *DeleteRequest) Reset() {
256
+ *x = DeleteRequest{}
257
+ mi := &file_media_proto_msgTypes[4]
258
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
259
+ ms.StoreMessageInfo(mi)
260
+ }
261
+
262
+ func (x *DeleteRequest) String() string {
263
+ return protoimpl.X.MessageStringOf(x)
264
+ }
265
+
266
+ func (*DeleteRequest) ProtoMessage() {}
267
+
268
+ func (x *DeleteRequest) ProtoReflect() protoreflect.Message {
269
+ mi := &file_media_proto_msgTypes[4]
270
+ if x != nil {
271
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
272
+ if ms.LoadMessageInfo() == nil {
273
+ ms.StoreMessageInfo(mi)
274
+ }
275
+ return ms
276
+ }
277
+ return mi.MessageOf(x)
278
+ }
279
+
280
+ // Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead.
281
+ func (*DeleteRequest) Descriptor() ([]byte, []int) {
282
+ return file_media_proto_rawDescGZIP(), []int{4}
283
+ }
284
+
285
+ func (x *DeleteRequest) GetKey() string {
286
+ if x != nil {
287
+ return x.Key
288
+ }
289
+ return ""
290
+ }
291
+
292
+ type DeleteResponse struct {
293
+ state protoimpl.MessageState `protogen:"open.v1"`
294
+ Ok bool `protobuf:"varint,1,opt,name=ok,proto3" json:"ok,omitempty"`
295
+ unknownFields protoimpl.UnknownFields
296
+ sizeCache protoimpl.SizeCache
297
+ }
298
+
299
+ func (x *DeleteResponse) Reset() {
300
+ *x = DeleteResponse{}
301
+ mi := &file_media_proto_msgTypes[5]
302
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
303
+ ms.StoreMessageInfo(mi)
304
+ }
305
+
306
+ func (x *DeleteResponse) String() string {
307
+ return protoimpl.X.MessageStringOf(x)
308
+ }
309
+
310
+ func (*DeleteResponse) ProtoMessage() {}
311
+
312
+ func (x *DeleteResponse) ProtoReflect() protoreflect.Message {
313
+ mi := &file_media_proto_msgTypes[5]
314
+ if x != nil {
315
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
316
+ if ms.LoadMessageInfo() == nil {
317
+ ms.StoreMessageInfo(mi)
318
+ }
319
+ return ms
320
+ }
321
+ return mi.MessageOf(x)
322
+ }
323
+
324
+ // Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead.
325
+ func (*DeleteResponse) Descriptor() ([]byte, []int) {
326
+ return file_media_proto_rawDescGZIP(), []int{5}
327
+ }
328
+
329
+ func (x *DeleteResponse) GetOk() bool {
330
+ if x != nil {
331
+ return x.Ok
332
+ }
333
+ return false
334
+ }
335
+
336
+ var File_media_proto protoreflect.FileDescriptor
337
+
338
+ const file_media_proto_rawDesc = "" +
339
+ "\n" +
340
+ "\vmedia.proto\x12\bmedia.v1\"\xf0\x01\n" +
341
+ "\rUploadRequest\x12\x1b\n" +
342
+ "\tfile_name\x18\x01 \x01(\tR\bfileName\x12\x16\n" +
343
+ "\x06folder\x18\x02 \x01(\tR\x06folder\x12!\n" +
344
+ "\fcontent_type\x18\x03 \x01(\tR\vcontentType\x12\x12\n" +
345
+ "\x04data\x18\x04 \x01(\fR\x04data\x12&\n" +
346
+ "\fresize_width\x18\x05 \x01(\x05H\x00R\vresizeWidth\x88\x01\x01\x12(\n" +
347
+ "\rresize_height\x18\x06 \x01(\x05H\x01R\fresizeHeight\x88\x01\x01B\x0f\n" +
348
+ "\r_resize_widthB\x10\n" +
349
+ "\x0e_resize_height\"\"\n" +
350
+ "\x0eUploadResponse\x12\x10\n" +
351
+ "\x03key\x18\x01 \x01(\tR\x03key\"\x1e\n" +
352
+ "\n" +
353
+ "GetRequest\x12\x10\n" +
354
+ "\x03key\x18\x01 \x01(\tR\x03key\"D\n" +
355
+ "\vGetResponse\x12\x12\n" +
356
+ "\x04data\x18\x01 \x01(\fR\x04data\x12!\n" +
357
+ "\fcontent_type\x18\x02 \x01(\tR\vcontentType\"!\n" +
358
+ "\rDeleteRequest\x12\x10\n" +
359
+ "\x03key\x18\x01 \x01(\tR\x03key\" \n" +
360
+ "\x0eDeleteResponse\x12\x0e\n" +
361
+ "\x02ok\x18\x01 \x01(\bR\x02ok2\xbc\x01\n" +
362
+ "\fMediaService\x12;\n" +
363
+ "\x06Upload\x12\x17.media.v1.UploadRequest\x1a\x18.media.v1.UploadResponse\x122\n" +
364
+ "\x03Get\x12\x14.media.v1.GetRequest\x1a\x15.media.v1.GetResponse\x12;\n" +
365
+ "\x06Delete\x12\x17.media.v1.DeleteRequest\x1a\x18.media.v1.DeleteResponseB5P\x01Z1github.com/dedcinema/contracts/gen/go/media:mediab\x06proto3"
366
+
367
+ var (
368
+ file_media_proto_rawDescOnce sync.Once
369
+ file_media_proto_rawDescData []byte
370
+ )
371
+
372
+ func file_media_proto_rawDescGZIP() []byte {
373
+ file_media_proto_rawDescOnce.Do(func() {
374
+ file_media_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_media_proto_rawDesc), len(file_media_proto_rawDesc)))
375
+ })
376
+ return file_media_proto_rawDescData
377
+ }
378
+
379
+ var file_media_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
380
+ var file_media_proto_goTypes = []any{
381
+ (*UploadRequest)(nil), // 0: media.v1.UploadRequest
382
+ (*UploadResponse)(nil), // 1: media.v1.UploadResponse
383
+ (*GetRequest)(nil), // 2: media.v1.GetRequest
384
+ (*GetResponse)(nil), // 3: media.v1.GetResponse
385
+ (*DeleteRequest)(nil), // 4: media.v1.DeleteRequest
386
+ (*DeleteResponse)(nil), // 5: media.v1.DeleteResponse
387
+ }
388
+ var file_media_proto_depIdxs = []int32{
389
+ 0, // 0: media.v1.MediaService.Upload:input_type -> media.v1.UploadRequest
390
+ 2, // 1: media.v1.MediaService.Get:input_type -> media.v1.GetRequest
391
+ 4, // 2: media.v1.MediaService.Delete:input_type -> media.v1.DeleteRequest
392
+ 1, // 3: media.v1.MediaService.Upload:output_type -> media.v1.UploadResponse
393
+ 3, // 4: media.v1.MediaService.Get:output_type -> media.v1.GetResponse
394
+ 5, // 5: media.v1.MediaService.Delete:output_type -> media.v1.DeleteResponse
395
+ 3, // [3:6] is the sub-list for method output_type
396
+ 0, // [0:3] is the sub-list for method input_type
397
+ 0, // [0:0] is the sub-list for extension type_name
398
+ 0, // [0:0] is the sub-list for extension extendee
399
+ 0, // [0:0] is the sub-list for field type_name
400
+ }
401
+
402
+ func init() { file_media_proto_init() }
403
+ func file_media_proto_init() {
404
+ if File_media_proto != nil {
405
+ return
406
+ }
407
+ file_media_proto_msgTypes[0].OneofWrappers = []any{}
408
+ type x struct{}
409
+ out := protoimpl.TypeBuilder{
410
+ File: protoimpl.DescBuilder{
411
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
412
+ RawDescriptor: unsafe.Slice(unsafe.StringData(file_media_proto_rawDesc), len(file_media_proto_rawDesc)),
413
+ NumEnums: 0,
414
+ NumMessages: 6,
415
+ NumExtensions: 0,
416
+ NumServices: 1,
417
+ },
418
+ GoTypes: file_media_proto_goTypes,
419
+ DependencyIndexes: file_media_proto_depIdxs,
420
+ MessageInfos: file_media_proto_msgTypes,
421
+ }.Build()
422
+ File_media_proto = out.File
423
+ file_media_proto_goTypes = nil
424
+ file_media_proto_depIdxs = nil
425
+ }
@@ -0,0 +1,197 @@
1
+ // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
2
+ // versions:
3
+ // - protoc-gen-go-grpc v1.6.1
4
+ // - protoc v3.12.4
5
+ // source: media.proto
6
+
7
+ package media_media
8
+
9
+ import (
10
+ context "context"
11
+ grpc "google.golang.org/grpc"
12
+ codes "google.golang.org/grpc/codes"
13
+ status "google.golang.org/grpc/status"
14
+ )
15
+
16
+ // This is a compile-time assertion to ensure that this generated file
17
+ // is compatible with the grpc package it is being compiled against.
18
+ // Requires gRPC-Go v1.64.0 or later.
19
+ const _ = grpc.SupportPackageIsVersion9
20
+
21
+ const (
22
+ MediaService_Upload_FullMethodName = "/media.v1.MediaService/Upload"
23
+ MediaService_Get_FullMethodName = "/media.v1.MediaService/Get"
24
+ MediaService_Delete_FullMethodName = "/media.v1.MediaService/Delete"
25
+ )
26
+
27
+ // MediaServiceClient is the client API for MediaService service.
28
+ //
29
+ // 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.
30
+ type MediaServiceClient interface {
31
+ Upload(ctx context.Context, in *UploadRequest, opts ...grpc.CallOption) (*UploadResponse, error)
32
+ Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error)
33
+ Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error)
34
+ }
35
+
36
+ type mediaServiceClient struct {
37
+ cc grpc.ClientConnInterface
38
+ }
39
+
40
+ func NewMediaServiceClient(cc grpc.ClientConnInterface) MediaServiceClient {
41
+ return &mediaServiceClient{cc}
42
+ }
43
+
44
+ func (c *mediaServiceClient) Upload(ctx context.Context, in *UploadRequest, opts ...grpc.CallOption) (*UploadResponse, error) {
45
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
46
+ out := new(UploadResponse)
47
+ err := c.cc.Invoke(ctx, MediaService_Upload_FullMethodName, in, out, cOpts...)
48
+ if err != nil {
49
+ return nil, err
50
+ }
51
+ return out, nil
52
+ }
53
+
54
+ func (c *mediaServiceClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) {
55
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
56
+ out := new(GetResponse)
57
+ err := c.cc.Invoke(ctx, MediaService_Get_FullMethodName, in, out, cOpts...)
58
+ if err != nil {
59
+ return nil, err
60
+ }
61
+ return out, nil
62
+ }
63
+
64
+ func (c *mediaServiceClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) {
65
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
66
+ out := new(DeleteResponse)
67
+ err := c.cc.Invoke(ctx, MediaService_Delete_FullMethodName, in, out, cOpts...)
68
+ if err != nil {
69
+ return nil, err
70
+ }
71
+ return out, nil
72
+ }
73
+
74
+ // MediaServiceServer is the server API for MediaService service.
75
+ // All implementations must embed UnimplementedMediaServiceServer
76
+ // for forward compatibility.
77
+ type MediaServiceServer interface {
78
+ Upload(context.Context, *UploadRequest) (*UploadResponse, error)
79
+ Get(context.Context, *GetRequest) (*GetResponse, error)
80
+ Delete(context.Context, *DeleteRequest) (*DeleteResponse, error)
81
+ mustEmbedUnimplementedMediaServiceServer()
82
+ }
83
+
84
+ // UnimplementedMediaServiceServer must be embedded to have
85
+ // forward compatible implementations.
86
+ //
87
+ // NOTE: this should be embedded by value instead of pointer to avoid a nil
88
+ // pointer dereference when methods are called.
89
+ type UnimplementedMediaServiceServer struct{}
90
+
91
+ func (UnimplementedMediaServiceServer) Upload(context.Context, *UploadRequest) (*UploadResponse, error) {
92
+ return nil, status.Error(codes.Unimplemented, "method Upload not implemented")
93
+ }
94
+ func (UnimplementedMediaServiceServer) Get(context.Context, *GetRequest) (*GetResponse, error) {
95
+ return nil, status.Error(codes.Unimplemented, "method Get not implemented")
96
+ }
97
+ func (UnimplementedMediaServiceServer) Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) {
98
+ return nil, status.Error(codes.Unimplemented, "method Delete not implemented")
99
+ }
100
+ func (UnimplementedMediaServiceServer) mustEmbedUnimplementedMediaServiceServer() {}
101
+ func (UnimplementedMediaServiceServer) testEmbeddedByValue() {}
102
+
103
+ // UnsafeMediaServiceServer may be embedded to opt out of forward compatibility for this service.
104
+ // Use of this interface is not recommended, as added methods to MediaServiceServer will
105
+ // result in compilation errors.
106
+ type UnsafeMediaServiceServer interface {
107
+ mustEmbedUnimplementedMediaServiceServer()
108
+ }
109
+
110
+ func RegisterMediaServiceServer(s grpc.ServiceRegistrar, srv MediaServiceServer) {
111
+ // If the following call panics, it indicates UnimplementedMediaServiceServer was
112
+ // embedded by pointer and is nil. This will cause panics if an
113
+ // unimplemented method is ever invoked, so we test this at initialization
114
+ // time to prevent it from happening at runtime later due to I/O.
115
+ if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
116
+ t.testEmbeddedByValue()
117
+ }
118
+ s.RegisterService(&MediaService_ServiceDesc, srv)
119
+ }
120
+
121
+ func _MediaService_Upload_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
122
+ in := new(UploadRequest)
123
+ if err := dec(in); err != nil {
124
+ return nil, err
125
+ }
126
+ if interceptor == nil {
127
+ return srv.(MediaServiceServer).Upload(ctx, in)
128
+ }
129
+ info := &grpc.UnaryServerInfo{
130
+ Server: srv,
131
+ FullMethod: MediaService_Upload_FullMethodName,
132
+ }
133
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
134
+ return srv.(MediaServiceServer).Upload(ctx, req.(*UploadRequest))
135
+ }
136
+ return interceptor(ctx, in, info, handler)
137
+ }
138
+
139
+ func _MediaService_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
140
+ in := new(GetRequest)
141
+ if err := dec(in); err != nil {
142
+ return nil, err
143
+ }
144
+ if interceptor == nil {
145
+ return srv.(MediaServiceServer).Get(ctx, in)
146
+ }
147
+ info := &grpc.UnaryServerInfo{
148
+ Server: srv,
149
+ FullMethod: MediaService_Get_FullMethodName,
150
+ }
151
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
152
+ return srv.(MediaServiceServer).Get(ctx, req.(*GetRequest))
153
+ }
154
+ return interceptor(ctx, in, info, handler)
155
+ }
156
+
157
+ func _MediaService_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
158
+ in := new(DeleteRequest)
159
+ if err := dec(in); err != nil {
160
+ return nil, err
161
+ }
162
+ if interceptor == nil {
163
+ return srv.(MediaServiceServer).Delete(ctx, in)
164
+ }
165
+ info := &grpc.UnaryServerInfo{
166
+ Server: srv,
167
+ FullMethod: MediaService_Delete_FullMethodName,
168
+ }
169
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
170
+ return srv.(MediaServiceServer).Delete(ctx, req.(*DeleteRequest))
171
+ }
172
+ return interceptor(ctx, in, info, handler)
173
+ }
174
+
175
+ // MediaService_ServiceDesc is the grpc.ServiceDesc for MediaService service.
176
+ // It's only intended for direct use with grpc.RegisterService,
177
+ // and not to be introspected or modified (even as a copy)
178
+ var MediaService_ServiceDesc = grpc.ServiceDesc{
179
+ ServiceName: "media.v1.MediaService",
180
+ HandlerType: (*MediaServiceServer)(nil),
181
+ Methods: []grpc.MethodDesc{
182
+ {
183
+ MethodName: "Upload",
184
+ Handler: _MediaService_Upload_Handler,
185
+ },
186
+ {
187
+ MethodName: "Get",
188
+ Handler: _MediaService_Get_Handler,
189
+ },
190
+ {
191
+ MethodName: "Delete",
192
+ Handler: _MediaService_Delete_Handler,
193
+ },
194
+ },
195
+ Streams: []grpc.StreamDesc{},
196
+ Metadata: "media.proto",
197
+ }
package/gen/ts/users.ts CHANGED
@@ -29,6 +29,7 @@ export interface CreateUserResponse {
29
29
  export interface PatchUserRequest {
30
30
  userId: string;
31
31
  name?: string | undefined;
32
+ avatar?: string | undefined;
32
33
  }
33
34
 
34
35
  export interface PatchUserResponse {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dedcinema/contracts",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "description": "Protobuf definition and generated TypeScript types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
package/proto/users.proto CHANGED
@@ -29,6 +29,7 @@ message PatchUserRequest {
29
29
  string user_id = 1;
30
30
 
31
31
  optional string name = 2;
32
+ optional string avatar = 3;
32
33
  }
33
34
 
34
35
  message PatchUserResponse {