aboutsummaryrefslogtreecommitdiff
path: root/cast/cast_core/api/v2/runtime_application_service.proto
blob: e8bc21bab2956ddb9db3fbff01bf7812e2b91c69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
syntax = "proto3";

package cast.v2;

import "google/protobuf/empty.proto";
import "cast/cast_core/api/v2/cast_message.proto";
import "cast/cast_core/api/v2/url_rewrite.proto";
import "cast/cast_core/api/web/message_channel.proto";

option optimize_for = LITE_RUNTIME;

// Cast application Service
//
// This service is implemented by the Runtime and represents services
// specific to a Cast application.
service RuntimeApplicationService {
  // Notifies the runtime that a new Cast V2 virtual connection has been opened.
  rpc OnVirtualConnectionOpen(VirtualConnectionInfo)
      returns (google.protobuf.Empty);

  // Notifies the runtime that a Cast V2 virtual connection has been closed.
  rpc OnVirtualConnectionClosed(VirtualConnectionInfo)
      returns (google.protobuf.Empty);

  // Sends a Cast message to the runtime.
  rpc SendCastMessage(CastMessage) returns (CastMessageResponse);

  // Set the URL rewrite rules that the Runtime will use to contact the MSP
  // This is called when the rewrite rules are changed
  // A non streaming API for simplicity
  rpc SetUrlRewriteRules(SetUrlRewriteRulesRequest)
      returns (SetUrlRewriteRulesResponse);

  // "MessageConnectorService" provides the transport for MessagePorts.
  // MessagePorts are connected using other services (e.g. ApiBindings), then
  // registered with the MessageConnectorService to communicate over IPC
  rpc PostMessage(cast.web.Message) returns (cast.web.MessagePortStatus);
}

// Request to set the URL rewrite rules on the runtime application.
message SetUrlRewriteRulesRequest {
  // URL rewrite rules.
  UrlRequestRewriteRules rules = 1;
}

message SetUrlRewriteRulesResponse {}

// Request by the sender to open or close a virtual connection to the Cast
// runtime.
message VirtualConnectionInfo {
  // The source of the virtual connection request.  Connections from the
  // sender platform use an id of 'sender-0' and connections from applications
  // use a unique ID.
  string source_id = 1;
  // The destination of the connection request.  Connections to the Cast
  // receiver platform use an id of 'receiver-0' and connections to applications
  // use the Cast session id.
  string destination_id = 2;
}