Spam service (#269)

This commit is contained in:
Dominic Wong
2021-11-11 17:30:46 +00:00
committed by GitHub
parent e80b68116a
commit 57f48c49fd
19 changed files with 636 additions and 1 deletions

30
spam/proto/spam.proto Normal file
View File

@@ -0,0 +1,30 @@
syntax = "proto3";
package spam;
option go_package = "./proto;spam";
service Spam {
rpc Classify(ClassifyRequest) returns (ClassifyResponse) {}
}
// Check whether an email is likely to be spam based on its attributes
message ClassifyRequest {
// The body of the email
string email_body = 1;
// The email address it is being sent to
string to = 2;
// The email address it has been sent from
string from = 3;
// The subject of the email
string subject = 4;
}
message ClassifyResponse {
// Is it spam? Returns true if its score is > 5
bool is_spam = 1;
// The score evaluated for this email. A higher number means it is more likely to be spam
double score = 2;
// The rules that have contributed to this score
repeated string details = 3;
}