mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-23 07:41:25 +00:00
Spam service (#269)
This commit is contained in:
30
spam/proto/spam.proto
Normal file
30
spam/proto/spam.proto
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user