mirror of
https://github.com/go-micro/go-micro.git
synced 2025-06-12 22:07:47 +02:00
agent
api
handler
internal
proto
api.micro.go
api.pb.go
api.proto
resolver
router
server
api.go
api_test.go
broker
client
codec
config
debug
errors
metadata
monitor
network
plugin
proxy
registry
router
runtime
server
service
store
sync
transport
tunnel
util
web
.gitignore
.travis.yml
LICENSE
README.md
README.zh-cn.md
common_test.go
function.go
function_test.go
go.mod
go.sum
micro.go
options.go
publisher.go
service.go
service_test.go
wrapper.go
wrapper_test.go
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;
|
|
}
|