github.com/btccom/go-micro/v2@v2.9.3/api/proto/api.proto (about)

     1  syntax = "proto3";
     2  
     3  package go.api;
     4  
     5  message Pair {
     6  	string key = 1;
     7  	repeated string values = 2;
     8  }
     9  
    10  // A HTTP request as RPC
    11  // Forward by the api handler
    12  message Request {
    13          string method = 1;
    14          string path = 2;
    15          map<string, Pair> header = 3;
    16          map<string, Pair> get = 4;
    17          map<string, Pair> post = 5;
    18          string body = 6;  // raw request body; if not application/x-www-form-urlencoded
    19  	string url = 7;
    20  }
    21  
    22  // A HTTP response as RPC
    23  // Expected response for the api handler
    24  message Response {
    25          int32 statusCode = 1;
    26          map<string, Pair> header = 2;
    27          string body = 3;
    28  }
    29  
    30  // A HTTP event as RPC
    31  // Forwarded by the event handler
    32  message Event {
    33  	// e.g login
    34  	string name = 1;
    35  	// uuid
    36  	string id = 2;
    37  	// unix timestamp of event
    38  	int64 timestamp = 3;
    39  	// event headers
    40          map<string, Pair> header = 4;
    41  	// the event data
    42  	string data = 5;
    43  }