diff --git a/gen/go/media/media.pb.go b/gen/go/media/media.pb.go deleted file mode 100644 index e5b50e4..0000000 --- a/gen/go/media/media.pb.go +++ /dev/null @@ -1,425 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11 -// protoc v6.33.4 -// source: media.proto - -package media - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type UploadRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - FileName string `protobuf:"bytes,1,opt,name=file_name,json=fileName,proto3" json:"file_name,omitempty"` - Folder string `protobuf:"bytes,2,opt,name=folder,proto3" json:"folder,omitempty"` - ContentType string `protobuf:"bytes,3,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"` - Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` - ResizeWidth *int32 `protobuf:"varint,5,opt,name=resize_width,json=resizeWidth,proto3,oneof" json:"resize_width,omitempty"` - ResizeHeight *int32 `protobuf:"varint,6,opt,name=resize_height,json=resizeHeight,proto3,oneof" json:"resize_height,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UploadRequest) Reset() { - *x = UploadRequest{} - mi := &file_media_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UploadRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UploadRequest) ProtoMessage() {} - -func (x *UploadRequest) ProtoReflect() protoreflect.Message { - mi := &file_media_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UploadRequest.ProtoReflect.Descriptor instead. -func (*UploadRequest) Descriptor() ([]byte, []int) { - return file_media_proto_rawDescGZIP(), []int{0} -} - -func (x *UploadRequest) GetFileName() string { - if x != nil { - return x.FileName - } - return "" -} - -func (x *UploadRequest) GetFolder() string { - if x != nil { - return x.Folder - } - return "" -} - -func (x *UploadRequest) GetContentType() string { - if x != nil { - return x.ContentType - } - return "" -} - -func (x *UploadRequest) GetData() []byte { - if x != nil { - return x.Data - } - return nil -} - -func (x *UploadRequest) GetResizeWidth() int32 { - if x != nil && x.ResizeWidth != nil { - return *x.ResizeWidth - } - return 0 -} - -func (x *UploadRequest) GetResizeHeight() int32 { - if x != nil && x.ResizeHeight != nil { - return *x.ResizeHeight - } - return 0 -} - -type UploadResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UploadResponse) Reset() { - *x = UploadResponse{} - mi := &file_media_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UploadResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UploadResponse) ProtoMessage() {} - -func (x *UploadResponse) ProtoReflect() protoreflect.Message { - mi := &file_media_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UploadResponse.ProtoReflect.Descriptor instead. -func (*UploadResponse) Descriptor() ([]byte, []int) { - return file_media_proto_rawDescGZIP(), []int{1} -} - -func (x *UploadResponse) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -type GetRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetRequest) Reset() { - *x = GetRequest{} - mi := &file_media_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRequest) ProtoMessage() {} - -func (x *GetRequest) ProtoReflect() protoreflect.Message { - mi := &file_media_proto_msgTypes[2] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetRequest.ProtoReflect.Descriptor instead. -func (*GetRequest) Descriptor() ([]byte, []int) { - return file_media_proto_rawDescGZIP(), []int{2} -} - -func (x *GetRequest) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -type GetResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` - ContentType string `protobuf:"bytes,2,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetResponse) Reset() { - *x = GetResponse{} - mi := &file_media_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetResponse) ProtoMessage() {} - -func (x *GetResponse) ProtoReflect() protoreflect.Message { - mi := &file_media_proto_msgTypes[3] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetResponse.ProtoReflect.Descriptor instead. -func (*GetResponse) Descriptor() ([]byte, []int) { - return file_media_proto_rawDescGZIP(), []int{3} -} - -func (x *GetResponse) GetData() []byte { - if x != nil { - return x.Data - } - return nil -} - -func (x *GetResponse) GetContentType() string { - if x != nil { - return x.ContentType - } - return "" -} - -type DeleteRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DeleteRequest) Reset() { - *x = DeleteRequest{} - mi := &file_media_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DeleteRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteRequest) ProtoMessage() {} - -func (x *DeleteRequest) ProtoReflect() protoreflect.Message { - mi := &file_media_proto_msgTypes[4] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead. -func (*DeleteRequest) Descriptor() ([]byte, []int) { - return file_media_proto_rawDescGZIP(), []int{4} -} - -func (x *DeleteRequest) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -type DeleteResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Ok bool `protobuf:"varint,1,opt,name=ok,proto3" json:"ok,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DeleteResponse) Reset() { - *x = DeleteResponse{} - mi := &file_media_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DeleteResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteResponse) ProtoMessage() {} - -func (x *DeleteResponse) ProtoReflect() protoreflect.Message { - mi := &file_media_proto_msgTypes[5] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead. -func (*DeleteResponse) Descriptor() ([]byte, []int) { - return file_media_proto_rawDescGZIP(), []int{5} -} - -func (x *DeleteResponse) GetOk() bool { - if x != nil { - return x.Ok - } - return false -} - -var File_media_proto protoreflect.FileDescriptor - -const file_media_proto_rawDesc = "" + - "\n" + - "\vmedia.proto\x12\bmedia.v1\"\xf0\x01\n" + - "\rUploadRequest\x12\x1b\n" + - "\tfile_name\x18\x01 \x01(\tR\bfileName\x12\x16\n" + - "\x06folder\x18\x02 \x01(\tR\x06folder\x12!\n" + - "\fcontent_type\x18\x03 \x01(\tR\vcontentType\x12\x12\n" + - "\x04data\x18\x04 \x01(\fR\x04data\x12&\n" + - "\fresize_width\x18\x05 \x01(\x05H\x00R\vresizeWidth\x88\x01\x01\x12(\n" + - "\rresize_height\x18\x06 \x01(\x05H\x01R\fresizeHeight\x88\x01\x01B\x0f\n" + - "\r_resize_widthB\x10\n" + - "\x0e_resize_height\"\"\n" + - "\x0eUploadResponse\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\"\x1e\n" + - "\n" + - "GetRequest\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\"D\n" + - "\vGetResponse\x12\x12\n" + - "\x04data\x18\x01 \x01(\fR\x04data\x12!\n" + - "\fcontent_type\x18\x02 \x01(\tR\vcontentType\"!\n" + - "\rDeleteRequest\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\" \n" + - "\x0eDeleteResponse\x12\x0e\n" + - "\x02ok\x18\x01 \x01(\bR\x02ok2\xbc\x01\n" + - "\fMediaService\x12;\n" + - "\x06Upload\x12\x17.media.v1.UploadRequest\x1a\x18.media.v1.UploadResponse\x122\n" + - "\x03Get\x12\x14.media.v1.GetRequest\x1a\x15.media.v1.GetResponse\x12;\n" + - "\x06Delete\x12\x17.media.v1.DeleteRequest\x1a\x18.media.v1.DeleteResponseB;P\x01Z7git.ksv741.keenetic.pro/teacinema/contracts/media;mediab\x06proto3" - -var ( - file_media_proto_rawDescOnce sync.Once - file_media_proto_rawDescData []byte -) - -func file_media_proto_rawDescGZIP() []byte { - file_media_proto_rawDescOnce.Do(func() { - file_media_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_media_proto_rawDesc), len(file_media_proto_rawDesc))) - }) - return file_media_proto_rawDescData -} - -var file_media_proto_msgTypes = make([]protoimpl.MessageInfo, 6) -var file_media_proto_goTypes = []any{ - (*UploadRequest)(nil), // 0: media.v1.UploadRequest - (*UploadResponse)(nil), // 1: media.v1.UploadResponse - (*GetRequest)(nil), // 2: media.v1.GetRequest - (*GetResponse)(nil), // 3: media.v1.GetResponse - (*DeleteRequest)(nil), // 4: media.v1.DeleteRequest - (*DeleteResponse)(nil), // 5: media.v1.DeleteResponse -} -var file_media_proto_depIdxs = []int32{ - 0, // 0: media.v1.MediaService.Upload:input_type -> media.v1.UploadRequest - 2, // 1: media.v1.MediaService.Get:input_type -> media.v1.GetRequest - 4, // 2: media.v1.MediaService.Delete:input_type -> media.v1.DeleteRequest - 1, // 3: media.v1.MediaService.Upload:output_type -> media.v1.UploadResponse - 3, // 4: media.v1.MediaService.Get:output_type -> media.v1.GetResponse - 5, // 5: media.v1.MediaService.Delete:output_type -> media.v1.DeleteResponse - 3, // [3:6] is the sub-list for method output_type - 0, // [0:3] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_media_proto_init() } -func file_media_proto_init() { - if File_media_proto != nil { - return - } - file_media_proto_msgTypes[0].OneofWrappers = []any{} - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_media_proto_rawDesc), len(file_media_proto_rawDesc)), - NumEnums: 0, - NumMessages: 6, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_media_proto_goTypes, - DependencyIndexes: file_media_proto_depIdxs, - MessageInfos: file_media_proto_msgTypes, - }.Build() - File_media_proto = out.File - file_media_proto_goTypes = nil - file_media_proto_depIdxs = nil -} diff --git a/gen/go/media/media_grpc.pb.go b/gen/go/media/media_grpc.pb.go deleted file mode 100644 index 4256a67..0000000 --- a/gen/go/media/media_grpc.pb.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.6.1 -// - protoc v6.33.4 -// source: media.proto - -package media - -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. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - MediaService_Upload_FullMethodName = "/media.v1.MediaService/Upload" - MediaService_Get_FullMethodName = "/media.v1.MediaService/Get" - MediaService_Delete_FullMethodName = "/media.v1.MediaService/Delete" -) - -// MediaServiceClient is the client API for MediaService service. -// -// 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. -type MediaServiceClient interface { - Upload(ctx context.Context, in *UploadRequest, opts ...grpc.CallOption) (*UploadResponse, error) - Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) - Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) -} - -type mediaServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewMediaServiceClient(cc grpc.ClientConnInterface) MediaServiceClient { - return &mediaServiceClient{cc} -} - -func (c *mediaServiceClient) Upload(ctx context.Context, in *UploadRequest, opts ...grpc.CallOption) (*UploadResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(UploadResponse) - err := c.cc.Invoke(ctx, MediaService_Upload_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *mediaServiceClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetResponse) - err := c.cc.Invoke(ctx, MediaService_Get_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *mediaServiceClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(DeleteResponse) - err := c.cc.Invoke(ctx, MediaService_Delete_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MediaServiceServer is the server API for MediaService service. -// All implementations must embed UnimplementedMediaServiceServer -// for forward compatibility. -type MediaServiceServer interface { - Upload(context.Context, *UploadRequest) (*UploadResponse, error) - Get(context.Context, *GetRequest) (*GetResponse, error) - Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) - mustEmbedUnimplementedMediaServiceServer() -} - -// UnimplementedMediaServiceServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedMediaServiceServer struct{} - -func (UnimplementedMediaServiceServer) Upload(context.Context, *UploadRequest) (*UploadResponse, error) { - return nil, status.Error(codes.Unimplemented, "method Upload not implemented") -} -func (UnimplementedMediaServiceServer) Get(context.Context, *GetRequest) (*GetResponse, error) { - return nil, status.Error(codes.Unimplemented, "method Get not implemented") -} -func (UnimplementedMediaServiceServer) Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) { - return nil, status.Error(codes.Unimplemented, "method Delete not implemented") -} -func (UnimplementedMediaServiceServer) mustEmbedUnimplementedMediaServiceServer() {} -func (UnimplementedMediaServiceServer) testEmbeddedByValue() {} - -// UnsafeMediaServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to MediaServiceServer will -// result in compilation errors. -type UnsafeMediaServiceServer interface { - mustEmbedUnimplementedMediaServiceServer() -} - -func RegisterMediaServiceServer(s grpc.ServiceRegistrar, srv MediaServiceServer) { - // If the following call panics, it indicates UnimplementedMediaServiceServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&MediaService_ServiceDesc, srv) -} - -func _MediaService_Upload_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UploadRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MediaServiceServer).Upload(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: MediaService_Upload_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MediaServiceServer).Upload(ctx, req.(*UploadRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _MediaService_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MediaServiceServer).Get(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: MediaService_Get_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MediaServiceServer).Get(ctx, req.(*GetRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _MediaService_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MediaServiceServer).Delete(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: MediaService_Delete_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MediaServiceServer).Delete(ctx, req.(*DeleteRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// MediaService_ServiceDesc is the grpc.ServiceDesc for MediaService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var MediaService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "media.v1.MediaService", - HandlerType: (*MediaServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Upload", - Handler: _MediaService_Upload_Handler, - }, - { - MethodName: "Get", - Handler: _MediaService_Get_Handler, - }, - { - MethodName: "Delete", - Handler: _MediaService_Delete_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "media.proto", -} diff --git a/scripts/generate_go.sh b/scripts/generate_go.sh old mode 100644 new mode 100755