mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-12 03:05:14 +00:00
55 lines
902 B
Protocol Buffer
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;
|
|
}
|