github.com/tickoalcantara12/micro/v3@v3.0.0-20221007104245-9d75b9bcbab9/proto/api/api.proto (about)

     1  syntax = "proto3";
     2  
     3  package api;
     4  
     5  option go_package = "github.com/tickoalcantara12/micro/v3/proto/api;api";
     6  
     7  service Api {
     8    rpc AddToBlockList(AddToBlockListRequest) returns (AddToBlockListResponse) {};
     9    rpc RemoveFromBlockList(RemoveFromBlockListRequest) returns (RemoveFromBlockListResponse) {};
    10    rpc ReadBlockList(ReadBlockListRequest) returns (ReadBlockListResponse) {};
    11  }
    12  
    13  message Endpoint {
    14    string name = 1;
    15    repeated string host = 2;
    16    repeated string path = 3;
    17    repeated string method = 4;
    18    bool stream = 5;
    19  }
    20  
    21  message EmptyResponse {}
    22  
    23  message Pair {
    24  	string key = 1;
    25  	repeated string values = 2;
    26  }
    27  
    28  message Request {
    29    string method = 1;
    30    string path = 2;
    31    map<string, Pair> header = 3;
    32    map<string, Pair> get = 4;
    33    map<string, Pair> post = 5;
    34    string body = 6;  // raw request body; if not application/x-www-form-urlencoded
    35  	string url = 7; // the full url
    36  }
    37  
    38  message Response {
    39    int32 statusCode = 1;
    40    map<string, Pair> header = 2;
    41    string body = 3;
    42  }
    43  
    44  // A HTTP event as RPC
    45  // Forwarded by the event handler
    46  message Event {
    47  	// e.g login
    48  	string name = 1;
    49  	// uuid
    50  	string id = 2;
    51  	// unix timestamp of event
    52  	int64 timestamp = 3;
    53  	// event headers
    54    map<string, Pair> header = 4;
    55  	// the event data
    56  	string data = 5;
    57  }
    58  
    59  message AddToBlockListRequest {
    60    string id = 1;
    61    string namespace = 2;
    62  }
    63  
    64  message AddToBlockListResponse {}
    65  
    66  message RemoveFromBlockListRequest {
    67    string id = 1;
    68    string namespace = 2;
    69  }
    70  
    71  message RemoveFromBlockListResponse {}
    72  
    73  message ReadBlockListRequest {}
    74  
    75  message ReadBlockListResponse {
    76    repeated string ids = 1;
    77  }