Files
services/memegen/proto/memegen.proto
Asim Aslam 8adc4da930 .
2022-02-20 22:08:22 +00:00

70 lines
1.2 KiB
Protocol Buffer

syntax = "proto3";
package memegen;
option go_package = "./proto;memegen";
service Memegen {
rpc Templates(TemplatesRequest) returns (TemplatesResponse) {}
rpc Generate(GenerateRequest) returns (GenerateResponse) {}
}
message Template {
// id of the memegen
string id = 1;
// name of the memegen
string name = 2;
// url of the memegen
string url = 3;
// width in pixels
int32 width = 4;
// height in pixels
int32 height = 5;
// number of boxes used
int32 box_count = 6;
}
message Box {
// text to display
string text = 1;
// x axis position
int32 x = 2;
// y axis position
int32 y = 3;
// width in pixels
int32 width = 4;
// height in pixels
int32 height = 5;
// colour hex code
string color = 6;
// outline color hex code
string outline = 7;
}
// List the available templates
message TemplatesRequest {}
message TemplatesResponse {
repeated Template templates = 1;
}
// Generate a meme using a template
message GenerateRequest {
// the template id to use
string id = 1;
// top text
string top_text = 2;
// bottom text
string bottom_text = 3;
// font: arial or impact
string font = 4;
// font size; defaults to 50px
string max_font_size = 5;
}
message GenerateResponse {
// url of the memegen
string url = 1;
}