This commit is contained in:
2025-03-24 21:45:12 +01:00
commit d640f5007f
19 changed files with 1325 additions and 0 deletions

32
thumbnail.proto Normal file
View File

@@ -0,0 +1,32 @@
syntax = "proto3";
package thumbnail_service;
option go_package = "./proto";
// Enum for the file type
enum FileType {
FILE_TYPE_UNSPECIFIED = 0; // Default value for unspecified file type
IMAGE = 1; // Image file
VIDEO = 2; // Video file
PDF = 3; // PDF file
}
// Service definition
service ThumbnailService {
rpc GenerateThumbnail(ThumbnailRequest) returns (ThumbnailResponse);
}
// Request message for generating thumbnails
message ThumbnailRequest {
bytes file_content = 1; // File content as bytes
FileType file_type = 2; // File type (image, video, pdf)
int32 max_width = 3; // Optional max width for resizing (0 means no limit)
int32 max_height = 4; // Optional max height for resizing (0 means no limit)
}
// Response message for the thumbnail generation
message ThumbnailResponse {
string message = 1; // Message indicating success or failure
bytes thumbnail_content = 2; // Thumbnail content as bytes
}