Files
thumbnailservice/thumbnail.proto
2025-03-24 21:45:12 +01:00

33 lines
1.0 KiB
Protocol Buffer

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
}