54 lines
924 B
Protocol Buffer
54 lines
924 B
Protocol Buffer
syntax = "proto3";
|
|
|
|
package slug;
|
|
|
|
option go_package = "./gen";
|
|
import "user.proto";
|
|
service EventService {
|
|
rpc Subscribe(stream Client) returns (stream Controller);
|
|
}
|
|
|
|
enum EventType {
|
|
AUTHENTICATION = 0;
|
|
SLUG_CHANGE = 1;
|
|
SLUG_CHANGE_RESPONSE = 2;
|
|
GET_SESSIONS = 3;
|
|
}
|
|
|
|
message Controller {
|
|
EventType type = 1;
|
|
|
|
oneof payload {
|
|
SlugChangeEvent slug_event = 11;
|
|
GetSessionsEvent get_sessions_event = 12;
|
|
}
|
|
}
|
|
|
|
message Client {
|
|
EventType type = 1;
|
|
|
|
oneof payload {
|
|
Authentication auth_event = 10;
|
|
SlugChangeEventResponse slug_event_response = 11;
|
|
GetSessionsResponse get_sessions_event = 12;
|
|
}
|
|
}
|
|
|
|
message Authentication {
|
|
string auth_token = 1;
|
|
string identity = 2;
|
|
}
|
|
|
|
message SlugChangeEvent {
|
|
string old = 1;
|
|
string new = 2;
|
|
}
|
|
|
|
message SlugChangeEventResponse {
|
|
bool success = 1;
|
|
string message = 2;
|
|
}
|
|
|
|
message GetSessionsEvent {
|
|
string identity = 1;
|
|
} |