mirror of
https://github.com/alibaba/higress.git
synced 2026-03-19 09:47:25 +08:00
feat: add rust demo plugin request block (#1091)
Co-authored-by: Yi <lynskylate@gmail.com>
This commit is contained in:
@@ -23,8 +23,9 @@ const (
|
||||
HTTPConformanceFeature SupportedFeature = "http"
|
||||
|
||||
// extended: extensibility
|
||||
WASMGoConformanceFeature SupportedFeature = "wasm-go"
|
||||
WASMCPPConformanceFeature SupportedFeature = "wasm-cpp"
|
||||
WASMGoConformanceFeature SupportedFeature = "wasm-go"
|
||||
WASMCPPConformanceFeature SupportedFeature = "wasm-cpp"
|
||||
WASMRustConformanceFeature SupportedFeature = "wasm-rust"
|
||||
|
||||
// extended: service discovery
|
||||
DubboConformanceFeature SupportedFeature = "dubbo"
|
||||
@@ -36,6 +37,13 @@ const (
|
||||
EnvoyConfigConformanceFeature SupportedFeature = "envoy-config"
|
||||
)
|
||||
|
||||
var WasmPluginTypeMap = map[string]SupportedFeature{
|
||||
"": WASMGoConformanceFeature, // default
|
||||
"GO": WASMGoConformanceFeature,
|
||||
"CPP": WASMCPPConformanceFeature,
|
||||
"RUST": WASMRustConformanceFeature,
|
||||
}
|
||||
|
||||
var AllFeatures = sets.Set{}.
|
||||
Insert(string(HTTPConformanceFeature)).
|
||||
Insert(string(DubboConformanceFeature)).
|
||||
@@ -46,4 +54,5 @@ var AllFeatures = sets.Set{}.
|
||||
|
||||
var ExperimentFeatures = sets.Set{}.
|
||||
Insert(string(WASMGoConformanceFeature)).
|
||||
Insert(string(WASMCPPConformanceFeature))
|
||||
Insert(string(WASMCPPConformanceFeature)).
|
||||
Insert(string(WASMRustConformanceFeature))
|
||||
|
||||
@@ -95,10 +95,11 @@ func New(s Options) *ConformanceTestSuite {
|
||||
}
|
||||
|
||||
if s.IsWasmPluginTest {
|
||||
if s.WasmPluginType == "CPP" {
|
||||
s.SupportedFeatures.Insert(string(WASMCPPConformanceFeature))
|
||||
feature, ok := WasmPluginTypeMap[s.WasmPluginType]
|
||||
if ok {
|
||||
s.SupportedFeatures.Insert(string(feature))
|
||||
} else {
|
||||
s.SupportedFeatures.Insert(string(WASMGoConformanceFeature))
|
||||
panic("WasmPluginType [" + s.WasmPluginType + "] not support")
|
||||
}
|
||||
} else if s.IsEnvoyConfigTest {
|
||||
s.SupportedFeatures.Insert(string(EnvoyConfigConformanceFeature))
|
||||
|
||||
Reference in New Issue
Block a user