aboutsummaryrefslogtreecommitdiff
path: root/examples/haberdasher/service.proto
diff options
context:
space:
mode:
Diffstat (limited to 'examples/haberdasher/service.proto')
-rw-r--r--examples/haberdasher/service.proto22
1 files changed, 22 insertions, 0 deletions
diff --git a/examples/haberdasher/service.proto b/examples/haberdasher/service.proto
new file mode 100644
index 0000000..1945a72
--- /dev/null
+++ b/examples/haberdasher/service.proto
@@ -0,0 +1,22 @@
+syntax = "proto3";
+
+package twirp.example.haberdasher;
+option go_package = "haberdasher";
+
+// Haberdasher service makes hats for clients.
+service Haberdasher {
+ // MakeHat produces a hat of mysterious, randomly-selected color!
+ rpc MakeHat(Size) returns (Hat);
+}
+
+// Size of a Hat, in inches.
+message Size {
+ int32 inches = 1; // must be > 0
+}
+
+// A Hat is a piece of headwear made by a Haberdasher.
+message Hat {
+ int32 inches = 1;
+ string color = 2; // anything but "invisible"
+ string name = 3; // i.e. "bowler"
+}