Created
June 19, 2019 16:11
-
-
Save stackdump/1bfc789991c5257574af655832559a4b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax = "proto3"; | |
option java_multiple_files = true; | |
option java_package = "com.project.factom.finite.event"; | |
option java_outer_classname = "EventProto"; | |
package finite; | |
import "google/protobuf/timestamp.proto"; | |
import "google/protobuf/any.proto"; | |
service EventStore { | |
rpc Status (Ping) returns (Pong) {} | |
rpc ListMachines (MachineQuery) returns (MachineList) {} | |
rpc GetMachine (Query) returns (Machine) {} | |
rpc Dispatch (Command) returns (EventStatus) {} | |
rpc GetEvent (Query) returns (EventList) {} | |
rpc GetState (Query) returns (StateList) {} | |
} | |
message JsonPayload { | |
bytes json = 1; | |
} | |
message MachineQuery {} // KLUDGE: no params required | |
message Ping { | |
string nonce = 1; | |
} | |
message Pong { | |
string nonce = 1; | |
int64 code = 2; | |
} | |
message Query { | |
string schema = 1; | |
string id = 2; | |
string uuid = 3; | |
} | |
message EventList { | |
repeated Event list = 1; | |
} | |
message StateList { | |
repeated State list = 1; | |
} | |
message Command { | |
string id = 1; | |
string schema = 2; | |
string action = 3; | |
uint64 multiple = 4; | |
bytes payload = 5; | |
repeated uint64 state = 6; | |
} | |
message State { | |
string id = 1; | |
string schema = 2; | |
repeated uint64 state = 3; | |
string head = 4; | |
google.protobuf.Timestamp created = 5; | |
google.protobuf.Timestamp updated = 6; | |
} | |
message EventStatus { | |
State state = 1; | |
int64 code = 2; | |
string message = 3; | |
} | |
message Event { | |
string id = 1; | |
string schema = 2; | |
string action = 3; | |
uint64 multiple = 4; | |
google.protobuf.Any payload = 5; | |
repeated uint64 state = 6; | |
google.protobuf.Timestamp ts = 7; | |
string uuid = 8; | |
string parent = 9; | |
} | |
message Guard { | |
repeated int64 delta = 1; | |
} | |
message Transition { | |
repeated int64 delta = 1; | |
string role = 2; | |
map<string, Guard> guards = 3; | |
} | |
message Schemata { | |
repeated string schema = 1; | |
} | |
message Machine { | |
string schema = 1; | |
repeated uint64 initial = 2; | |
repeated uint64 capacity = 3; | |
map<string, Transition> transitions = 4; | |
} | |
message MachineList { | |
repeated string list = 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment