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