Echo Handler
Overview
EchoHandler
is an simple echo handler.
It returns the request information.
It works as:
HTTP Handler
Config yaml format becomes like below. And the resource specific spec is defined in in the proto format shown in the Resource Definition.
apiVersion: app/v1
kind: EchoHandler
metadata:
name: "default"
namespace: "default"
spec: {}
Features
1. Request information response
Echo handler respond the requet information.
Resource Definition
EchoHandler is defined in the proto/app/v1/handler/echo.proto
1syntax = "proto3";
2package app.v1;
3
4import "core/v1/http.proto";
5import "kernel/resource.proto";
6
7option go_package = "github.com/aileron-gateway/aileron-gateway/apis/app/v1";
8
9// EchoHandler resource definition.
10// apiVersion="app/v1", kind="EchoHandler".
11message EchoHandler {
12 string APIVersion = 1 [json_name = "apiVersion"];
13 string Kind = 2 [json_name = "kind"];
14 kernel.Metadata Metadata = 3 [json_name = "metadata"];
15 EchoHandlerSpec Spec = 4 [json_name = "spec"];
16}
17
18// EchoHandlerSpec is the specifications for the EchoHandler object.
19message EchoHandlerSpec {
20 // [OPTIONAL]
21 // Patterns is path patterns that this handler
22 // is registered to a server.
23 // Default is not set, or empty string ["/"].
24 repeated string Patterns = 1 [json_name = "patterns"];
25
26 // [OPTIONA]
27 // Methods is the list of HTTP method this handler can handle.
28 // Note that it depends on the multiplexer, or HTTP router,
29 // that the server uses if this field is used or not.
30 // Default multiplexer does not use this field.
31 // Default is not set.
32 repeated core.v1.HTTPMethod Methods = 2 [json_name = "methods"];
33}
フィードバック
このページは役に立ちましたか?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.