Files
spark/src/lib/api/apigateway.proto
T

76 lines
1.8 KiB
Protocol Buffer

syntax="proto3";
package bts.api.gateway;
option csharp_namespace="bts.api.gateway";
import "lib/api/apicore.proto";
message GatewayLogin {
string username = 1;
string password = 2;
}
message GatewayLoginResult {
bool is_valid = 1;
string reason = 2;
api.AuthToken token = 3;
bool can_create = 4;
}
message GatewayCallHeader {
int32 request_id = 1;
int32 method = 2;
api.AuthToken token = 3;
string service_type = 4;
string service_qualifier = 5;
}
message GatewaySubscribe {
int32 request_id = 1;
int32 method = 2;
api.AuthToken token = 3;
string service_type = 4;
string service_qualifier = 5;
string stream_qualifier = 6;
string method_name = 7;
}
message GatewayUnsubscribe {
uint32 subscription_id = 1;
string service_type = 4;
string service_qualifier = 5;
}
message StreamGWUpdate {
enum UpdateType {
REMOVE = 0;
REPLACE = 1;
CREATE= 2;
RESET = 3;
}
UpdateType update_type = 1;
int32 key = 2;
bytes buffer = 3;
}
message SubscriptionUpdate {
int32 id = 1;
repeated StreamGWUpdate updates = 2;
}
message GatewayRequest {
oneof request {
GatewayLogin login = 1;
// Call and subscribe are lazy on the server
// proxy is not generated until first call
// client can determine if a service "should" exist.
// If the types are there server will return OK regardless
GatewayCallHeader call = 2;
GatewaySubscribe subscribe = 3;
GatewayUnsubscribe unsubscribe = 4;
}
bytes addendum = 100;
}
message GatewayResponse {
oneof response {
GatewayLoginResult logon = 1;
bytes call_result = 2;
SubscriptionUpdate tick = 3;
string error = 10;
}
}