syntax = "proto3";
package coerce.network;
import "google/protobuf/wrappers.proto";
import "google/protobuf/timestamp.proto";
message RemoteNode {
uint64 node_id = 1;
string addr = 2;
google.protobuf.Timestamp node_started_at = 3;
string tag = 4;
map<string, string> attributes = 5;
}
enum Event {
Identify = 0;
Handshake = 1;
Result = 2;
Err = 3;
Ping = 4;
Pong = 5;
CreateActor = 6;
FindActor = 7;
RegisterActor = 8;
NotifyActor = 9;
StreamPublish = 10;
Raft = 11;
Identity = 12;
}
enum ClientType {
Client = 0;
Worker = 1;
}
message IdentifyEvent {
uint64 source_node_id = 1;
string source_node_tag = 2;
string token = 3;
}
message NodeIdentity {
uint64 node_id = 1;
string node_tag = 2;
string addr = 3;
string application_version = 4;
string protocol_version = 5;
google.protobuf.Timestamp node_started_at = 6;
repeated RemoteNode peers = 7;
SystemCapabilities capabilities = 8;
map<string, string> attributes = 9;
}
message SystemCapabilities {
repeated string actors = 1;
repeated string messages = 2;
}
message ClientHandshake {
uint64 node_id = 1;
repeated RemoteNode nodes = 2;
string node_tag = 3;
string trace_id = 4;
google.protobuf.Timestamp node_started_at = 5;
}
message ClientResult {
string message_id = 1;
bytes result = 2;
string trace_id = 3;
}
message ClientErr {
string message_id = 1;
ActorRefErr error = 2;
string trace_id = 3;
}
message PingEvent {
string message_id = 1;
string trace_id = 2;
uint64 node_id = 3;
bool system_terminated = 4;
}
message PongEvent {
string message_id = 1;
string trace_id = 2;
}
message CreateActorEvent {
string message_id = 1;
string actor_id = 2;
string actor_type = 3;
bytes recipe = 4;
string trace_id = 5;
}
message FindActorEvent {
string message_id = 1;
string actor_id = 2;
string trace_id = 3;
}
message ActorAddress {
string actor_id = 1;
google.protobuf.UInt64Value node_id = 2;
string trace_id = 3;
}
message MessageRequest {
string message_id = 1;
string handler_type = 2;
string actor_id = 3;
bytes message = 4;
string trace_id = 5;
bool requires_response = 6;
uint64 origin_node_id = 7;
}
message SessionHandshake {
uint64 node_id = 1;
repeated RemoteNode nodes = 2;
bytes token = 3;
string node_tag = 4;
ClientType client_type = 5;
string trace_id = 6;
}
message StreamPublishEvent {
string topic = 1;
string key = 2;
bytes message = 3;
string trace_id = 4;
}
enum SystemEvent {
ClusterNewNode = 0;
ClusterNodeRemoved = 1;
ClusterLeaderChanged = 2;
}
message NewNodeEvent {
RemoteNode node = 1;
string trace_id = 2;
}
message NodeRemovedEvent {
RemoteNode node = 1;
string trace_id = 2;
}
message LeaderChangedEvent {
uint64 node_id = 1;
string trace_id = 2;
}
message RaftRequest {
string message_id = 1;
uint32 request_type = 2;
bytes payload = 3;
}
enum MessageUnwrapErr {
UnknownUnwrapErr = 0;
UnwrapUnsupported = 1;
DeserializationErr = 2;
}
enum MessageWrapErr {
UnknownWrapErr = 0;
WrapUnsupported = 1;
SerializationErr = 2;
}
message ActorRefErr {
enum ErrorType {
ActorUnavailable = 0;
NotFound = 1;
AlreadyExists = 2;
Serialisation = 3;
Deserialisation = 4;
Timeout = 5;
ActorStartFailed = 6;
InvalidRef = 7;
ResultChannelClosed = 8;
ResultSendFailed = 9;
NotSupported = 10;
NotImplemented = 11;
}
ErrorType type = 1;
string actor_id = 2;
string message_type = 3;
string actor_type = 4;
uint64 time_taken_millis = 5;
MessageWrapErr serialization_error = 6;
MessageUnwrapErr deserialization_error = 7;
}