syntax = "proto3"; package runtime; service Runtime { // Load a service file to be ready to start it rpc Load(LoadRequest) returns (LoadResponse); // Start a loaded service file rpc Start(StartRequest) returns (StartResponse); // Stop a started service rpc Stop(StopRequest) returns (StopResponse); // Channel to notify a service has been stopped rpc SubscribeStop(SubscribeStopRequest) returns (stream SubscribeStopResponse); rpc Version(Ping) returns (VersionInfo); rpc HealthCheck(Ping) returns (Pong); } message LoadRequest { string project_name = 1; // "local" or "deployment" string env = 3; // Secrets that belong to this deployment map secrets = 20; // deprecated string path = 2; // deprecated repeated bytes resources = 10; } message LoadResponse { // Could the service be loaded bool success = 1; // Error message if not successful string message = 2; // Which resources where requested repeated bytes resources = 10; } message StartRequest { // Address and port to start the service on string ip = 1; // The resources available repeated bytes resources = 10; } message StartResponse { // Was the start successful bool success = 1; // Error message if not successful string message = 2; } message StopRequest {} message StopResponse { // Was the stop successful bool success = 1; } message SubscribeStopRequest {} message SubscribeStopResponse { // Reason the service has stopped StopReason reason = 1; // Any extra message to go with the reason. If there are any string message = 2; } enum StopReason { // User requested this stop Request = 0; // Service stopped by itself End = 1; // Service crashed Crash = 2; } message Ping {} message Pong {} message VersionInfo { string version = 1; }