44 lines
		
	
	
		
			900 B
		
	
	
	
		
			Protocol Buffer
		
	
	
	
	
	
			
		
		
	
	
			44 lines
		
	
	
		
			900 B
		
	
	
	
		
			Protocol Buffer
		
	
	
	
	
	
syntax = "proto3";
 | 
						|
 | 
						|
package go.api;
 | 
						|
 | 
						|
message Pair {
 | 
						|
	string key = 1;
 | 
						|
	repeated string values = 2;
 | 
						|
}
 | 
						|
 | 
						|
// A HTTP request as RPC
 | 
						|
// Forward by the api handler
 | 
						|
message Request {
 | 
						|
        string method = 1;
 | 
						|
        string path = 2;
 | 
						|
        map<string, Pair> header = 3;
 | 
						|
        map<string, Pair> get = 4;
 | 
						|
        map<string, Pair> post = 5;
 | 
						|
        string body = 6;  // raw request body; if not application/x-www-form-urlencoded
 | 
						|
	string url = 7;
 | 
						|
}
 | 
						|
 | 
						|
// A HTTP response as RPC
 | 
						|
// Expected response for the api handler
 | 
						|
message Response {
 | 
						|
        int32 statusCode = 1;
 | 
						|
        map<string, Pair> header = 2;
 | 
						|
        string body = 3;
 | 
						|
}
 | 
						|
 | 
						|
// A HTTP event as RPC
 | 
						|
// Forwarded by the event handler
 | 
						|
message Event {
 | 
						|
	// e.g login
 | 
						|
	string name = 1;
 | 
						|
	// uuid
 | 
						|
	string id = 2;
 | 
						|
	// unix timestamp of event
 | 
						|
	int64 timestamp = 3;
 | 
						|
	// event headers
 | 
						|
        map<string, Pair> header = 4;
 | 
						|
	// the event data
 | 
						|
	string data = 5;
 | 
						|
}
 |