feat: add slug proto

This commit is contained in:
2026-01-02 18:29:58 +07:00
parent eb2c8f6dc7
commit 291f87635b
10 changed files with 386 additions and 519 deletions

View File

@@ -1,30 +1,47 @@
syntax = "proto3";
package events;
package slug;
option go_package = "./gen";
import "google/protobuf/empty.proto";
service EventService {
rpc Subscribe(google.protobuf.Empty) returns (stream Event);
rpc Subscribe(stream Client) returns (stream Controller);
}
enum EventType {
SLUG_CHANGE = 0;
AUTHENTICATION = 0;
SLUG_CHANGE = 1;
SLUG_CHANGE_RESPONSE = 2;
}
message Event {
message Controller {
EventType type = 1;
int64 timestamp_unix_ms = 2;
oneof data {
SlugChangeEvent data_event = 10;
oneof payload {
SlugChangeEvent slug_event = 11;
}
}
message Client {
EventType type = 1;
oneof payload {
Authentication auth_event = 10;
SlugChangeEventResponse slug_event_response = 11;
}
}
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;
}