github.com/anycable/anycable-go@v1.5.1/etc/rpc.proto (about)

     1  syntax = "proto3";
     2  
     3  package anycable;
     4  
     5  service RPC {
     6    rpc Connect (ConnectionRequest) returns (ConnectionResponse) {}
     7    rpc Command (CommandMessage) returns (CommandResponse) {}
     8    rpc Disconnect (DisconnectRequest) returns (DisconnectResponse) {}
     9  }
    10  
    11  enum Status {
    12    ERROR = 0;
    13    SUCCESS = 1;
    14    FAILURE = 2;
    15  }
    16  
    17  message Env {
    18    string url = 1;
    19    map<string,string> headers = 2;
    20    map<string,string> cstate = 3;
    21    map<string,string> istate = 4;
    22  }
    23  
    24  message EnvResponse {
    25    map<string,string> cstate = 1;
    26    map<string,string> istate = 2;
    27  }
    28  
    29  message ConnectionRequest {
    30    Env env = 3;
    31  }
    32  
    33  message ConnectionResponse {
    34    Status status = 1;
    35    string identifiers = 2;
    36    repeated string transmissions = 3;
    37    string error_msg = 4;
    38    EnvResponse env = 5;
    39  }
    40  
    41  message CommandMessage {
    42    string command = 1;
    43    string identifier = 2;
    44    string connection_identifiers = 3;
    45    string data = 4;
    46    Env env = 5;
    47  }
    48  
    49  message CommandResponse {
    50    Status status = 1;
    51    bool disconnect = 2;
    52    bool stop_streams = 3;
    53    repeated string streams = 4;
    54    repeated string transmissions = 5;
    55    string error_msg = 6;
    56    EnvResponse env = 7;
    57    repeated string stopped_streams = 8;
    58  }
    59  
    60  message DisconnectRequest {
    61    string identifiers = 1;
    62    repeated string subscriptions = 2;
    63    Env env = 5;
    64  }
    65  
    66  message DisconnectResponse {
    67    Status status = 1;
    68    string error_msg = 2;
    69  }