From 7486026eb97671f55a6320012d55222cfe3ffcf0 Mon Sep 17 00:00:00 2001 From: Richard Belleville Date: Wed, 26 Jun 2019 09:42:55 -0700 Subject: [PATCH] Annotate the proto file --- examples/python/cancellation/hash_name.proto | 22 ++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/examples/python/cancellation/hash_name.proto b/examples/python/cancellation/hash_name.proto index e0a5c8357be..7b4e47e056f 100644 --- a/examples/python/cancellation/hash_name.proto +++ b/examples/python/cancellation/hash_name.proto @@ -16,19 +16,41 @@ syntax = "proto3"; package hash_name; +// A request for a single secret whose hash is similar to a desired name. message HashNameRequest { + // The string that is desired in the secret's hash. string desired_name = 1; + + // The ideal Hamming distance betwen desired_name and the secret that will + // be searched for. int32 ideal_hamming_distance = 2; + + // A Hamming distance greater than the ideal Hamming distance. Search results + // with a Hamming distance less than this value but greater than the ideal + // distance will be returned back to the client but will not terminate the + // search. int32 interesting_hamming_distance = 3; } message HashNameResponse { + // The search result. string secret = 1; + + // The hash of the search result. A substring of this is of + // ideal_hamming_distance Hamming distance or less from desired_name. string hashed_name = 2; + + // The Hamming distance between hashed_name and desired_name. int32 hamming_distance = 3; } service HashFinder { + + // Search for a single string whose hash is similar to the specified + // desired_name. interesting_hamming_distance is ignored. rpc Find (HashNameRequest) returns (HashNameResponse) {} + + // Search for a string whose hash is similar to the specified desired_name, + // but also stream back less-than-ideal candidates. rpc FindRange (HashNameRequest) returns (stream HashNameResponse) {} }