URL shortening service (#104)

* URL shortening service

* Url shortener -> url

* Readme edit
This commit is contained in:
Janos Dobronszki
2021-05-17 14:29:01 +01:00
committed by GitHub
parent 5232140591
commit a2dc68b385
12 changed files with 872 additions and 0 deletions

40
url/proto/url.proto Normal file
View File

@@ -0,0 +1,40 @@
syntax = "proto3";
package urlshortener;
option go_package = "github.com/micro/services/url-shortener/proto;urlshortener";
service UrlShortener {
rpc Shorten(ShortenRequest) returns (ShortenResponse) {}
rpc List(ListRequest) returns (ListResponse) {}
rpc Proxy(ProxyRequest) returns (ProxyResponse) {}
}
message ShortenRequest {
string destinationURL = 1;
}
message ShortenResponse {
string shortURL = 1;
}
message URLPair {
string destinationURL = 1;
string shortURL = 2;
string owner = 3;
}
message ListRequest {
}
message ListResponse {
repeated URLPair urlPairs = 1;
}
message ProxyRequest {
string shortURL = 1;
}
message ProxyResponse {
string destinationURL = 1;
}