Files
services/ping/proto/ping.proto
Asim Aslam 420f0706b0 add a ping service (#372)
* add a ping service

* add examples and public api file

* add minecraft server ping
2022-02-14 15:05:28 +00:00

55 lines
902 B
Protocol Buffer

syntax = "proto3";
package ping;
option go_package = "./proto;ping";
service Ping {
rpc Ip(IpRequest) returns (IpResponse) {}
rpc Url(UrlRequest) returns (UrlResponse) {}
rpc Tcp(TcpRequest) returns (TcpResponse) {}
}
// Ping an IP address
message IpRequest {
// address to ping
string address = 1;
}
message IpResponse {
// response status
string status = 1;
// average latency e.g 10ms
string latency = 2;
}
// Ping a HTTP URL
message UrlRequest {
// address to use
string address = 1;
// method of the call
string method = 2;
}
message UrlResponse {
// the response status
string status = 1;
// the response code
int32 code = 2;
}
// Ping a TCP port is open
message TcpRequest {
// address to dial
string address = 1;
// optional data to send
string data = 2;
}
message TcpResponse {
// response status
string status = 1;
// response data if any
string data = 2;
}