From eb0e755e8555dea310dacdd7b671b8b6a014686e Mon Sep 17 00:00:00 2001 From: liaochuntao Date: Mon, 22 Jul 2024 15:11:15 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=E9=89=B4=E6=9D=83=E8=A7=84=E5=88=99sp?= =?UTF-8?q?ec=E8=B0=83=E6=95=B4=20(#112)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/rust-release.yaml | 1 + Cargo.lock | 794 +- Cargo.toml | 4 +- api/v1/fault_tolerance/circuitbreaker.proto | 2 + api/v1/fault_tolerance/fault_detector.proto | 2 + api/v1/security/auth.proto | 109 +- api/v1/traffic_manage/lane.proto | 7 +- api/v1/traffic_manage/ratelimit.proto | 2 + api/v1/traffic_manage/routing.proto | 3 + .../v1/fault_tolerance/circuitbreaker.pb.go | 469 +- .../v1/fault_tolerance/fault_detector.pb.go | 160 +- source/go/api/v1/model/model.pb.go | 150 +- source/go/api/v1/security/auth.pb.go | 701 +- source/go/api/v1/service_manage/request.pb.go | 99 +- .../go/api/v1/service_manage/response.pb.go | 284 +- source/go/api/v1/traffic_manage/lane.pb.go | 148 +- .../go/api/v1/traffic_manage/ratelimit.pb.go | 262 +- source/go/api/v1/traffic_manage/routing.pb.go | 361 +- .../java/polaris-specification-test/pom.xml | 2 +- source/java/polaris-specification/pom.xml | 2 +- .../src/main/proto/auth.proto | 197 + .../src/main/proto/circuitbreaker.proto | 356 + .../src/main/proto/client.proto | 45 + .../src/main/proto/code.proto | 194 + .../src/main/proto/config_file.proto | 213 + .../src/main/proto/config_file_response.proto | 82 + .../src/main/proto/configrelease.proto | 24 + .../src/main/proto/contract.proto | 75 + .../src/main/proto/fault_detector.proto | 90 + .../src/main/proto/grpc_config_api.proto | 37 + .../src/main/proto/grpcapi.proto | 44 + .../src/main/proto/grpcapi_ratelimiter.proto | 17 + .../src/main/proto/heartbeat.proto | 47 + .../src/main/proto/lane.proto | 108 + .../src/main/proto/model.proto | 71 + .../src/main/proto/namespace.proto | 35 + .../src/main/proto/ratelimit.proto | 216 + .../src/main/proto/ratelimiter.proto | 211 + .../src/main/proto/request.proto | 41 + .../src/main/proto/response.proto | 126 + .../src/main/proto/routing.proto | 275 + .../src/main/proto/service.proto | 109 + source/rust/polaris-specification/Cargo.toml | 6 +- source/rust/polaris-specification/build.rs | 7 +- .../polaris-specification/proto/auth.proto | 109 +- .../proto/circuitbreaker.proto | 32 +- .../polaris-specification/proto/code.proto | 3 +- .../proto/config_file.proto | 81 +- .../proto/config_file_response.proto | 7 +- .../proto/contract.proto | 75 + .../proto/fault_detector.proto | 8 +- .../proto/grpc_config_api.proto | 9 +- .../polaris-specification/proto/grpcapi.proto | 11 +- .../polaris-specification/proto/lane.proto | 108 + .../polaris-specification/proto/model.proto | 29 +- .../proto/namespace.proto | 2 + .../proto/ratelimit.proto | 2 + .../polaris-specification/proto/request.proto | 12 + .../proto/response.proto | 27 +- .../polaris-specification/proto/routing.proto | 39 +- .../polaris-specification/proto/service.proto | 2 +- source/rust/polaris-specification/src/v1.rs | 8603 ++++++++++++----- 62 files changed, 11637 insertions(+), 3710 deletions(-) create mode 100644 source/java/polaris-specification/src/main/proto/auth.proto create mode 100644 source/java/polaris-specification/src/main/proto/circuitbreaker.proto create mode 100644 source/java/polaris-specification/src/main/proto/client.proto create mode 100644 source/java/polaris-specification/src/main/proto/code.proto create mode 100644 source/java/polaris-specification/src/main/proto/config_file.proto create mode 100644 source/java/polaris-specification/src/main/proto/config_file_response.proto create mode 100644 source/java/polaris-specification/src/main/proto/configrelease.proto create mode 100644 source/java/polaris-specification/src/main/proto/contract.proto create mode 100644 source/java/polaris-specification/src/main/proto/fault_detector.proto create mode 100644 source/java/polaris-specification/src/main/proto/grpc_config_api.proto create mode 100644 source/java/polaris-specification/src/main/proto/grpcapi.proto create mode 100644 source/java/polaris-specification/src/main/proto/grpcapi_ratelimiter.proto create mode 100644 source/java/polaris-specification/src/main/proto/heartbeat.proto create mode 100644 source/java/polaris-specification/src/main/proto/lane.proto create mode 100644 source/java/polaris-specification/src/main/proto/model.proto create mode 100644 source/java/polaris-specification/src/main/proto/namespace.proto create mode 100644 source/java/polaris-specification/src/main/proto/ratelimit.proto create mode 100644 source/java/polaris-specification/src/main/proto/ratelimiter.proto create mode 100644 source/java/polaris-specification/src/main/proto/request.proto create mode 100644 source/java/polaris-specification/src/main/proto/response.proto create mode 100644 source/java/polaris-specification/src/main/proto/routing.proto create mode 100644 source/java/polaris-specification/src/main/proto/service.proto create mode 100644 source/rust/polaris-specification/proto/contract.proto create mode 100644 source/rust/polaris-specification/proto/lane.proto diff --git a/.github/workflows/rust-release.yaml b/.github/workflows/rust-release.yaml index 030fe01d..051c2a75 100644 --- a/.github/workflows/rust-release.yaml +++ b/.github/workflows/rust-release.yaml @@ -37,6 +37,7 @@ jobs: cd ../ bash build.sh cd polaris-specification + rm build.rs env: VERSION: ${{ steps.get_version.outputs.VERSION }} - name: Run cargo login diff --git a/Cargo.lock b/Cargo.lock index 1210cf8a..d2312f9f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,18 +2,132 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + [[package]] name = "anyhow" version = "1.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" +[[package]] +name = "async-stream" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" +dependencies = [ + "async-stream-impl", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "async-trait" +version = "0.1.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "autocfg" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +[[package]] +name = "axum" +version = "0.6.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" +dependencies = [ + "async-trait", + "axum-core", + "bitflags", + "bytes", + "futures-util", + "http", + "http-body", + "hyper", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "sync_wrapper", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum-core" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http", + "http-body", + "mime", + "rustversion", + "tower-layer", + "tower-service", +] + +[[package]] +name = "backtrace" +version = "0.3.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + [[package]] name = "bitflags" version = "1.3.2" @@ -28,9 +142,9 @@ checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" [[package]] name = "cc" -version = "1.0.79" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "d32a725bc159af97c3e629873bb9f88fb8cf8a4867175f76dc987815ea07c83b" [[package]] name = "cfg-if" @@ -44,6 +158,12 @@ version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + [[package]] name = "errno" version = "0.3.1" @@ -52,7 +172,7 @@ checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" dependencies = [ "errno-dragonfly", "libc", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -80,12 +200,99 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "futures-channel" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-sink" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-core", + "futures-task", + "pin-project-lite", + "pin-utils", +] + +[[package]] +name = "getrandom" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" + +[[package]] +name = "h2" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap 2.2.6", + "slab", + "tokio", + "tokio-util", + "tracing", +] + [[package]] name = "hashbrown" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" + [[package]] name = "heck" version = "0.4.1" @@ -98,6 +305,76 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" +[[package]] +name = "http" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hyper" +version = "0.14.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-timeout" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" +dependencies = [ + "hyper", + "pin-project-lite", + "tokio", + "tokio-io-timeout", +] + [[package]] name = "indexmap" version = "1.9.3" @@ -105,7 +382,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.12.3", +] + +[[package]] +name = "indexmap" +version = "2.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +dependencies = [ + "equivalent", + "hashbrown 0.14.3", ] [[package]] @@ -125,7 +412,7 @@ checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ "hermit-abi", "libc", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -138,16 +425,16 @@ dependencies = [ ] [[package]] -name = "lazy_static" -version = "1.4.0" +name = "itoa" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "libc" -version = "0.2.146" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "linux-raw-sys" @@ -161,18 +448,71 @@ version = "0.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "518ef76f2f87365916b142844c16d8fefd85039bc5699050210a7778ee1cd1de" +[[package]] +name = "matchit" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" + +[[package]] +name = "memchr" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "miniz_oxide" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.48.0", +] + [[package]] name = "multimap" version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" +[[package]] +name = "object" +version = "0.32.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +dependencies = [ + "memchr", +] + [[package]] name = "once_cell" version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + [[package]] name = "petgraph" version = "0.6.3" @@ -180,24 +520,64 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" dependencies = [ "fixedbitset", - "indexmap", + "indexmap 1.9.3", +] + +[[package]] +name = "pin-project" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +dependencies = [ + "pin-project-internal", ] +[[package]] +name = "pin-project-internal" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + [[package]] name = "polaris-specification" -version = "1.3.2" +version = "1.5.2" dependencies = [ "bytes", "prost", "prost-build", "prost-types", + "tonic", + "tonic-build", ] +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + [[package]] name = "prettyplease" -version = "0.1.25" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" +checksum = "5ac2cf0f2e4f42b49f5ffd07dae8d746508ef7526c13940e5f524012ae6c6550" dependencies = [ "proc-macro2", "syn", @@ -205,18 +585,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.60" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dec2b086b7a862cf4de201096214fa870344cf922b2b30c167badb3af3195406" +checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" dependencies = [ "unicode-ident", ] [[package]] name = "prost" -version = "0.11.9" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" +checksum = "d0f5d036824e4761737860779c906171497f6d55681139d8312388f8fe398922" dependencies = [ "bytes", "prost-derive", @@ -224,16 +604,16 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.11.9" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "119533552c9a7ffacc21e099c24a0ac8bb19c2a2a3f363de84cd9b844feab270" +checksum = "80b776a1b2dc779f5ee0641f8ade0125bc1298dd41a9a0c16d8bd57b42d222b1" dependencies = [ "bytes", "heck", "itertools", - "lazy_static", "log", "multimap", + "once_cell", "petgraph", "prettyplease", "prost", @@ -241,14 +621,13 @@ dependencies = [ "regex", "syn", "tempfile", - "which", ] [[package]] name = "prost-derive" -version = "0.11.9" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" +checksum = "19de2de2a00075bf566bee3bd4db014b11587e84184d3f7a791bc17f1a8e9e48" dependencies = [ "anyhow", "itertools", @@ -259,22 +638,52 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.11.9" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" +checksum = "3235c33eb02c1f1e212abdbe34c78b264b038fb58ca612664343271e36e55ffe" dependencies = [ "prost", ] [[package]] name = "quote" -version = "1.0.28" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + [[package]] name = "redox_syscall" version = "0.3.5" @@ -299,6 +708,12 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + [[package]] name = "rustix" version = "0.37.19" @@ -310,20 +725,71 @@ dependencies = [ "io-lifetimes", "libc", "linux-raw-sys", - "windows-sys", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustversion" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80af6f9131f277a45a3fba6ce8e2258037bb0477a67e610d3c1fe046ab31de47" + +[[package]] +name = "serde" +version = "1.0.198" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9846a40c979031340571da2545a4e5b7c4163bdae79b301d5f86d03979451fcc" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.198" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e88edab869b01783ba905e7d0153f9fc1a6505a96e4ad3018011eedb838566d9" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "socket2" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +dependencies = [ + "libc", + "windows-sys 0.52.0", ] [[package]] name = "syn" -version = "1.0.109" +version = "2.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + [[package]] name = "tempfile" version = "3.6.0" @@ -335,9 +801,168 @@ dependencies = [ "fastrand", "redox_syscall", "rustix", - "windows-sys", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio" +version = "1.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "pin-project-lite", + "socket2", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-io-timeout" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" +dependencies = [ + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-stream" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", ] +[[package]] +name = "tokio-util" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "tonic" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76c4eb7a4e9ef9d4763600161f12f5070b92a578e1b634db88a6887844c91a13" +dependencies = [ + "async-stream", + "async-trait", + "axum", + "base64", + "bytes", + "h2", + "http", + "http-body", + "hyper", + "hyper-timeout", + "percent-encoding", + "pin-project", + "prost", + "tokio", + "tokio-stream", + "tower", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tonic-build" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4ef6dd70a610078cb4e338a0f79d06bc759ff1b22d2120c2ff02ae264ba9c2" +dependencies = [ + "prettyplease", + "proc-macro2", + "prost-build", + "quote", + "syn", +] + +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "indexmap 1.9.3", + "pin-project", + "pin-project-lite", + "rand", + "slab", + "tokio", + "tokio-util", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-layer" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + [[package]] name = "unicode-ident" version = "1.0.9" @@ -345,23 +970,36 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" [[package]] -name = "which" -version = "4.4.0" +name = "want" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" dependencies = [ - "either", - "libc", - "once_cell", + "try-lock", ] +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + [[package]] name = "windows-sys" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets", + "windows-targets 0.48.0", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.5", ] [[package]] @@ -370,13 +1008,29 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.48.0", + "windows_aarch64_msvc 0.48.0", + "windows_i686_gnu 0.48.0", + "windows_i686_msvc 0.48.0", + "windows_x86_64_gnu 0.48.0", + "windows_x86_64_gnullvm 0.48.0", + "windows_x86_64_msvc 0.48.0", +] + +[[package]] +name = "windows-targets" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +dependencies = [ + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", ] [[package]] @@ -385,38 +1039,86 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" + [[package]] name = "windows_aarch64_msvc" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" + [[package]] name = "windows_i686_gnu" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +[[package]] +name = "windows_i686_gnu" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" + [[package]] name = "windows_i686_msvc" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +[[package]] +name = "windows_i686_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" + [[package]] name = "windows_x86_64_gnu" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" + [[package]] name = "windows_x86_64_msvc" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" diff --git a/Cargo.toml b/Cargo.toml index bb3d653e..2a259ca9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,6 +13,6 @@ authors = ["https://github.com/polarismesh"] [workspace.dependencies] bytes = "1.4.0" -prost = "0.11.9" +prost = "0.12" # Only necessary if using Protobuf well-known types: -prost-types = "0.11.9" +prost-types = "0.12" diff --git a/api/v1/fault_tolerance/circuitbreaker.proto b/api/v1/fault_tolerance/circuitbreaker.proto index 1355a9ce..a47f2341 100644 --- a/api/v1/fault_tolerance/circuitbreaker.proto +++ b/api/v1/fault_tolerance/circuitbreaker.proto @@ -285,6 +285,8 @@ message CircuitBreakerRule { repeated BlockConfig block_configs = 29 [ json_name = "block_configs" ]; // priority rules priority uint32 priority = 30 [ json_name = "priority" ]; + // 熔断规则标签数据 + map metadata = 50; } // the condition to judge an input invocation as an error diff --git a/api/v1/fault_tolerance/fault_detector.proto b/api/v1/fault_tolerance/fault_detector.proto index e03889f9..217669be 100644 --- a/api/v1/fault_tolerance/fault_detector.proto +++ b/api/v1/fault_tolerance/fault_detector.proto @@ -64,6 +64,8 @@ message FaultDetectRule { UdpProtocolConfig udp_config = 28; // priority rules priority uint32 priority = 29 [ json_name = "priority" ]; + // 探测规则标签数据 + map metadata = 50; } message HttpProtocolConfig { diff --git a/api/v1/security/auth.proto b/api/v1/security/auth.proto index 10f934dc..163f3e09 100644 --- a/api/v1/security/auth.proto +++ b/api/v1/security/auth.proto @@ -9,28 +9,43 @@ option java_package = "com.tencent.polaris.specification.api.v1.security"; option java_outer_classname = "SecurityProto"; enum AuthAction { + // deprecated_filed 该字段从未使用过 ONLY_READ = 0; + // deprecated_filed 使用 ALLOW 进行替代 READ_WRITE = 1; + ALLOW = 10; + DENY = 11; } enum ResourceType { Namespaces = 0; Services = 1; ConfigGroups = 2; + RouteRules = 3; + RateLimitRules = 4; + CircuitBreakerRules = 5; + FaultDetectRules = 6; + LaneRules = 7; + Users = 20; + UserGroups = 21; + Roles = 22; + PolicyRules = 23; } message LoginRequest { google.protobuf.StringValue owner = 1; google.protobuf.StringValue name = 2; google.protobuf.StringValue password = 3; + map options = 4; } message LoginResponse { - google.protobuf.StringValue user_id = 1 [json_name = "user_id"]; + google.protobuf.StringValue user_id = 1 [ json_name = "user_id" ]; google.protobuf.StringValue name = 2; google.protobuf.StringValue role = 3; - google.protobuf.StringValue owner_id = 4 [json_name = "owner_id"]; + google.protobuf.StringValue owner_id = 4 [ json_name = "owner_id" ]; google.protobuf.StringValue token = 5; + map options = 6; } message User { @@ -39,24 +54,25 @@ message User { google.protobuf.StringValue password = 3; google.protobuf.StringValue owner = 4; google.protobuf.StringValue source = 5; - google.protobuf.StringValue auth_token = 6 [json_name = "auth_token"]; - google.protobuf.BoolValue token_enable = 7 [json_name = "token_enable"]; + google.protobuf.StringValue auth_token = 6 [ json_name = "auth_token" ]; + google.protobuf.BoolValue token_enable = 7 [ json_name = "token_enable" ]; google.protobuf.StringValue comment = 8; google.protobuf.StringValue ctime = 9; google.protobuf.StringValue mtime = 10; - google.protobuf.StringValue user_type = 11 [json_name = "user_type"]; + google.protobuf.StringValue user_type = 11 [ json_name = "user_type" ]; google.protobuf.StringValue mobile = 12; google.protobuf.StringValue email = 13; + map metadata = 14; } message ModifyUserPassword { google.protobuf.StringValue id = 1; - google.protobuf.StringValue old_password = 2 [json_name = "old_password"]; - google.protobuf.StringValue new_password = 3 [json_name = "new_password"]; + google.protobuf.StringValue old_password = 2 [ json_name = "old_password" ]; + google.protobuf.StringValue new_password = 3 [ json_name = "new_password" ]; } message UserGroupRelation { - google.protobuf.StringValue group_id = 1 [json_name = "group_id"]; + google.protobuf.StringValue group_id = 1 [ json_name = "group_id" ]; repeated User users = 2; } @@ -64,24 +80,42 @@ message UserGroup { google.protobuf.StringValue id = 1; google.protobuf.StringValue name = 2; google.protobuf.StringValue owner = 3; - google.protobuf.StringValue auth_token = 4 [json_name = "auth_token"]; - google.protobuf.BoolValue token_enable = 5 [json_name = "token_enable"]; + google.protobuf.StringValue auth_token = 4 [ json_name = "auth_token" ]; + google.protobuf.BoolValue token_enable = 5 [ json_name = "token_enable" ]; google.protobuf.StringValue comment = 6; google.protobuf.StringValue ctime = 7; google.protobuf.StringValue mtime = 8; UserGroupRelation relation = 9; - google.protobuf.UInt32Value user_count = 10 [json_name = "user_count"]; + google.protobuf.UInt32Value user_count = 10 [ json_name = "user_count" ]; + google.protobuf.StringValue source = 11; + map metadata = 12; } message ModifyUserGroup { google.protobuf.StringValue id = 1; google.protobuf.StringValue owner = 2; google.protobuf.StringValue name = 3; - google.protobuf.StringValue auth_token = 4 [json_name = "auth_token"]; - google.protobuf.BoolValue token_enable = 5 [json_name = "token_enable"]; + google.protobuf.StringValue auth_token = 4 [ json_name = "auth_token" ]; + google.protobuf.BoolValue token_enable = 5 [ json_name = "token_enable" ]; google.protobuf.StringValue comment = 6; - UserGroupRelation add_relations = 7 [json_name = "add_relations"]; - UserGroupRelation remove_relations = 8 [json_name = "remove_relations"]; + UserGroupRelation add_relations = 7 [ json_name = "add_relations" ]; + UserGroupRelation remove_relations = 8 [ json_name = "remove_relations" ]; + map metadata = 9; + google.protobuf.StringValue source = 10; +} + +message Role { + string id = 1; + string name = 2; + string owner = 4; + string source = 5; + bool default_role = 6 [ json_name = "default_role" ]; + map metadata = 7; + string comment = 8; + string ctime = 9; + string mtime = 10; + repeated User users = 20; + repeated UserGroup user_groups = 21 [ json_name = "user_groups" ]; } message Principal { @@ -92,6 +126,7 @@ message Principal { message Principals { repeated Principal users = 1; repeated Principal groups = 2; + repeated Principal roles = 3; } message StrategyResourceEntry { @@ -101,10 +136,27 @@ message StrategyResourceEntry { } message StrategyResources { - google.protobuf.StringValue strategy_id = 1 [json_name = "strategy_id"]; + google.protobuf.StringValue strategy_id = 1 [ json_name = "strategy_id" ]; repeated StrategyResourceEntry namespaces = 2; repeated StrategyResourceEntry services = 3; - repeated StrategyResourceEntry config_groups = 4 [json_name = "config_groups"]; + repeated StrategyResourceEntry config_groups = 4 + [ json_name = "config_groups" ]; + repeated StrategyResourceEntry route_rules = 5 [ json_name = "route_rules" ]; + repeated StrategyResourceEntry ratelimit_rules = 6 [ json_name = "ratelimit_rules" ]; + repeated StrategyResourceEntry circuitbreaker_rules = 7 [ json_name = "circuitbreaker_rules" ]; + repeated StrategyResourceEntry faultdetect_rules = 8 [ json_name = "faultdetect_rules" ]; + repeated StrategyResourceEntry lane_rules = 9 [ json_name = "lane_rules" ]; + + repeated StrategyResourceEntry users = 21 [ json_name = "users" ]; + repeated StrategyResourceEntry user_groups = 22 [ json_name = "user_groups" ]; + repeated StrategyResourceEntry roles = 23 [ json_name = "roles" ]; + repeated StrategyResourceEntry auth_policies = 24 [ json_name = "auth_policies" ]; +} + +message StrategyResourceLabel { + string key = 1; + string value = 2; + string compare_type = 3 [ json_name = "compare_type" ]; } message AuthStrategy { @@ -117,18 +169,29 @@ message AuthStrategy { google.protobuf.StringValue owner = 7; google.protobuf.StringValue ctime = 8; google.protobuf.StringValue mtime = 9; - google.protobuf.StringValue auth_token = 10 [json_name = "auth_token"]; - google.protobuf.BoolValue default_strategy = 11 [json_name = "default_strategy"]; + google.protobuf.StringValue auth_token = 10 [ json_name = "auth_token" ]; + google.protobuf.BoolValue default_strategy = 11 + [ json_name = "default_strategy" ]; + map metadata = 12; + google.protobuf.StringValue source = 13; + repeated string functions = 14; + repeated StrategyResourceLabel resource_labels = 15 + [ json_name = "resource_labels" ]; } message ModifyAuthStrategy { google.protobuf.StringValue id = 1; google.protobuf.StringValue name = 2; - Principals add_principals = 3 [json_name = "add_principals"]; - Principals remove_principals = 4 [json_name = "remove_principals"]; - StrategyResources add_resources = 5 [json_name = "add_resources"]; - StrategyResources remove_resources = 6 [json_name = "remove_resources"]; + Principals add_principals = 3 [ json_name = "add_principals" ]; + Principals remove_principals = 4 [ json_name = "remove_principals" ]; + StrategyResources add_resources = 5 [ json_name = "add_resources" ]; + StrategyResources remove_resources = 6 [ json_name = "remove_resources" ]; AuthAction action = 7; google.protobuf.StringValue comment = 8; google.protobuf.StringValue owner = 9; + map metadata = 12; + google.protobuf.StringValue source = 13; + repeated string functions = 14; + repeated StrategyResourceLabel resource_labels = 15 + [ json_name = "resource_labels" ]; } diff --git a/api/v1/traffic_manage/lane.proto b/api/v1/traffic_manage/lane.proto index ac09b95e..9eb00f25 100644 --- a/api/v1/traffic_manage/lane.proto +++ b/api/v1/traffic_manage/lane.proto @@ -13,8 +13,9 @@ option java_outer_classname = "LaneProto"; // 流量入口 message TrafficEntry { // 标记流量入口类型 - // type == "polarismesh.cn/gateway/spring-cloud-gateway", 则 selector 为 ServiceGatewaySelector - // type == "polarismesh.cn/service, 则 selector 为 ServiceSelector + // type == "polarismesh.cn/gateway/spring-cloud-gateway", 则 selector 为 + // ServiceGatewaySelector type == "polarismesh.cn/service, 则 selector 为 + // ServiceSelector string type = 1; google.protobuf.Any selector = 2; } @@ -55,6 +56,8 @@ message LaneGroup { string mtime = 10; // 泳道组内的流量入口信息 repeated LaneRule rules = 11; + // 泳道组标签信息 + map metadata = 20; } // TrafficMatchRule 流量匹配规则 diff --git a/api/v1/traffic_manage/ratelimit.proto b/api/v1/traffic_manage/ratelimit.proto index 004a4046..a12d17f5 100644 --- a/api/v1/traffic_manage/ratelimit.proto +++ b/api/v1/traffic_manage/ratelimit.proto @@ -94,6 +94,8 @@ message Rule { google.protobuf.StringValue etime = 25; // 最大排队时长,单位秒 google.protobuf.UInt32Value max_queue_delay = 26 [json_name = "max_queue_delay"]; + // 限流规则标签数据 + map metadata = 50; } message MatchArgument { diff --git a/api/v1/traffic_manage/routing.proto b/api/v1/traffic_manage/routing.proto index de8f404d..0754f134 100644 --- a/api/v1/traffic_manage/routing.proto +++ b/api/v1/traffic_manage/routing.proto @@ -122,7 +122,10 @@ message RouteRule { string description = 12; // extendInfo 用于承载一些额外信息 // case 1: 升级到 v2 版本时,记录对应到 v1 版本的 id 信息 + // deprecated_filed only for compatible to the old version server map extendInfo = 20; + // 路由规则标签数据 + map metadata = 50; } message MetadataFailover { diff --git a/source/go/api/v1/fault_tolerance/circuitbreaker.pb.go b/source/go/api/v1/fault_tolerance/circuitbreaker.pb.go index d1008e45..5e6121f3 100644 --- a/source/go/api/v1/fault_tolerance/circuitbreaker.pb.go +++ b/source/go/api/v1/fault_tolerance/circuitbreaker.pb.go @@ -55,7 +55,7 @@ func (x Level) String() string { return proto.EnumName(Level_name, int32(x)) } func (Level) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_circuitbreaker_0693457cc1eb1617, []int{0} + return fileDescriptor_circuitbreaker_2a9ca54a8ade1f42, []int{0} } // 主动探测配置 @@ -85,7 +85,7 @@ func (x RecoverConfig_OutlierDetectWhen) String() string { return proto.EnumName(RecoverConfig_OutlierDetectWhen_name, int32(x)) } func (RecoverConfig_OutlierDetectWhen) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_circuitbreaker_0693457cc1eb1617, []int{2, 0} + return fileDescriptor_circuitbreaker_2a9ca54a8ade1f42, []int{2, 0} } // 需要进行熔断的资源 @@ -112,7 +112,7 @@ func (x DestinationSet_Resource) String() string { return proto.EnumName(DestinationSet_Resource_name, int32(x)) } func (DestinationSet_Resource) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_circuitbreaker_0693457cc1eb1617, []int{4, 0} + return fileDescriptor_circuitbreaker_2a9ca54a8ade1f42, []int{4, 0} } // 熔断决策类型,支持GLOBAL(分布式决策)以及LOCAL(本地决策),默认GLOBAL @@ -137,7 +137,7 @@ func (x DestinationSet_Type) String() string { return proto.EnumName(DestinationSet_Type_name, int32(x)) } func (DestinationSet_Type) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_circuitbreaker_0693457cc1eb1617, []int{4, 1} + return fileDescriptor_circuitbreaker_2a9ca54a8ade1f42, []int{4, 1} } // 熔断范围,是否扩散针对相同服务下所有接口进行熔断 @@ -163,7 +163,7 @@ func (x DestinationSet_Scope) String() string { return proto.EnumName(DestinationSet_Scope_name, int32(x)) } func (DestinationSet_Scope) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_circuitbreaker_0693457cc1eb1617, []int{4, 2} + return fileDescriptor_circuitbreaker_2a9ca54a8ade1f42, []int{4, 2} } type ErrorCondition_InputType int32 @@ -189,7 +189,7 @@ func (x ErrorCondition_InputType) String() string { return proto.EnumName(ErrorCondition_InputType_name, int32(x)) } func (ErrorCondition_InputType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_circuitbreaker_0693457cc1eb1617, []int{8, 0} + return fileDescriptor_circuitbreaker_2a9ca54a8ade1f42, []int{8, 0} } type TriggerCondition_TriggerType int32 @@ -215,7 +215,7 @@ func (x TriggerCondition_TriggerType) String() string { return proto.EnumName(TriggerCondition_TriggerType_name, int32(x)) } func (TriggerCondition_TriggerType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_circuitbreaker_0693457cc1eb1617, []int{9, 0} + return fileDescriptor_circuitbreaker_2a9ca54a8ade1f42, []int{9, 0} } // 单个熔断规则定义 @@ -270,7 +270,7 @@ func (m *CircuitBreaker) Reset() { *m = CircuitBreaker{} } func (m *CircuitBreaker) String() string { return proto.CompactTextString(m) } func (*CircuitBreaker) ProtoMessage() {} func (*CircuitBreaker) Descriptor() ([]byte, []int) { - return fileDescriptor_circuitbreaker_0693457cc1eb1617, []int{0} + return fileDescriptor_circuitbreaker_2a9ca54a8ade1f42, []int{0} } func (m *CircuitBreaker) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CircuitBreaker.Unmarshal(m, b) @@ -425,7 +425,7 @@ func (m *SourceMatcher) Reset() { *m = SourceMatcher{} } func (m *SourceMatcher) String() string { return proto.CompactTextString(m) } func (*SourceMatcher) ProtoMessage() {} func (*SourceMatcher) Descriptor() ([]byte, []int) { - return fileDescriptor_circuitbreaker_0693457cc1eb1617, []int{1} + return fileDescriptor_circuitbreaker_2a9ca54a8ade1f42, []int{1} } func (m *SourceMatcher) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SourceMatcher.Unmarshal(m, b) @@ -488,7 +488,7 @@ func (m *RecoverConfig) Reset() { *m = RecoverConfig{} } func (m *RecoverConfig) String() string { return proto.CompactTextString(m) } func (*RecoverConfig) ProtoMessage() {} func (*RecoverConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_circuitbreaker_0693457cc1eb1617, []int{2} + return fileDescriptor_circuitbreaker_2a9ca54a8ade1f42, []int{2} } func (m *RecoverConfig) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_RecoverConfig.Unmarshal(m, b) @@ -568,7 +568,7 @@ func (m *CbPolicy) Reset() { *m = CbPolicy{} } func (m *CbPolicy) String() string { return proto.CompactTextString(m) } func (*CbPolicy) ProtoMessage() {} func (*CbPolicy) Descriptor() ([]byte, []int) { - return fileDescriptor_circuitbreaker_0693457cc1eb1617, []int{3} + return fileDescriptor_circuitbreaker_2a9ca54a8ade1f42, []int{3} } func (m *CbPolicy) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CbPolicy.Unmarshal(m, b) @@ -643,7 +643,7 @@ func (m *CbPolicy_ErrRateConfig) Reset() { *m = CbPolicy_ErrRateConfig{} func (m *CbPolicy_ErrRateConfig) String() string { return proto.CompactTextString(m) } func (*CbPolicy_ErrRateConfig) ProtoMessage() {} func (*CbPolicy_ErrRateConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_circuitbreaker_0693457cc1eb1617, []int{3, 0} + return fileDescriptor_circuitbreaker_2a9ca54a8ade1f42, []int{3, 0} } func (m *CbPolicy_ErrRateConfig) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CbPolicy_ErrRateConfig.Unmarshal(m, b) @@ -714,7 +714,7 @@ func (m *CbPolicy_ErrRateConfig_SpecialConfig) Reset() { *m = CbPolicy_E func (m *CbPolicy_ErrRateConfig_SpecialConfig) String() string { return proto.CompactTextString(m) } func (*CbPolicy_ErrRateConfig_SpecialConfig) ProtoMessage() {} func (*CbPolicy_ErrRateConfig_SpecialConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_circuitbreaker_0693457cc1eb1617, []int{3, 0, 0} + return fileDescriptor_circuitbreaker_2a9ca54a8ade1f42, []int{3, 0, 0} } func (m *CbPolicy_ErrRateConfig_SpecialConfig) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CbPolicy_ErrRateConfig_SpecialConfig.Unmarshal(m, b) @@ -781,7 +781,7 @@ func (m *CbPolicy_SlowRateConfig) Reset() { *m = CbPolicy_SlowRateConfig func (m *CbPolicy_SlowRateConfig) String() string { return proto.CompactTextString(m) } func (*CbPolicy_SlowRateConfig) ProtoMessage() {} func (*CbPolicy_SlowRateConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_circuitbreaker_0693457cc1eb1617, []int{3, 1} + return fileDescriptor_circuitbreaker_2a9ca54a8ade1f42, []int{3, 1} } func (m *CbPolicy_SlowRateConfig) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CbPolicy_SlowRateConfig.Unmarshal(m, b) @@ -846,7 +846,7 @@ func (m *CbPolicy_ConsecutiveErrConfig) Reset() { *m = CbPolicy_Consecut func (m *CbPolicy_ConsecutiveErrConfig) String() string { return proto.CompactTextString(m) } func (*CbPolicy_ConsecutiveErrConfig) ProtoMessage() {} func (*CbPolicy_ConsecutiveErrConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_circuitbreaker_0693457cc1eb1617, []int{3, 2} + return fileDescriptor_circuitbreaker_2a9ca54a8ade1f42, []int{3, 2} } func (m *CbPolicy_ConsecutiveErrConfig) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CbPolicy_ConsecutiveErrConfig.Unmarshal(m, b) @@ -922,7 +922,7 @@ func (m *DestinationSet) Reset() { *m = DestinationSet{} } func (m *DestinationSet) String() string { return proto.CompactTextString(m) } func (*DestinationSet) ProtoMessage() {} func (*DestinationSet) Descriptor() ([]byte, []int) { - return fileDescriptor_circuitbreaker_0693457cc1eb1617, []int{4} + return fileDescriptor_circuitbreaker_2a9ca54a8ade1f42, []int{4} } func (m *DestinationSet) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DestinationSet.Unmarshal(m, b) @@ -1048,7 +1048,7 @@ func (m *CbRule) Reset() { *m = CbRule{} } func (m *CbRule) String() string { return proto.CompactTextString(m) } func (*CbRule) ProtoMessage() {} func (*CbRule) Descriptor() ([]byte, []int) { - return fileDescriptor_circuitbreaker_0693457cc1eb1617, []int{5} + return fileDescriptor_circuitbreaker_2a9ca54a8ade1f42, []int{5} } func (m *CbRule) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CbRule.Unmarshal(m, b) @@ -1094,7 +1094,7 @@ func (m *RuleMatcher) Reset() { *m = RuleMatcher{} } func (m *RuleMatcher) String() string { return proto.CompactTextString(m) } func (*RuleMatcher) ProtoMessage() {} func (*RuleMatcher) Descriptor() ([]byte, []int) { - return fileDescriptor_circuitbreaker_0693457cc1eb1617, []int{6} + return fileDescriptor_circuitbreaker_2a9ca54a8ade1f42, []int{6} } func (m *RuleMatcher) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_RuleMatcher.Unmarshal(m, b) @@ -1140,7 +1140,7 @@ func (m *RuleMatcher_SourceService) Reset() { *m = RuleMatcher_SourceSer func (m *RuleMatcher_SourceService) String() string { return proto.CompactTextString(m) } func (*RuleMatcher_SourceService) ProtoMessage() {} func (*RuleMatcher_SourceService) Descriptor() ([]byte, []int) { - return fileDescriptor_circuitbreaker_0693457cc1eb1617, []int{6, 0} + return fileDescriptor_circuitbreaker_2a9ca54a8ade1f42, []int{6, 0} } func (m *RuleMatcher_SourceService) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_RuleMatcher_SourceService.Unmarshal(m, b) @@ -1175,9 +1175,10 @@ func (m *RuleMatcher_SourceService) GetNamespace() string { } type RuleMatcher_DestinationService struct { - Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` - Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` - Method *model.MatchString `protobuf:"bytes,3,opt,name=method,proto3" json:"method,omitempty"` + Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` + Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` + // deprecated_filed using api.path in blockConfig instead + Method *model.MatchString `protobuf:"bytes,3,opt,name=method,proto3" json:"method,omitempty"` // Deprecated: Do not use. XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -1187,7 +1188,7 @@ func (m *RuleMatcher_DestinationService) Reset() { *m = RuleMatcher_Dest func (m *RuleMatcher_DestinationService) String() string { return proto.CompactTextString(m) } func (*RuleMatcher_DestinationService) ProtoMessage() {} func (*RuleMatcher_DestinationService) Descriptor() ([]byte, []int) { - return fileDescriptor_circuitbreaker_0693457cc1eb1617, []int{6, 1} + return fileDescriptor_circuitbreaker_2a9ca54a8ade1f42, []int{6, 1} } func (m *RuleMatcher_DestinationService) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_RuleMatcher_DestinationService.Unmarshal(m, b) @@ -1221,6 +1222,7 @@ func (m *RuleMatcher_DestinationService) GetNamespace() string { return "" } +// Deprecated: Do not use. func (m *RuleMatcher_DestinationService) GetMethod() *model.MatchString { if m != nil { return m.Method @@ -1251,10 +1253,10 @@ type CircuitBreakerRule struct { Level Level `protobuf:"varint,21,opt,name=level,proto3,enum=v1.Level" json:"level,omitempty"` // match condition for this rule RuleMatcher *RuleMatcher `protobuf:"bytes,22,opt,name=rule_matcher,json=ruleMatcher,proto3" json:"rule_matcher,omitempty"` - // error conditions to judge an invocation as an error - ErrorConditions []*ErrorCondition `protobuf:"bytes,23,rep,name=error_conditions,json=errorConditions,proto3" json:"error_conditions,omitempty"` - // trigger condition to trigger circuitbreaking - TriggerCondition []*TriggerCondition `protobuf:"bytes,24,rep,name=trigger_condition,json=triggerCondition,proto3" json:"trigger_condition,omitempty"` + // deprecated_filed error conditions to judge an invocation as an error + ErrorConditions []*ErrorCondition `protobuf:"bytes,23,rep,name=error_conditions,json=errorConditions,proto3" json:"error_conditions,omitempty"` // Deprecated: Do not use. + // deprecated_filed trigger condition to trigger circuitbreaking + TriggerCondition []*TriggerCondition `protobuf:"bytes,24,rep,name=trigger_condition,json=triggerCondition,proto3" json:"trigger_condition,omitempty"` // Deprecated: Do not use. // the maximum % of an upstream cluster that can be ejected MaxEjectionPercent uint32 `protobuf:"varint,25,opt,name=max_ejection_percent,json=maxEjectionPercent,proto3" json:"max_ejection_percent,omitempty"` // recover condition to make resource open to close @@ -1262,17 +1264,23 @@ type CircuitBreakerRule struct { // fault detection enable config FaultDetectConfig *FaultDetectConfig `protobuf:"bytes,27,opt,name=faultDetectConfig,proto3" json:"faultDetectConfig,omitempty"` // fall back configuration - FallbackConfig *FallbackConfig `protobuf:"bytes,28,opt,name=fallbackConfig,proto3" json:"fallbackConfig,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + FallbackConfig *FallbackConfig `protobuf:"bytes,28,opt,name=fallbackConfig,proto3" json:"fallbackConfig,omitempty"` + // list for block configuration + BlockConfigs []*BlockConfig `protobuf:"bytes,29,rep,name=block_configs,proto3" json:"block_configs,omitempty"` + // priority rules priority + Priority uint32 `protobuf:"varint,30,opt,name=priority,proto3" json:"priority,omitempty"` + // 熔断规则标签数据 + Metadata map[string]string `protobuf:"bytes,50,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *CircuitBreakerRule) Reset() { *m = CircuitBreakerRule{} } func (m *CircuitBreakerRule) String() string { return proto.CompactTextString(m) } func (*CircuitBreakerRule) ProtoMessage() {} func (*CircuitBreakerRule) Descriptor() ([]byte, []int) { - return fileDescriptor_circuitbreaker_0693457cc1eb1617, []int{7} + return fileDescriptor_circuitbreaker_2a9ca54a8ade1f42, []int{7} } func (m *CircuitBreakerRule) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CircuitBreakerRule.Unmarshal(m, b) @@ -1369,6 +1377,7 @@ func (m *CircuitBreakerRule) GetRuleMatcher() *RuleMatcher { return nil } +// Deprecated: Do not use. func (m *CircuitBreakerRule) GetErrorConditions() []*ErrorCondition { if m != nil { return m.ErrorConditions @@ -1376,6 +1385,7 @@ func (m *CircuitBreakerRule) GetErrorConditions() []*ErrorCondition { return nil } +// Deprecated: Do not use. func (m *CircuitBreakerRule) GetTriggerCondition() []*TriggerCondition { if m != nil { return m.TriggerCondition @@ -1411,6 +1421,27 @@ func (m *CircuitBreakerRule) GetFallbackConfig() *FallbackConfig { return nil } +func (m *CircuitBreakerRule) GetBlockConfigs() []*BlockConfig { + if m != nil { + return m.BlockConfigs + } + return nil +} + +func (m *CircuitBreakerRule) GetPriority() uint32 { + if m != nil { + return m.Priority + } + return 0 +} + +func (m *CircuitBreakerRule) GetMetadata() map[string]string { + if m != nil { + return m.Metadata + } + return nil +} + // the condition to judge an input invocation as an error type ErrorCondition struct { InputType ErrorCondition_InputType `protobuf:"varint,1,opt,name=input_type,json=inputType,proto3,enum=v1.ErrorCondition_InputType" json:"input_type,omitempty"` @@ -1424,7 +1455,7 @@ func (m *ErrorCondition) Reset() { *m = ErrorCondition{} } func (m *ErrorCondition) String() string { return proto.CompactTextString(m) } func (*ErrorCondition) ProtoMessage() {} func (*ErrorCondition) Descriptor() ([]byte, []int) { - return fileDescriptor_circuitbreaker_0693457cc1eb1617, []int{8} + return fileDescriptor_circuitbreaker_2a9ca54a8ade1f42, []int{8} } func (m *ErrorCondition) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ErrorCondition.Unmarshal(m, b) @@ -1474,7 +1505,7 @@ func (m *TriggerCondition) Reset() { *m = TriggerCondition{} } func (m *TriggerCondition) String() string { return proto.CompactTextString(m) } func (*TriggerCondition) ProtoMessage() {} func (*TriggerCondition) Descriptor() ([]byte, []int) { - return fileDescriptor_circuitbreaker_0693457cc1eb1617, []int{9} + return fileDescriptor_circuitbreaker_2a9ca54a8ade1f42, []int{9} } func (m *TriggerCondition) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_TriggerCondition.Unmarshal(m, b) @@ -1529,6 +1560,7 @@ func (m *TriggerCondition) GetMinimumRequest() uint32 { return 0 } +// circuitbreaking OPEN status recover type RecoverCondition struct { // seconds from open to half-open SleepWindow uint32 `protobuf:"varint,1,opt,name=sleep_window,json=sleepWindow,proto3" json:"sleep_window,omitempty"` @@ -1543,7 +1575,7 @@ func (m *RecoverCondition) Reset() { *m = RecoverCondition{} } func (m *RecoverCondition) String() string { return proto.CompactTextString(m) } func (*RecoverCondition) ProtoMessage() {} func (*RecoverCondition) Descriptor() ([]byte, []int) { - return fileDescriptor_circuitbreaker_0693457cc1eb1617, []int{10} + return fileDescriptor_circuitbreaker_2a9ca54a8ade1f42, []int{10} } func (m *RecoverCondition) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_RecoverCondition.Unmarshal(m, b) @@ -1577,6 +1609,7 @@ func (m *RecoverCondition) GetConsecutiveSuccess() uint32 { return 0 } +// fault detect config within circuitbreaking type FaultDetectConfig struct { Enable bool `protobuf:"varint,1,opt,name=enable,proto3" json:"enable,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -1588,7 +1621,7 @@ func (m *FaultDetectConfig) Reset() { *m = FaultDetectConfig{} } func (m *FaultDetectConfig) String() string { return proto.CompactTextString(m) } func (*FaultDetectConfig) ProtoMessage() {} func (*FaultDetectConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_circuitbreaker_0693457cc1eb1617, []int{11} + return fileDescriptor_circuitbreaker_2a9ca54a8ade1f42, []int{11} } func (m *FaultDetectConfig) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FaultDetectConfig.Unmarshal(m, b) @@ -1615,6 +1648,7 @@ func (m *FaultDetectConfig) GetEnable() bool { return false } +// fallback config type FallbackConfig struct { Enable bool `protobuf:"varint,1,opt,name=enable,proto3" json:"enable,omitempty"` Response *FallbackResponse `protobuf:"bytes,2,opt,name=response,proto3" json:"response,omitempty"` @@ -1627,7 +1661,7 @@ func (m *FallbackConfig) Reset() { *m = FallbackConfig{} } func (m *FallbackConfig) String() string { return proto.CompactTextString(m) } func (*FallbackConfig) ProtoMessage() {} func (*FallbackConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_circuitbreaker_0693457cc1eb1617, []int{12} + return fileDescriptor_circuitbreaker_2a9ca54a8ade1f42, []int{12} } func (m *FallbackConfig) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FallbackConfig.Unmarshal(m, b) @@ -1661,6 +1695,7 @@ func (m *FallbackConfig) GetResponse() *FallbackResponse { return nil } +// fallback response type FallbackResponse struct { Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Headers []*FallbackResponse_MessageHeader `protobuf:"bytes,2,rep,name=headers,proto3" json:"headers,omitempty"` @@ -1674,7 +1709,7 @@ func (m *FallbackResponse) Reset() { *m = FallbackResponse{} } func (m *FallbackResponse) String() string { return proto.CompactTextString(m) } func (*FallbackResponse) ProtoMessage() {} func (*FallbackResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_circuitbreaker_0693457cc1eb1617, []int{13} + return fileDescriptor_circuitbreaker_2a9ca54a8ade1f42, []int{13} } func (m *FallbackResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FallbackResponse.Unmarshal(m, b) @@ -1727,7 +1762,7 @@ func (m *FallbackResponse_MessageHeader) Reset() { *m = FallbackResponse func (m *FallbackResponse_MessageHeader) String() string { return proto.CompactTextString(m) } func (*FallbackResponse_MessageHeader) ProtoMessage() {} func (*FallbackResponse_MessageHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_circuitbreaker_0693457cc1eb1617, []int{13, 0} + return fileDescriptor_circuitbreaker_2a9ca54a8ade1f42, []int{13, 0} } func (m *FallbackResponse_MessageHeader) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FallbackResponse_MessageHeader.Unmarshal(m, b) @@ -1761,6 +1796,72 @@ func (m *FallbackResponse_MessageHeader) GetValue() string { return "" } +// blocking strategy +type BlockConfig struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // blocking target api + Api *model.API `protobuf:"bytes,2,opt,name=api,proto3" json:"api,omitempty"` + // conditions to judge an invocation as an error + ErrorConditions []*ErrorCondition `protobuf:"bytes,3,rep,name=error_conditions,proto3" json:"error_conditions,omitempty"` + // trigger condition to trigger circuitbreaking + TriggerConditions []*TriggerCondition `protobuf:"bytes,4,rep,name=trigger_conditions,proto3" json:"trigger_conditions,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *BlockConfig) Reset() { *m = BlockConfig{} } +func (m *BlockConfig) String() string { return proto.CompactTextString(m) } +func (*BlockConfig) ProtoMessage() {} +func (*BlockConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_circuitbreaker_2a9ca54a8ade1f42, []int{14} +} +func (m *BlockConfig) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_BlockConfig.Unmarshal(m, b) +} +func (m *BlockConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_BlockConfig.Marshal(b, m, deterministic) +} +func (dst *BlockConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockConfig.Merge(dst, src) +} +func (m *BlockConfig) XXX_Size() int { + return xxx_messageInfo_BlockConfig.Size(m) +} +func (m *BlockConfig) XXX_DiscardUnknown() { + xxx_messageInfo_BlockConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_BlockConfig proto.InternalMessageInfo + +func (m *BlockConfig) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *BlockConfig) GetApi() *model.API { + if m != nil { + return m.Api + } + return nil +} + +func (m *BlockConfig) GetErrorConditions() []*ErrorCondition { + if m != nil { + return m.ErrorConditions + } + return nil +} + +func (m *BlockConfig) GetTriggerConditions() []*TriggerCondition { + if m != nil { + return m.TriggerConditions + } + return nil +} + func init() { proto.RegisterType((*CircuitBreaker)(nil), "v1.CircuitBreaker") proto.RegisterType((*SourceMatcher)(nil), "v1.SourceMatcher") @@ -1778,6 +1879,7 @@ func init() { proto.RegisterType((*RuleMatcher_SourceService)(nil), "v1.RuleMatcher.SourceService") proto.RegisterType((*RuleMatcher_DestinationService)(nil), "v1.RuleMatcher.DestinationService") proto.RegisterType((*CircuitBreakerRule)(nil), "v1.CircuitBreakerRule") + proto.RegisterMapType((map[string]string)(nil), "v1.CircuitBreakerRule.MetadataEntry") proto.RegisterType((*ErrorCondition)(nil), "v1.ErrorCondition") proto.RegisterType((*TriggerCondition)(nil), "v1.TriggerCondition") proto.RegisterType((*RecoverCondition)(nil), "v1.RecoverCondition") @@ -1785,6 +1887,7 @@ func init() { proto.RegisterType((*FallbackConfig)(nil), "v1.FallbackConfig") proto.RegisterType((*FallbackResponse)(nil), "v1.FallbackResponse") proto.RegisterType((*FallbackResponse_MessageHeader)(nil), "v1.FallbackResponse.MessageHeader") + proto.RegisterType((*BlockConfig)(nil), "v1.BlockConfig") proto.RegisterEnum("v1.Level", Level_name, Level_value) proto.RegisterEnum("v1.RecoverConfig_OutlierDetectWhen", RecoverConfig_OutlierDetectWhen_name, RecoverConfig_OutlierDetectWhen_value) proto.RegisterEnum("v1.DestinationSet_Resource", DestinationSet_Resource_name, DestinationSet_Resource_value) @@ -1795,144 +1898,152 @@ func init() { } func init() { - proto.RegisterFile("circuitbreaker.proto", fileDescriptor_circuitbreaker_0693457cc1eb1617) -} - -var fileDescriptor_circuitbreaker_0693457cc1eb1617 = []byte{ - // 2158 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x59, 0x4f, 0x77, 0xdb, 0xc6, - 0x11, 0x0f, 0x29, 0xf1, 0xdf, 0x50, 0xa4, 0xa1, 0x8d, 0xe4, 0xc0, 0xb4, 0xd3, 0x28, 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, 0x05, 0x12, 0x89, - 0xbe, 0x01, 0x90, 0xc6, 0xb5, 0xe8, 0x98, 0x04, 0x66, 0x56, 0xda, 0x72, 0x73, 0x89, 0x77, 0xe8, - 0xf3, 0xfb, 0x5f, 0xea, 0xdb, 0x79, 0x0e, 0xff, 0xff, 0x75, 0x70, 0xed, 0x77, 0x59, 0xa8, 0x26, - 0xf3, 0xf0, 0x9d, 0xe2, 0x72, 0x17, 0x72, 0xa2, 0xba, 0x73, 0x1d, 0x86, 0x57, 0x64, 0xaa, 0xc2, - 0xa1, 0x2e, 0xbc, 0x1f, 0xa5, 0xfb, 0xdb, 0x3a, 0x64, 0x15, 0x11, 0x1d, 0x40, 0x75, 0xbe, 0x9c, - 0xda, 0x1d, 0x0b, 0x9c, 0xda, 0x6f, 0xb2, 0xb0, 0xb5, 0x2a, 0x95, 0xdf, 0xc9, 0x27, 0xbf, 0x82, - 0x9b, 0x76, 0x42, 0x17, 0x65, 0xf1, 0x57, 0x4d, 0x93, 0xb0, 0x57, 0x29, 0x10, 0xb5, 0x60, 0x59, - 0xac, 0xaf, 0xcd, 0x14, 0xb5, 0x60, 0x35, 0xb7, 0xfe, 0xfb, 0x02, 0x54, 0x0f, 0x48, 0xc0, 0x1d, - 0x5f, 0x9e, 0x57, 0x9f, 0xf0, 0xff, 0x49, 0xef, 0xf4, 0x08, 0x8a, 0x1e, 0xe1, 0xd6, 0xd8, 0xe2, - 0x96, 0xee, 0x02, 0x76, 0x44, 0xe2, 0x27, 0x2d, 0x6b, 0x3c, 0xd7, 0x10, 0xd5, 0x40, 0xcd, 0x18, - 0xe2, 0xe6, 0x61, 0x24, 0x90, 0x9d, 0x96, 0x8c, 0x83, 0xaa, 0xba, 0x79, 0x16, 0xd8, 0x58, 0x43, - 0xf0, 0x0c, 0x8c, 0xee, 0xe8, 0xba, 0x90, 0x93, 0xa4, 0x0f, 0x56, 0x90, 0x06, 0x17, 0x93, 0xa8, - 0x24, 0x34, 0x20, 0x17, 0xd8, 0x74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8, 0x8a, 0x2c, 0x78, 0x82, 0x7b, 0xc7, 0x47, 0xc6, - 0x5a, 0xa2, 0x05, 0x59, 0xdf, 0xff, 0x63, 0x06, 0x1e, 0xd8, 0xd4, 0x6b, 0x70, 0xe2, 0x8b, 0x18, - 0x6c, 0x4c, 0xa8, 0x6b, 0x31, 0x27, 0x68, 0xc8, 0x09, 0xf9, 0xc4, 0xb1, 0xd5, 0x3f, 0x3d, 0xac, - 0x89, 0x23, 0xde, 0x54, 0x96, 0x91, 0x06, 0xa7, 0x2e, 0x61, 0x96, 0x6f, 0x93, 0xfd, 0xf7, 0x93, - 0x57, 0xd8, 0x91, 0x68, 0xb1, 0x5e, 0xb5, 0x4f, 0x1d, 0x7e, 0x16, 0x8e, 0x1a, 0x36, 0xf5, 0x76, - 0xb5, 0x36, 0x8f, 0x04, 0x67, 0xbb, 0x09, 0x8d, 0xbb, 0xaa, 0x1b, 0xd8, 0x3d, 0xa5, 0xbb, 0xd6, - 0xc4, 0xd9, 0x9d, 0xde, 0xdb, 0x95, 0xba, 0x87, 0x33, 0xdd, 0xa3, 0xbc, 0x6c, 0xd8, 0xbe, 0xf8, - 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x2f, 0x17, 0x2d, 0x00, 0xc4, 0x19, 0x00, 0x00, + proto.RegisterFile("circuitbreaker.proto", fileDescriptor_circuitbreaker_2a9ca54a8ade1f42) +} + +var fileDescriptor_circuitbreaker_2a9ca54a8ade1f42 = []byte{ + // 2278 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x59, 0xcd, 0x73, 0xdb, 0xc6, + 0x15, 0x0f, 0x29, 0xf1, 0xeb, 0x51, 0xa4, 0xa1, 0x8d, 0xe4, 0xc0, 0xb4, 0x93, 0x28, 0x4c, 0xda, + 0x78, 0xea, 0x94, 0xb2, 0x95, 0xd8, 0xf1, 0xd8, 0x6e, 0x1b, 0x8a, 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xaf, 0xb4, 0x39, 0xc4, 0x3f, 0xdf, 0x4f, 0x68, + 0xdc, 0x97, 0x03, 0xdb, 0xfe, 0x84, 0xee, 0x1b, 0x9e, 0xb5, 0x3f, 0xbd, 0xb5, 0x2f, 0x74, 0x0f, + 0x67, 0xba, 0x47, 0x79, 0x31, 0x53, 0x7f, 0xf9, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x1e, 0xcc, + 0x44, 0x22, 0x67, 0x1b, 0x00, 0x00, } diff --git a/source/go/api/v1/fault_tolerance/fault_detector.pb.go b/source/go/api/v1/fault_tolerance/fault_detector.pb.go index a8c8532a..5d2cd49e 100644 --- a/source/go/api/v1/fault_tolerance/fault_detector.pb.go +++ b/source/go/api/v1/fault_tolerance/fault_detector.pb.go @@ -46,7 +46,7 @@ func (x FaultDetectRule_Protocol) String() string { return proto.EnumName(FaultDetectRule_Protocol_name, int32(x)) } func (FaultDetectRule_Protocol) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_fault_detector_4af7b01d1c238a61, []int{1, 0} + return fileDescriptor_fault_detector_32e81b52a3510e0d, []int{1, 0} } type FaultDetector struct { @@ -63,7 +63,7 @@ func (m *FaultDetector) Reset() { *m = FaultDetector{} } func (m *FaultDetector) String() string { return proto.CompactTextString(m) } func (*FaultDetector) ProtoMessage() {} func (*FaultDetector) Descriptor() ([]byte, []int) { - return fileDescriptor_fault_detector_4af7b01d1c238a61, []int{0} + return fileDescriptor_fault_detector_32e81b52a3510e0d, []int{0} } func (m *FaultDetector) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FaultDetector.Unmarshal(m, b) @@ -125,17 +125,21 @@ type FaultDetectRule struct { // tcp detect config TcpConfig *TcpProtocolConfig `protobuf:"bytes,27,opt,name=tcp_config,json=tcpConfig,proto3" json:"tcp_config,omitempty"` // udp detect config - UdpConfig *UdpProtocolConfig `protobuf:"bytes,28,opt,name=udp_config,json=udpConfig,proto3" json:"udp_config,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + UdpConfig *UdpProtocolConfig `protobuf:"bytes,28,opt,name=udp_config,json=udpConfig,proto3" json:"udp_config,omitempty"` + // priority rules priority + Priority uint32 `protobuf:"varint,29,opt,name=priority,proto3" json:"priority,omitempty"` + // 探测规则标签数据 + Metadata map[string]string `protobuf:"bytes,50,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *FaultDetectRule) Reset() { *m = FaultDetectRule{} } func (m *FaultDetectRule) String() string { return proto.CompactTextString(m) } func (*FaultDetectRule) ProtoMessage() {} func (*FaultDetectRule) Descriptor() ([]byte, []int) { - return fileDescriptor_fault_detector_4af7b01d1c238a61, []int{1} + return fileDescriptor_fault_detector_32e81b52a3510e0d, []int{1} } func (m *FaultDetectRule) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FaultDetectRule.Unmarshal(m, b) @@ -260,10 +264,26 @@ func (m *FaultDetectRule) GetUdpConfig() *UdpProtocolConfig { return nil } +func (m *FaultDetectRule) GetPriority() uint32 { + if m != nil { + return m.Priority + } + return 0 +} + +func (m *FaultDetectRule) GetMetadata() map[string]string { + if m != nil { + return m.Metadata + } + return nil +} + type FaultDetectRule_DestinationService struct { - Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` - Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` - Method *model.MatchString `protobuf:"bytes,3,opt,name=method,proto3" json:"method,omitempty"` + Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` + Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` + // deprecated_filed use api.path instead + Method *model.MatchString `protobuf:"bytes,3,opt,name=method,proto3" json:"method,omitempty"` // Deprecated: Do not use. + Api *model.API `protobuf:"bytes,4,opt,name=api,proto3" json:"api,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -273,7 +293,7 @@ func (m *FaultDetectRule_DestinationService) Reset() { *m = FaultDetectR func (m *FaultDetectRule_DestinationService) String() string { return proto.CompactTextString(m) } func (*FaultDetectRule_DestinationService) ProtoMessage() {} func (*FaultDetectRule_DestinationService) Descriptor() ([]byte, []int) { - return fileDescriptor_fault_detector_4af7b01d1c238a61, []int{1, 0} + return fileDescriptor_fault_detector_32e81b52a3510e0d, []int{1, 0} } func (m *FaultDetectRule_DestinationService) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FaultDetectRule_DestinationService.Unmarshal(m, b) @@ -307,6 +327,7 @@ func (m *FaultDetectRule_DestinationService) GetNamespace() string { return "" } +// Deprecated: Do not use. func (m *FaultDetectRule_DestinationService) GetMethod() *model.MatchString { if m != nil { return m.Method @@ -314,6 +335,13 @@ func (m *FaultDetectRule_DestinationService) GetMethod() *model.MatchString { return nil } +func (m *FaultDetectRule_DestinationService) GetApi() *model.API { + if m != nil { + return m.Api + } + return nil +} + type HttpProtocolConfig struct { Method string `protobuf:"bytes,1,opt,name=method,proto3" json:"method,omitempty"` Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` @@ -328,7 +356,7 @@ func (m *HttpProtocolConfig) Reset() { *m = HttpProtocolConfig{} } func (m *HttpProtocolConfig) String() string { return proto.CompactTextString(m) } func (*HttpProtocolConfig) ProtoMessage() {} func (*HttpProtocolConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_fault_detector_4af7b01d1c238a61, []int{2} + return fileDescriptor_fault_detector_32e81b52a3510e0d, []int{2} } func (m *HttpProtocolConfig) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_HttpProtocolConfig.Unmarshal(m, b) @@ -388,7 +416,7 @@ func (m *HttpProtocolConfig_MessageHeader) Reset() { *m = HttpProtocolCo func (m *HttpProtocolConfig_MessageHeader) String() string { return proto.CompactTextString(m) } func (*HttpProtocolConfig_MessageHeader) ProtoMessage() {} func (*HttpProtocolConfig_MessageHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_fault_detector_4af7b01d1c238a61, []int{2, 0} + return fileDescriptor_fault_detector_32e81b52a3510e0d, []int{2, 0} } func (m *HttpProtocolConfig_MessageHeader) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_HttpProtocolConfig_MessageHeader.Unmarshal(m, b) @@ -434,7 +462,7 @@ func (m *TcpProtocolConfig) Reset() { *m = TcpProtocolConfig{} } func (m *TcpProtocolConfig) String() string { return proto.CompactTextString(m) } func (*TcpProtocolConfig) ProtoMessage() {} func (*TcpProtocolConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_fault_detector_4af7b01d1c238a61, []int{3} + return fileDescriptor_fault_detector_32e81b52a3510e0d, []int{3} } func (m *TcpProtocolConfig) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_TcpProtocolConfig.Unmarshal(m, b) @@ -480,7 +508,7 @@ func (m *UdpProtocolConfig) Reset() { *m = UdpProtocolConfig{} } func (m *UdpProtocolConfig) String() string { return proto.CompactTextString(m) } func (*UdpProtocolConfig) ProtoMessage() {} func (*UdpProtocolConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_fault_detector_4af7b01d1c238a61, []int{4} + return fileDescriptor_fault_detector_32e81b52a3510e0d, []int{4} } func (m *UdpProtocolConfig) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UdpProtocolConfig.Unmarshal(m, b) @@ -517,6 +545,7 @@ func (m *UdpProtocolConfig) GetReceive() []string { func init() { proto.RegisterType((*FaultDetector)(nil), "v1.FaultDetector") proto.RegisterType((*FaultDetectRule)(nil), "v1.FaultDetectRule") + proto.RegisterMapType((map[string]string)(nil), "v1.FaultDetectRule.MetadataEntry") proto.RegisterType((*FaultDetectRule_DestinationService)(nil), "v1.FaultDetectRule.DestinationService") proto.RegisterType((*HttpProtocolConfig)(nil), "v1.HttpProtocolConfig") proto.RegisterType((*HttpProtocolConfig_MessageHeader)(nil), "v1.HttpProtocolConfig.MessageHeader") @@ -526,52 +555,57 @@ func init() { } func init() { - proto.RegisterFile("fault_detector.proto", fileDescriptor_fault_detector_4af7b01d1c238a61) -} - -var fileDescriptor_fault_detector_4af7b01d1c238a61 = []byte{ - // 682 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xdd, 0x4e, 0xdb, 0x4a, - 0x10, 0x3e, 0xce, 0x0f, 0x09, 0x13, 0x05, 0x72, 0xf6, 0x00, 0x67, 0x4f, 0x0e, 0x17, 0x51, 0x54, - 0xb5, 0xe9, 0x8d, 0x23, 0x42, 0x25, 0xb8, 0xaa, 0x54, 0xa0, 0x15, 0x6a, 0x05, 0x8d, 0x4c, 0x68, - 0xa5, 0xde, 0xa0, 0x65, 0x3d, 0x24, 0xab, 0xda, 0x5e, 0x6b, 0x77, 0x6d, 0x89, 0x07, 0xe9, 0x53, - 0xf5, 0x41, 0xfa, 0x1a, 0xd5, 0xae, 0xed, 0x40, 0x08, 0x37, 0xbd, 0xca, 0x7c, 0x33, 0xdf, 0x37, - 0x33, 0x99, 0x99, 0x35, 0xec, 0xdc, 0xb1, 0x2c, 0x32, 0x37, 0x21, 0x1a, 0xe4, 0x46, 0x2a, 0x3f, - 0x55, 0xd2, 0x48, 0x52, 0xcb, 0x0f, 0xfa, 0x9d, 0x58, 0x86, 0x18, 0x15, 0x8e, 0xe1, 0x17, 0xe8, - 0x7e, 0xb0, 0xc4, 0xb3, 0x92, 0x47, 0x5e, 0x43, 0x53, 0x65, 0x11, 0x6a, 0xea, 0x0d, 0xea, 0xa3, - 0xce, 0xe4, 0x1f, 0x3f, 0x3f, 0xf0, 0x1f, 0x31, 0x82, 0x2c, 0xc2, 0xa0, 0x60, 0x90, 0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, 0xbd, 0x78, 0x7e, 0x27, 0xfe, 0x05, 0x6a, 0xcd, - 0xe6, 0x78, 0xee, 0xc8, 0x41, 0x25, 0xb2, 0x57, 0x72, 0x2b, 0xc3, 0xfb, 0xf2, 0x41, 0x38, 0xbb, - 0x7f, 0x04, 0xdd, 0x15, 0xb6, 0x2d, 0xfb, 0x1d, 0xef, 0xcb, 0x5e, 0xac, 0x69, 0x5f, 0x46, 0xce, - 0xa2, 0xac, 0x9a, 0x5a, 0x01, 0x86, 0xef, 0xe0, 0xef, 0xb5, 0xad, 0xda, 0x0a, 0x1a, 0x93, 0xea, - 0x9f, 0x38, 0xdb, 0xae, 0x44, 0x21, 0x47, 0x91, 0xdb, 0x04, 0x75, 0xbb, 0x92, 0x12, 0xda, 0x14, - 0x6b, 0x2b, 0xfe, 0xb3, 0x14, 0x27, 0x3f, 0x3c, 0x38, 0xe6, 0x32, 0xf6, 0x0d, 0x26, 0x1c, 0x13, - 0xe3, 0xa7, 0x32, 0x62, 0x4a, 0x68, 0x5f, 0xa7, 0xc8, 0xc5, 0x9d, 0xe0, 0xee, 0x38, 0x7c, 0x96, - 0x0a, 0x3b, 0x29, 0xf7, 0xa1, 0xf3, 0x8d, 0x8c, 0x50, 0xb1, 0x84, 0xe3, 0x09, 0x59, 0xf9, 0xa0, - 0xb9, 0x3e, 0xbe, 0xbd, 0x9f, 0x0b, 0xb3, 0xc8, 0x6e, 0x7d, 0x2e, 0xe3, 0x71, 0x99, 0x2c, 0x46, - 0xbd, 0x18, 0xaf, 0x24, 0x1c, 0x6b, 0x99, 0x29, 0x8e, 0xe3, 0xb9, 0x1c, 0xb3, 0x54, 0x8c, 0xf3, - 0x83, 0x71, 0xf1, 0x0d, 0x5d, 0xa6, 0xbe, 0xdd, 0x70, 0x8f, 0xe9, 0xf0, 0x77, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x5b, 0x34, 0xf6, 0x08, 0x5d, 0x05, 0x00, 0x00, + proto.RegisterFile("fault_detector.proto", fileDescriptor_fault_detector_32e81b52a3510e0d) +} + +var fileDescriptor_fault_detector_32e81b52a3510e0d = []byte{ + // 756 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xdd, 0x6e, 0xe3, 0x44, + 0x14, 0xc6, 0x76, 0xdb, 0xa4, 0xc7, 0x4a, 0x37, 0x0c, 0xdb, 0x32, 0x1b, 0x8a, 0x14, 0x22, 0x84, + 0x82, 0x90, 0x1c, 0x35, 0x8b, 0xb4, 0x15, 0x08, 0xa4, 0xed, 0x76, 0x51, 0x01, 0xa5, 0x44, 0xde, + 0x14, 0x24, 0x6e, 0xaa, 0xe9, 0xf8, 0x34, 0x19, 0x61, 0x7b, 0xac, 0xf1, 0xd8, 0x52, 0xde, 0x03, + 0xae, 0x79, 0x20, 0x5e, 0x0a, 0xcd, 0xf8, 0x67, 0x93, 0x26, 0x17, 0x70, 0x95, 0xf3, 0xf3, 0x7d, + 0xc7, 0xe7, 0xe7, 0xcb, 0xc0, 0xf3, 0x47, 0x56, 0xc4, 0xfa, 0x3e, 0x42, 0x8d, 0x5c, 0x4b, 0x15, + 0x64, 0x4a, 0x6a, 0x49, 0xdc, 0xf2, 0x62, 0xe0, 0x27, 0x32, 0xc2, 0xb8, 0x0a, 0x8c, 0x7e, 0x85, + 0xde, 0x0f, 0x06, 0x78, 0x5d, 0xe3, 0xc8, 0x97, 0x70, 0xa8, 0x8a, 0x18, 0x73, 0xea, 0x0c, 0xbd, + 0xb1, 0x3f, 0xfd, 0x28, 0x28, 0x2f, 0x82, 0x0d, 0x44, 0x58, 0xc4, 0x18, 0x56, 0x08, 0x32, 0x80, + 0xae, 0xc2, 0x52, 0xe4, 0x42, 0xa6, 0xd4, 0x1d, 0x3a, 0xe3, 0xe3, 0xb0, 0xf5, 0x47, 0x7f, 0x77, + 0xe0, 0xd9, 0x13, 0x1a, 0x39, 0x01, 0x57, 0x44, 0xd4, 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, 0x4b, 0x30, 0x5f, 0x4d, 0xb6, 0x0a, 0x4e, 0x72, + 0x59, 0x28, 0x8e, 0x93, 0xa5, 0x9c, 0xb0, 0x4c, 0x4c, 0xca, 0x8b, 0x49, 0xf5, 0xf6, 0xb7, 0xa5, + 0x1f, 0x8e, 0xec, 0x23, 0xf0, 0xf2, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x23, 0x47, 0xad, 0xad, + 0x15, 0x06, 0x00, 0x00, } diff --git a/source/go/api/v1/model/model.pb.go b/source/go/api/v1/model/model.pb.go index 33923c5c..e0fa3966 100644 --- a/source/go/api/v1/model/model.pb.go +++ b/source/go/api/v1/model/model.pb.go @@ -57,7 +57,7 @@ func (x MatchString_MatchStringType) String() string { return proto.EnumName(MatchString_MatchStringType_name, int32(x)) } func (MatchString_MatchStringType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_model_89bde6c9fe109cf9, []int{1, 0} + return fileDescriptor_model_8c44d8b41ee50248, []int{1, 0} } type MatchString_ValueType int32 @@ -83,7 +83,7 @@ func (x MatchString_ValueType) String() string { return proto.EnumName(MatchString_ValueType_name, int32(x)) } func (MatchString_ValueType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_model_89bde6c9fe109cf9, []int{1, 1} + return fileDescriptor_model_8c44d8b41ee50248, []int{1, 1} } type Location struct { @@ -99,7 +99,7 @@ func (m *Location) Reset() { *m = Location{} } func (m *Location) String() string { return proto.CompactTextString(m) } func (*Location) ProtoMessage() {} func (*Location) Descriptor() ([]byte, []int) { - return fileDescriptor_model_89bde6c9fe109cf9, []int{0} + return fileDescriptor_model_8c44d8b41ee50248, []int{0} } func (m *Location) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Location.Unmarshal(m, b) @@ -153,7 +153,7 @@ func (m *MatchString) Reset() { *m = MatchString{} } func (m *MatchString) String() string { return proto.CompactTextString(m) } func (*MatchString) ProtoMessage() {} func (*MatchString) Descriptor() ([]byte, []int) { - return fileDescriptor_model_89bde6c9fe109cf9, []int{1} + return fileDescriptor_model_8c44d8b41ee50248, []int{1} } func (m *MatchString) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MatchString.Unmarshal(m, b) @@ -205,7 +205,7 @@ func (m *StringList) Reset() { *m = StringList{} } func (m *StringList) String() string { return proto.CompactTextString(m) } func (*StringList) ProtoMessage() {} func (*StringList) Descriptor() ([]byte, []int) { - return fileDescriptor_model_89bde6c9fe109cf9, []int{2} + return fileDescriptor_model_8c44d8b41ee50248, []int{2} } func (m *StringList) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_StringList.Unmarshal(m, b) @@ -249,7 +249,7 @@ func (m *Summary) Reset() { *m = Summary{} } func (m *Summary) String() string { return proto.CompactTextString(m) } func (*Summary) ProtoMessage() {} func (*Summary) Descriptor() ([]byte, []int) { - return fileDescriptor_model_89bde6c9fe109cf9, []int{3} + return fileDescriptor_model_8c44d8b41ee50248, []int{3} } func (m *Summary) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Summary.Unmarshal(m, b) @@ -302,7 +302,7 @@ func (m *ClientLabel) Reset() { *m = ClientLabel{} } func (m *ClientLabel) String() string { return proto.CompactTextString(m) } func (*ClientLabel) ProtoMessage() {} func (*ClientLabel) Descriptor() ([]byte, []int) { - return fileDescriptor_model_89bde6c9fe109cf9, []int{4} + return fileDescriptor_model_8c44d8b41ee50248, []int{4} } func (m *ClientLabel) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ClientLabel.Unmarshal(m, b) @@ -336,51 +336,113 @@ func (m *ClientLabel) GetValue() *MatchString { return nil } +// API统一数据结构 +type API struct { + // API的协议,*或者为空代表全部 + Protocol string `protobuf:"bytes,1,opt,name=protocol,proto3" json:"protocol,omitempty"` + // API的方法,*或者为空代表全部 + Method string `protobuf:"bytes,2,opt,name=method,proto3" json:"method,omitempty"` + // API的路径,支持多种匹配方式 + Path *MatchString `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *API) Reset() { *m = API{} } +func (m *API) String() string { return proto.CompactTextString(m) } +func (*API) ProtoMessage() {} +func (*API) Descriptor() ([]byte, []int) { + return fileDescriptor_model_8c44d8b41ee50248, []int{5} +} +func (m *API) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_API.Unmarshal(m, b) +} +func (m *API) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_API.Marshal(b, m, deterministic) +} +func (dst *API) XXX_Merge(src proto.Message) { + xxx_messageInfo_API.Merge(dst, src) +} +func (m *API) XXX_Size() int { + return xxx_messageInfo_API.Size(m) +} +func (m *API) XXX_DiscardUnknown() { + xxx_messageInfo_API.DiscardUnknown(m) +} + +var xxx_messageInfo_API proto.InternalMessageInfo + +func (m *API) GetProtocol() string { + if m != nil { + return m.Protocol + } + return "" +} + +func (m *API) GetMethod() string { + if m != nil { + return m.Method + } + return "" +} + +func (m *API) GetPath() *MatchString { + if m != nil { + return m.Path + } + return nil +} + func init() { proto.RegisterType((*Location)(nil), "v1.Location") proto.RegisterType((*MatchString)(nil), "v1.MatchString") proto.RegisterType((*StringList)(nil), "v1.StringList") proto.RegisterType((*Summary)(nil), "v1.Summary") proto.RegisterType((*ClientLabel)(nil), "v1.ClientLabel") + proto.RegisterType((*API)(nil), "v1.API") proto.RegisterEnum("v1.MatchString_MatchStringType", MatchString_MatchStringType_name, MatchString_MatchStringType_value) proto.RegisterEnum("v1.MatchString_ValueType", MatchString_ValueType_name, MatchString_ValueType_value) } -func init() { proto.RegisterFile("model.proto", fileDescriptor_model_89bde6c9fe109cf9) } - -var fileDescriptor_model_89bde6c9fe109cf9 = []byte{ - // 526 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0x5f, 0x8f, 0xd2, 0x4c, - 0x14, 0xc6, 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- 0x49, 0xd5, 0x6a, 0xc1, 0x72, 0xa9, 0x48, 0x7e, 0x4b, 0xda, 0x86, 0xfc, 0x97, 0x04, 0xf5, 0xe0, - 0x51, 0xd5, 0xde, 0x43, 0x1d, 0x83, 0xde, 0xdb, 0xf3, 0x3e, 0x40, 0xfb, 0x32, 0x65, 0x34, 0x57, - 0x43, 0xb2, 0xa4, 0x29, 0x72, 0xc1, 0xf9, 0x46, 0x37, 0x26, 0x66, 0x2b, 0xd2, 0x25, 0x7a, 0x7d, - 0x77, 0xeb, 0x27, 0x7b, 0xcb, 0xdb, 0x2e, 0xba, 0xbf, 0x01, 0x1c, 0xf3, 0x0c, 0x2b, 0x9a, 0xc7, - 0x34, 0x57, 0x58, 0xf0, 0x94, 0x14, 0x4c, 0x62, 0x29, 0x68, 0xcc, 0x6e, 0x58, 0xf5, 0x48, 0x30, - 0x11, 0x4c, 0xe3, 0xe6, 0xa1, 0xf5, 0x61, 0xa4, 0x7f, 0xae, 0xf5, 0xe5, 0xf9, 0xf2, 0x2e, 0x61, - 0x6a, 0x55, 0x2e, 0xf5, 0x08, 0x7f, 0x8b, 0x66, 0x54, 0xae, 0xfc, 0x3b, 0xb8, 0x2f, 0x79, 0x59, - 0xc4, 0xd4, 0x4f, 0xb8, 0x4f, 0x04, 0xf3, 0xd7, 0x5d, 0xdf, 0x0c, 0x5a, 0x36, 0xcc, 0x05, 0xbc, - 0xf8, 0x13, 0x00, 0x00, 0xff, 0xff, 0x33, 0xbc, 0xe4, 0x5b, 0xc1, 0x03, 0x00, 0x00, +func init() { proto.RegisterFile("model.proto", fileDescriptor_model_8c44d8b41ee50248) } + +var fileDescriptor_model_8c44d8b41ee50248 = []byte{ + // 562 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x4f, 0x6f, 0xd3, 0x30, + 0x14, 0x27, 0x49, 0x57, 0x9a, 0x57, 0xb6, 0x45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xea, 0x8a, 0xf9, 0x3f, 0x08, 0xea, 0xc2, 0xa3, 0xaa, 0xbd, 0x45, + 0x35, 0x14, 0xf5, 0xce, 0x9e, 0xfd, 0x01, 0xda, 0x97, 0x09, 0x25, 0x99, 0xe8, 0xe3, 0x05, 0x49, + 0x90, 0x05, 0xc6, 0x37, 0xb2, 0x52, 0x31, 0xcd, 0x40, 0x96, 0xe8, 0xf5, 0xed, 0xa9, 0x1f, 0x6e, + 0x0d, 0xaf, 0x1e, 0xb4, 0xfd, 0x15, 0x0c, 0x6f, 0xd4, 0x43, 0x47, 0xd0, 0x52, 0xd7, 0x21, 0x64, + 0x49, 0x2d, 0xb2, 0x5e, 0xcb, 0x63, 0x4b, 0x89, 0x88, 0xd9, 0xb5, 0x92, 0x32, 0x83, 0x7a, 0x85, + 0x5e, 0x42, 0x83, 0x63, 0x11, 0xd7, 0x17, 0xfa, 0x1f, 0x03, 0xd5, 0xbc, 0x58, 0x81, 0x13, 0xb2, + 0xd4, 0x11, 0x24, 0x0b, 0x49, 0x26, 0x1c, 0xce, 0x12, 0x9c, 0xd3, 0xc2, 0x29, 0x38, 0x09, 0xe9, + 0x0d, 0xad, 0x1e, 0xa1, 0x83, 0x39, 0x95, 0x6c, 0xf5, 0x90, 0x2f, 0x60, 0x20, 0x3f, 0x23, 0xe9, + 0xfe, 0xe5, 0x5d, 0x44, 0x45, 0x5c, 0x2e, 0xa4, 0x84, 0x5b, 0x53, 0x53, 0x52, 0xc4, 0xee, 0x2d, + 0xba, 0x5b, 0xb0, 0x32, 0x0f, 0x89, 0x1b, 0x31, 0x17, 0x73, 0xea, 0x2e, 0xcf, 0x5c, 0x25, 0xb4, + 0x68, 0xaa, 0x3f, 0x38, 0xff, 0x13, 0x00, 0x00, 0xff, 0xff, 0x26, 0x13, 0x9f, 0xfc, 0x21, 0x04, + 0x00, 0x00, } diff --git a/source/go/api/v1/security/auth.pb.go b/source/go/api/v1/security/auth.pb.go index bbd913c5..95240b75 100644 --- a/source/go/api/v1/security/auth.pb.go +++ b/source/go/api/v1/security/auth.pb.go @@ -22,56 +22,92 @@ const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type AuthAction int32 const ( - AuthAction_ONLY_READ AuthAction = 0 + // deprecated_filed 该字段从未使用过 + AuthAction_ONLY_READ AuthAction = 0 + // deprecated_filed 使用 ALLOW 进行替代 AuthAction_READ_WRITE AuthAction = 1 + AuthAction_ALLOW AuthAction = 10 + AuthAction_DENY AuthAction = 11 ) var AuthAction_name = map[int32]string{ - 0: "ONLY_READ", - 1: "READ_WRITE", + 0: "ONLY_READ", + 1: "READ_WRITE", + 10: "ALLOW", + 11: "DENY", } var AuthAction_value = map[string]int32{ "ONLY_READ": 0, "READ_WRITE": 1, + "ALLOW": 10, + "DENY": 11, } func (x AuthAction) String() string { return proto.EnumName(AuthAction_name, int32(x)) } func (AuthAction) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_auth_7c04a6f84b604dce, []int{0} + return fileDescriptor_auth_2543522910fa735a, []int{0} } type ResourceType int32 const ( - ResourceType_Namespaces ResourceType = 0 - ResourceType_Services ResourceType = 1 - ResourceType_ConfigGroups ResourceType = 2 + ResourceType_Namespaces ResourceType = 0 + ResourceType_Services ResourceType = 1 + ResourceType_ConfigGroups ResourceType = 2 + ResourceType_RouteRules ResourceType = 3 + ResourceType_RateLimitRules ResourceType = 4 + ResourceType_CircuitBreakerRules ResourceType = 5 + ResourceType_FaultDetectRules ResourceType = 6 + ResourceType_LaneRules ResourceType = 7 + ResourceType_Users ResourceType = 20 + ResourceType_UserGroups ResourceType = 21 + ResourceType_Roles ResourceType = 22 + ResourceType_PolicyRules ResourceType = 23 ) var ResourceType_name = map[int32]string{ - 0: "Namespaces", - 1: "Services", - 2: "ConfigGroups", + 0: "Namespaces", + 1: "Services", + 2: "ConfigGroups", + 3: "RouteRules", + 4: "RateLimitRules", + 5: "CircuitBreakerRules", + 6: "FaultDetectRules", + 7: "LaneRules", + 20: "Users", + 21: "UserGroups", + 22: "Roles", + 23: "PolicyRules", } var ResourceType_value = map[string]int32{ - "Namespaces": 0, - "Services": 1, - "ConfigGroups": 2, + "Namespaces": 0, + "Services": 1, + "ConfigGroups": 2, + "RouteRules": 3, + "RateLimitRules": 4, + "CircuitBreakerRules": 5, + "FaultDetectRules": 6, + "LaneRules": 7, + "Users": 20, + "UserGroups": 21, + "Roles": 22, + "PolicyRules": 23, } func (x ResourceType) String() string { return proto.EnumName(ResourceType_name, int32(x)) } func (ResourceType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_auth_7c04a6f84b604dce, []int{1} + return fileDescriptor_auth_2543522910fa735a, []int{1} } type LoginRequest struct { Owner *wrapperspb.StringValue `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` Name *wrapperspb.StringValue `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Password *wrapperspb.StringValue `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"` + Options map[string]string `protobuf:"bytes,4,rep,name=options,proto3" json:"options,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -81,7 +117,7 @@ func (m *LoginRequest) Reset() { *m = LoginRequest{} } func (m *LoginRequest) String() string { return proto.CompactTextString(m) } func (*LoginRequest) ProtoMessage() {} func (*LoginRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_auth_7c04a6f84b604dce, []int{0} + return fileDescriptor_auth_2543522910fa735a, []int{0} } func (m *LoginRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_LoginRequest.Unmarshal(m, b) @@ -122,12 +158,20 @@ func (m *LoginRequest) GetPassword() *wrapperspb.StringValue { return nil } +func (m *LoginRequest) GetOptions() map[string]string { + if m != nil { + return m.Options + } + return nil +} + type LoginResponse struct { UserId *wrapperspb.StringValue `protobuf:"bytes,1,opt,name=user_id,proto3" json:"user_id,omitempty"` Name *wrapperspb.StringValue `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Role *wrapperspb.StringValue `protobuf:"bytes,3,opt,name=role,proto3" json:"role,omitempty"` OwnerId *wrapperspb.StringValue `protobuf:"bytes,4,opt,name=owner_id,proto3" json:"owner_id,omitempty"` Token *wrapperspb.StringValue `protobuf:"bytes,5,opt,name=token,proto3" json:"token,omitempty"` + Options map[string]string `protobuf:"bytes,6,rep,name=options,proto3" json:"options,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -137,7 +181,7 @@ func (m *LoginResponse) Reset() { *m = LoginResponse{} } func (m *LoginResponse) String() string { return proto.CompactTextString(m) } func (*LoginResponse) ProtoMessage() {} func (*LoginResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_auth_7c04a6f84b604dce, []int{1} + return fileDescriptor_auth_2543522910fa735a, []int{1} } func (m *LoginResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_LoginResponse.Unmarshal(m, b) @@ -192,6 +236,13 @@ func (m *LoginResponse) GetToken() *wrapperspb.StringValue { return nil } +func (m *LoginResponse) GetOptions() map[string]string { + if m != nil { + return m.Options + } + return nil +} + type User struct { Id *wrapperspb.StringValue `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Name *wrapperspb.StringValue `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` @@ -206,6 +257,7 @@ type User struct { UserType *wrapperspb.StringValue `protobuf:"bytes,11,opt,name=user_type,proto3" json:"user_type,omitempty"` Mobile *wrapperspb.StringValue `protobuf:"bytes,12,opt,name=mobile,proto3" json:"mobile,omitempty"` Email *wrapperspb.StringValue `protobuf:"bytes,13,opt,name=email,proto3" json:"email,omitempty"` + Metadata map[string]string `protobuf:"bytes,14,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -215,7 +267,7 @@ func (m *User) Reset() { *m = User{} } func (m *User) String() string { return proto.CompactTextString(m) } func (*User) ProtoMessage() {} func (*User) Descriptor() ([]byte, []int) { - return fileDescriptor_auth_7c04a6f84b604dce, []int{2} + return fileDescriptor_auth_2543522910fa735a, []int{2} } func (m *User) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_User.Unmarshal(m, b) @@ -326,6 +378,13 @@ func (m *User) GetEmail() *wrapperspb.StringValue { return nil } +func (m *User) GetMetadata() map[string]string { + if m != nil { + return m.Metadata + } + return nil +} + type ModifyUserPassword struct { Id *wrapperspb.StringValue `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` OldPassword *wrapperspb.StringValue `protobuf:"bytes,2,opt,name=old_password,proto3" json:"old_password,omitempty"` @@ -339,7 +398,7 @@ func (m *ModifyUserPassword) Reset() { *m = ModifyUserPassword{} } func (m *ModifyUserPassword) String() string { return proto.CompactTextString(m) } func (*ModifyUserPassword) ProtoMessage() {} func (*ModifyUserPassword) Descriptor() ([]byte, []int) { - return fileDescriptor_auth_7c04a6f84b604dce, []int{3} + return fileDescriptor_auth_2543522910fa735a, []int{3} } func (m *ModifyUserPassword) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ModifyUserPassword.Unmarshal(m, b) @@ -392,7 +451,7 @@ func (m *UserGroupRelation) Reset() { *m = UserGroupRelation{} } func (m *UserGroupRelation) String() string { return proto.CompactTextString(m) } func (*UserGroupRelation) ProtoMessage() {} func (*UserGroupRelation) Descriptor() ([]byte, []int) { - return fileDescriptor_auth_7c04a6f84b604dce, []int{4} + return fileDescriptor_auth_2543522910fa735a, []int{4} } func (m *UserGroupRelation) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserGroupRelation.Unmarshal(m, b) @@ -437,6 +496,8 @@ type UserGroup struct { Mtime *wrapperspb.StringValue `protobuf:"bytes,8,opt,name=mtime,proto3" json:"mtime,omitempty"` Relation *UserGroupRelation `protobuf:"bytes,9,opt,name=relation,proto3" json:"relation,omitempty"` UserCount *wrapperspb.UInt32Value `protobuf:"bytes,10,opt,name=user_count,proto3" json:"user_count,omitempty"` + Source *wrapperspb.StringValue `protobuf:"bytes,11,opt,name=source,proto3" json:"source,omitempty"` + Metadata map[string]string `protobuf:"bytes,12,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -446,7 +507,7 @@ func (m *UserGroup) Reset() { *m = UserGroup{} } func (m *UserGroup) String() string { return proto.CompactTextString(m) } func (*UserGroup) ProtoMessage() {} func (*UserGroup) Descriptor() ([]byte, []int) { - return fileDescriptor_auth_7c04a6f84b604dce, []int{5} + return fileDescriptor_auth_2543522910fa735a, []int{5} } func (m *UserGroup) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UserGroup.Unmarshal(m, b) @@ -536,6 +597,20 @@ func (m *UserGroup) GetUserCount() *wrapperspb.UInt32Value { return nil } +func (m *UserGroup) GetSource() *wrapperspb.StringValue { + if m != nil { + return m.Source + } + return nil +} + +func (m *UserGroup) GetMetadata() map[string]string { + if m != nil { + return m.Metadata + } + return nil +} + type ModifyUserGroup struct { Id *wrapperspb.StringValue `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Owner *wrapperspb.StringValue `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"` @@ -545,6 +620,8 @@ type ModifyUserGroup struct { Comment *wrapperspb.StringValue `protobuf:"bytes,6,opt,name=comment,proto3" json:"comment,omitempty"` AddRelations *UserGroupRelation `protobuf:"bytes,7,opt,name=add_relations,proto3" json:"add_relations,omitempty"` RemoveRelations *UserGroupRelation `protobuf:"bytes,8,opt,name=remove_relations,proto3" json:"remove_relations,omitempty"` + Metadata map[string]string `protobuf:"bytes,9,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Source *wrapperspb.StringValue `protobuf:"bytes,10,opt,name=source,proto3" json:"source,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -554,7 +631,7 @@ func (m *ModifyUserGroup) Reset() { *m = ModifyUserGroup{} } func (m *ModifyUserGroup) String() string { return proto.CompactTextString(m) } func (*ModifyUserGroup) ProtoMessage() {} func (*ModifyUserGroup) Descriptor() ([]byte, []int) { - return fileDescriptor_auth_7c04a6f84b604dce, []int{6} + return fileDescriptor_auth_2543522910fa735a, []int{6} } func (m *ModifyUserGroup) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ModifyUserGroup.Unmarshal(m, b) @@ -630,6 +707,138 @@ func (m *ModifyUserGroup) GetRemoveRelations() *UserGroupRelation { return nil } +func (m *ModifyUserGroup) GetMetadata() map[string]string { + if m != nil { + return m.Metadata + } + return nil +} + +func (m *ModifyUserGroup) GetSource() *wrapperspb.StringValue { + if m != nil { + return m.Source + } + return nil +} + +type Role struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Owner string `protobuf:"bytes,4,opt,name=owner,proto3" json:"owner,omitempty"` + Source string `protobuf:"bytes,5,opt,name=source,proto3" json:"source,omitempty"` + DefaultRole bool `protobuf:"varint,6,opt,name=default_role,proto3" json:"default_role,omitempty"` + Metadata map[string]string `protobuf:"bytes,7,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Comment string `protobuf:"bytes,8,opt,name=comment,proto3" json:"comment,omitempty"` + Ctime string `protobuf:"bytes,9,opt,name=ctime,proto3" json:"ctime,omitempty"` + Mtime string `protobuf:"bytes,10,opt,name=mtime,proto3" json:"mtime,omitempty"` + Users []*User `protobuf:"bytes,20,rep,name=users,proto3" json:"users,omitempty"` + UserGroups []*UserGroup `protobuf:"bytes,21,rep,name=user_groups,proto3" json:"user_groups,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Role) Reset() { *m = Role{} } +func (m *Role) String() string { return proto.CompactTextString(m) } +func (*Role) ProtoMessage() {} +func (*Role) Descriptor() ([]byte, []int) { + return fileDescriptor_auth_2543522910fa735a, []int{7} +} +func (m *Role) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Role.Unmarshal(m, b) +} +func (m *Role) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Role.Marshal(b, m, deterministic) +} +func (dst *Role) XXX_Merge(src proto.Message) { + xxx_messageInfo_Role.Merge(dst, src) +} +func (m *Role) XXX_Size() int { + return xxx_messageInfo_Role.Size(m) +} +func (m *Role) XXX_DiscardUnknown() { + xxx_messageInfo_Role.DiscardUnknown(m) +} + +var xxx_messageInfo_Role proto.InternalMessageInfo + +func (m *Role) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *Role) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Role) GetOwner() string { + if m != nil { + return m.Owner + } + return "" +} + +func (m *Role) GetSource() string { + if m != nil { + return m.Source + } + return "" +} + +func (m *Role) GetDefaultRole() bool { + if m != nil { + return m.DefaultRole + } + return false +} + +func (m *Role) GetMetadata() map[string]string { + if m != nil { + return m.Metadata + } + return nil +} + +func (m *Role) GetComment() string { + if m != nil { + return m.Comment + } + return "" +} + +func (m *Role) GetCtime() string { + if m != nil { + return m.Ctime + } + return "" +} + +func (m *Role) GetMtime() string { + if m != nil { + return m.Mtime + } + return "" +} + +func (m *Role) GetUsers() []*User { + if m != nil { + return m.Users + } + return nil +} + +func (m *Role) GetUserGroups() []*UserGroup { + if m != nil { + return m.UserGroups + } + return nil +} + type Principal struct { Id *wrapperspb.StringValue `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Name *wrapperspb.StringValue `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` @@ -642,7 +851,7 @@ func (m *Principal) Reset() { *m = Principal{} } func (m *Principal) String() string { return proto.CompactTextString(m) } func (*Principal) ProtoMessage() {} func (*Principal) Descriptor() ([]byte, []int) { - return fileDescriptor_auth_7c04a6f84b604dce, []int{7} + return fileDescriptor_auth_2543522910fa735a, []int{8} } func (m *Principal) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Principal.Unmarshal(m, b) @@ -679,6 +888,7 @@ func (m *Principal) GetName() *wrapperspb.StringValue { type Principals struct { Users []*Principal `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"` Groups []*Principal `protobuf:"bytes,2,rep,name=groups,proto3" json:"groups,omitempty"` + Roles []*Principal `protobuf:"bytes,3,rep,name=roles,proto3" json:"roles,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -688,7 +898,7 @@ func (m *Principals) Reset() { *m = Principals{} } func (m *Principals) String() string { return proto.CompactTextString(m) } func (*Principals) ProtoMessage() {} func (*Principals) Descriptor() ([]byte, []int) { - return fileDescriptor_auth_7c04a6f84b604dce, []int{8} + return fileDescriptor_auth_2543522910fa735a, []int{9} } func (m *Principals) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Principals.Unmarshal(m, b) @@ -722,6 +932,13 @@ func (m *Principals) GetGroups() []*Principal { return nil } +func (m *Principals) GetRoles() []*Principal { + if m != nil { + return m.Roles + } + return nil +} + type StrategyResourceEntry struct { Id *wrapperspb.StringValue `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Namespace *wrapperspb.StringValue `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` @@ -735,7 +952,7 @@ func (m *StrategyResourceEntry) Reset() { *m = StrategyResourceEntry{} } func (m *StrategyResourceEntry) String() string { return proto.CompactTextString(m) } func (*StrategyResourceEntry) ProtoMessage() {} func (*StrategyResourceEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_auth_7c04a6f84b604dce, []int{9} + return fileDescriptor_auth_2543522910fa735a, []int{10} } func (m *StrategyResourceEntry) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_StrategyResourceEntry.Unmarshal(m, b) @@ -781,6 +998,15 @@ type StrategyResources struct { Namespaces []*StrategyResourceEntry `protobuf:"bytes,2,rep,name=namespaces,proto3" json:"namespaces,omitempty"` Services []*StrategyResourceEntry `protobuf:"bytes,3,rep,name=services,proto3" json:"services,omitempty"` ConfigGroups []*StrategyResourceEntry `protobuf:"bytes,4,rep,name=config_groups,proto3" json:"config_groups,omitempty"` + RouteRules []*StrategyResourceEntry `protobuf:"bytes,5,rep,name=route_rules,proto3" json:"route_rules,omitempty"` + RatelimitRules []*StrategyResourceEntry `protobuf:"bytes,6,rep,name=ratelimit_rules,proto3" json:"ratelimit_rules,omitempty"` + CircuitbreakerRules []*StrategyResourceEntry `protobuf:"bytes,7,rep,name=circuitbreaker_rules,proto3" json:"circuitbreaker_rules,omitempty"` + FaultdetectRules []*StrategyResourceEntry `protobuf:"bytes,8,rep,name=faultdetect_rules,proto3" json:"faultdetect_rules,omitempty"` + LaneRules []*StrategyResourceEntry `protobuf:"bytes,9,rep,name=lane_rules,proto3" json:"lane_rules,omitempty"` + Users []*StrategyResourceEntry `protobuf:"bytes,21,rep,name=users,proto3" json:"users,omitempty"` + UserGroups []*StrategyResourceEntry `protobuf:"bytes,22,rep,name=user_groups,proto3" json:"user_groups,omitempty"` + Roles []*StrategyResourceEntry `protobuf:"bytes,23,rep,name=roles,proto3" json:"roles,omitempty"` + AuthPolicies []*StrategyResourceEntry `protobuf:"bytes,24,rep,name=auth_policies,proto3" json:"auth_policies,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -790,7 +1016,7 @@ func (m *StrategyResources) Reset() { *m = StrategyResources{} } func (m *StrategyResources) String() string { return proto.CompactTextString(m) } func (*StrategyResources) ProtoMessage() {} func (*StrategyResources) Descriptor() ([]byte, []int) { - return fileDescriptor_auth_7c04a6f84b604dce, []int{10} + return fileDescriptor_auth_2543522910fa735a, []int{11} } func (m *StrategyResources) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_StrategyResources.Unmarshal(m, b) @@ -838,28 +1064,149 @@ func (m *StrategyResources) GetConfigGroups() []*StrategyResourceEntry { return nil } +func (m *StrategyResources) GetRouteRules() []*StrategyResourceEntry { + if m != nil { + return m.RouteRules + } + return nil +} + +func (m *StrategyResources) GetRatelimitRules() []*StrategyResourceEntry { + if m != nil { + return m.RatelimitRules + } + return nil +} + +func (m *StrategyResources) GetCircuitbreakerRules() []*StrategyResourceEntry { + if m != nil { + return m.CircuitbreakerRules + } + return nil +} + +func (m *StrategyResources) GetFaultdetectRules() []*StrategyResourceEntry { + if m != nil { + return m.FaultdetectRules + } + return nil +} + +func (m *StrategyResources) GetLaneRules() []*StrategyResourceEntry { + if m != nil { + return m.LaneRules + } + return nil +} + +func (m *StrategyResources) GetUsers() []*StrategyResourceEntry { + if m != nil { + return m.Users + } + return nil +} + +func (m *StrategyResources) GetUserGroups() []*StrategyResourceEntry { + if m != nil { + return m.UserGroups + } + return nil +} + +func (m *StrategyResources) GetRoles() []*StrategyResourceEntry { + if m != nil { + return m.Roles + } + return nil +} + +func (m *StrategyResources) GetAuthPolicies() []*StrategyResourceEntry { + if m != nil { + return m.AuthPolicies + } + return nil +} + +type StrategyResourceLabel struct { + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + CompareType string `protobuf:"bytes,3,opt,name=compare_type,proto3" json:"compare_type,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *StrategyResourceLabel) Reset() { *m = StrategyResourceLabel{} } +func (m *StrategyResourceLabel) String() string { return proto.CompactTextString(m) } +func (*StrategyResourceLabel) ProtoMessage() {} +func (*StrategyResourceLabel) Descriptor() ([]byte, []int) { + return fileDescriptor_auth_2543522910fa735a, []int{12} +} +func (m *StrategyResourceLabel) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_StrategyResourceLabel.Unmarshal(m, b) +} +func (m *StrategyResourceLabel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_StrategyResourceLabel.Marshal(b, m, deterministic) +} +func (dst *StrategyResourceLabel) XXX_Merge(src proto.Message) { + xxx_messageInfo_StrategyResourceLabel.Merge(dst, src) +} +func (m *StrategyResourceLabel) XXX_Size() int { + return xxx_messageInfo_StrategyResourceLabel.Size(m) +} +func (m *StrategyResourceLabel) XXX_DiscardUnknown() { + xxx_messageInfo_StrategyResourceLabel.DiscardUnknown(m) +} + +var xxx_messageInfo_StrategyResourceLabel proto.InternalMessageInfo + +func (m *StrategyResourceLabel) GetKey() string { + if m != nil { + return m.Key + } + return "" +} + +func (m *StrategyResourceLabel) GetValue() string { + if m != nil { + return m.Value + } + return "" +} + +func (m *StrategyResourceLabel) GetCompareType() string { + if m != nil { + return m.CompareType + } + return "" +} + type AuthStrategy struct { - Id *wrapperspb.StringValue `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Name *wrapperspb.StringValue `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Principals *Principals `protobuf:"bytes,3,opt,name=principals,proto3" json:"principals,omitempty"` - Resources *StrategyResources `protobuf:"bytes,4,opt,name=resources,proto3" json:"resources,omitempty"` - Action AuthAction `protobuf:"varint,5,opt,name=action,proto3,enum=v1.AuthAction" json:"action,omitempty"` - Comment *wrapperspb.StringValue `protobuf:"bytes,6,opt,name=comment,proto3" json:"comment,omitempty"` - Owner *wrapperspb.StringValue `protobuf:"bytes,7,opt,name=owner,proto3" json:"owner,omitempty"` - Ctime *wrapperspb.StringValue `protobuf:"bytes,8,opt,name=ctime,proto3" json:"ctime,omitempty"` - Mtime *wrapperspb.StringValue `protobuf:"bytes,9,opt,name=mtime,proto3" json:"mtime,omitempty"` - AuthToken *wrapperspb.StringValue `protobuf:"bytes,10,opt,name=auth_token,proto3" json:"auth_token,omitempty"` - DefaultStrategy *wrapperspb.BoolValue `protobuf:"bytes,11,opt,name=default_strategy,proto3" json:"default_strategy,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Id *wrapperspb.StringValue `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name *wrapperspb.StringValue `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Principals *Principals `protobuf:"bytes,3,opt,name=principals,proto3" json:"principals,omitempty"` + Resources *StrategyResources `protobuf:"bytes,4,opt,name=resources,proto3" json:"resources,omitempty"` + Action AuthAction `protobuf:"varint,5,opt,name=action,proto3,enum=v1.AuthAction" json:"action,omitempty"` + Comment *wrapperspb.StringValue `protobuf:"bytes,6,opt,name=comment,proto3" json:"comment,omitempty"` + Owner *wrapperspb.StringValue `protobuf:"bytes,7,opt,name=owner,proto3" json:"owner,omitempty"` + Ctime *wrapperspb.StringValue `protobuf:"bytes,8,opt,name=ctime,proto3" json:"ctime,omitempty"` + Mtime *wrapperspb.StringValue `protobuf:"bytes,9,opt,name=mtime,proto3" json:"mtime,omitempty"` + AuthToken *wrapperspb.StringValue `protobuf:"bytes,10,opt,name=auth_token,proto3" json:"auth_token,omitempty"` + DefaultStrategy *wrapperspb.BoolValue `protobuf:"bytes,11,opt,name=default_strategy,proto3" json:"default_strategy,omitempty"` + Metadata map[string]string `protobuf:"bytes,12,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Source *wrapperspb.StringValue `protobuf:"bytes,13,opt,name=source,proto3" json:"source,omitempty"` + Functions []string `protobuf:"bytes,14,rep,name=functions,proto3" json:"functions,omitempty"` + ResourceLabels []*StrategyResourceLabel `protobuf:"bytes,15,rep,name=resource_labels,proto3" json:"resource_labels,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *AuthStrategy) Reset() { *m = AuthStrategy{} } func (m *AuthStrategy) String() string { return proto.CompactTextString(m) } func (*AuthStrategy) ProtoMessage() {} func (*AuthStrategy) Descriptor() ([]byte, []int) { - return fileDescriptor_auth_7c04a6f84b604dce, []int{11} + return fileDescriptor_auth_2543522910fa735a, []int{13} } func (m *AuthStrategy) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AuthStrategy.Unmarshal(m, b) @@ -956,26 +1303,58 @@ func (m *AuthStrategy) GetDefaultStrategy() *wrapperspb.BoolValue { return nil } +func (m *AuthStrategy) GetMetadata() map[string]string { + if m != nil { + return m.Metadata + } + return nil +} + +func (m *AuthStrategy) GetSource() *wrapperspb.StringValue { + if m != nil { + return m.Source + } + return nil +} + +func (m *AuthStrategy) GetFunctions() []string { + if m != nil { + return m.Functions + } + return nil +} + +func (m *AuthStrategy) GetResourceLabels() []*StrategyResourceLabel { + if m != nil { + return m.ResourceLabels + } + return nil +} + type ModifyAuthStrategy struct { - Id *wrapperspb.StringValue `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Name *wrapperspb.StringValue `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - AddPrincipals *Principals `protobuf:"bytes,3,opt,name=add_principals,proto3" json:"add_principals,omitempty"` - RemovePrincipals *Principals `protobuf:"bytes,4,opt,name=remove_principals,proto3" json:"remove_principals,omitempty"` - AddResources *StrategyResources `protobuf:"bytes,5,opt,name=add_resources,proto3" json:"add_resources,omitempty"` - RemoveResources *StrategyResources `protobuf:"bytes,6,opt,name=remove_resources,proto3" json:"remove_resources,omitempty"` - Action AuthAction `protobuf:"varint,7,opt,name=action,proto3,enum=v1.AuthAction" json:"action,omitempty"` - Comment *wrapperspb.StringValue `protobuf:"bytes,8,opt,name=comment,proto3" json:"comment,omitempty"` - Owner *wrapperspb.StringValue `protobuf:"bytes,9,opt,name=owner,proto3" json:"owner,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Id *wrapperspb.StringValue `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name *wrapperspb.StringValue `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + AddPrincipals *Principals `protobuf:"bytes,3,opt,name=add_principals,proto3" json:"add_principals,omitempty"` + RemovePrincipals *Principals `protobuf:"bytes,4,opt,name=remove_principals,proto3" json:"remove_principals,omitempty"` + AddResources *StrategyResources `protobuf:"bytes,5,opt,name=add_resources,proto3" json:"add_resources,omitempty"` + RemoveResources *StrategyResources `protobuf:"bytes,6,opt,name=remove_resources,proto3" json:"remove_resources,omitempty"` + Action AuthAction `protobuf:"varint,7,opt,name=action,proto3,enum=v1.AuthAction" json:"action,omitempty"` + Comment *wrapperspb.StringValue `protobuf:"bytes,8,opt,name=comment,proto3" json:"comment,omitempty"` + Owner *wrapperspb.StringValue `protobuf:"bytes,9,opt,name=owner,proto3" json:"owner,omitempty"` + Metadata map[string]string `protobuf:"bytes,12,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Source *wrapperspb.StringValue `protobuf:"bytes,13,opt,name=source,proto3" json:"source,omitempty"` + Functions []string `protobuf:"bytes,14,rep,name=functions,proto3" json:"functions,omitempty"` + ResourceLabels []*StrategyResourceLabel `protobuf:"bytes,15,rep,name=resource_labels,proto3" json:"resource_labels,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *ModifyAuthStrategy) Reset() { *m = ModifyAuthStrategy{} } func (m *ModifyAuthStrategy) String() string { return proto.CompactTextString(m) } func (*ModifyAuthStrategy) ProtoMessage() {} func (*ModifyAuthStrategy) Descriptor() ([]byte, []int) { - return fileDescriptor_auth_7c04a6f84b604dce, []int{12} + return fileDescriptor_auth_2543522910fa735a, []int{14} } func (m *ModifyAuthStrategy) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ModifyAuthStrategy.Unmarshal(m, b) @@ -1058,93 +1437,167 @@ func (m *ModifyAuthStrategy) GetOwner() *wrapperspb.StringValue { return nil } +func (m *ModifyAuthStrategy) GetMetadata() map[string]string { + if m != nil { + return m.Metadata + } + return nil +} + +func (m *ModifyAuthStrategy) GetSource() *wrapperspb.StringValue { + if m != nil { + return m.Source + } + return nil +} + +func (m *ModifyAuthStrategy) GetFunctions() []string { + if m != nil { + return m.Functions + } + return nil +} + +func (m *ModifyAuthStrategy) GetResourceLabels() []*StrategyResourceLabel { + if m != nil { + return m.ResourceLabels + } + return nil +} + func init() { proto.RegisterType((*LoginRequest)(nil), "v1.LoginRequest") + proto.RegisterMapType((map[string]string)(nil), "v1.LoginRequest.OptionsEntry") proto.RegisterType((*LoginResponse)(nil), "v1.LoginResponse") + proto.RegisterMapType((map[string]string)(nil), "v1.LoginResponse.OptionsEntry") proto.RegisterType((*User)(nil), "v1.User") + proto.RegisterMapType((map[string]string)(nil), "v1.User.MetadataEntry") proto.RegisterType((*ModifyUserPassword)(nil), "v1.ModifyUserPassword") proto.RegisterType((*UserGroupRelation)(nil), "v1.UserGroupRelation") proto.RegisterType((*UserGroup)(nil), "v1.UserGroup") + proto.RegisterMapType((map[string]string)(nil), "v1.UserGroup.MetadataEntry") proto.RegisterType((*ModifyUserGroup)(nil), "v1.ModifyUserGroup") + proto.RegisterMapType((map[string]string)(nil), "v1.ModifyUserGroup.MetadataEntry") + proto.RegisterType((*Role)(nil), "v1.Role") + proto.RegisterMapType((map[string]string)(nil), "v1.Role.MetadataEntry") proto.RegisterType((*Principal)(nil), "v1.Principal") proto.RegisterType((*Principals)(nil), "v1.Principals") proto.RegisterType((*StrategyResourceEntry)(nil), "v1.StrategyResourceEntry") proto.RegisterType((*StrategyResources)(nil), "v1.StrategyResources") + proto.RegisterType((*StrategyResourceLabel)(nil), "v1.StrategyResourceLabel") proto.RegisterType((*AuthStrategy)(nil), "v1.AuthStrategy") + proto.RegisterMapType((map[string]string)(nil), "v1.AuthStrategy.MetadataEntry") proto.RegisterType((*ModifyAuthStrategy)(nil), "v1.ModifyAuthStrategy") + proto.RegisterMapType((map[string]string)(nil), "v1.ModifyAuthStrategy.MetadataEntry") proto.RegisterEnum("v1.AuthAction", AuthAction_name, AuthAction_value) proto.RegisterEnum("v1.ResourceType", ResourceType_name, ResourceType_value) } -func init() { proto.RegisterFile("auth.proto", fileDescriptor_auth_7c04a6f84b604dce) } - -var fileDescriptor_auth_7c04a6f84b604dce = []byte{ - // 1060 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x57, 0xcd, 0x6e, 0xdb, 0x46, - 0x17, 0x8d, 0x24, 0x4a, 0xa6, 0xae, 0x25, 0x7d, 0xf2, 0x00, 0x06, 0xf8, 0x05, 0x45, 0x10, 0xb0, - 0x68, 0x11, 0xa4, 0x05, 0x15, 0xd9, 0x6d, 0xd0, 0xa6, 0x81, 0x5b, 0xbb, 0x75, 0x8b, 0x00, 0x69, - 0x6a, 0xd0, 0x49, 0xff, 0x36, 0x04, 0x45, 0x8d, 0x64, 0x22, 0x24, 0x87, 0x9d, 0x19, 0xca, 0xd0, - 0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0x70, - 0x27, 0x25, 0x91, 0x4f, 0x43, 0xe6, 0xb0, 0x14, 0x07, 0xe1, 0x24, 0x0c, 0xe4, 0xca, 0x75, 0xfc, - 0x34, 0x14, 0x85, 0x61, 0x38, 0xc8, 0x68, 0xc8, 0xe7, 0x47, 0xdd, 0x53, 0xf5, 0xeb, 0x44, 0xe4, - 0xf1, 0xe3, 0xc1, 0x34, 0xe4, 0x67, 0xd9, 0xc8, 0x09, 0x48, 0x3c, 0x50, 0x17, 0xc4, 0x98, 0x9d, - 0x0d, 0x2a, 0x97, 0x0c, 0xf2, 0x28, 0x07, 0x53, 0x32, 0xf0, 0xd3, 0x70, 0x30, 0x1b, 0x0e, 0x8a, - 0xeb, 0x46, 0x2d, 0x59, 0x8e, 0xfd, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x01, 0x92, 0xc7, 0x3d, - 0xee, 0x11, 0x00, 0x00, +func init() { proto.RegisterFile("auth.proto", fileDescriptor_auth_2543522910fa735a) } + +var fileDescriptor_auth_2543522910fa735a = []byte{ + // 1639 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x58, 0xcb, 0x6e, 0xdb, 0x46, + 0x14, 0x8d, 0xde, 0xe2, 0xd5, 0xc3, 0xf4, 0x54, 0x76, 0x58, 0x37, 0x35, 0x52, 0xf5, 0x81, 0x20, + 0x28, 0xa4, 0xd8, 0x69, 0x93, 0xd4, 0x4e, 0xd3, 0xd8, 0x89, 0x13, 0x04, 0x70, 0x12, 0x83, 0x4e, + 0x1a, 0xa4, 0x1b, 0x81, 0xa6, 0xc6, 0x32, 0x61, 0x92, 0xc3, 0x72, 0x48, 0x1b, 0x5a, 0x74, 0x53, + 0x74, 0x5b, 0x74, 0xd7, 0x1f, 0xe8, 0x27, 0x74, 0xd9, 0x45, 0x77, 0xfd, 0x85, 0x02, 0xfd, 0x81, + 0xfe, 0x46, 0x31, 0x43,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x61, 0xad, 0x26, 0x61, 0x37, 0x82, 0xb3, 0x78, 0x38, 0x64, 0xcf, 0xb2, 0xb1, 0x56, 0x97, + 0x89, 0x47, 0x84, 0x65, 0xa7, 0xc4, 0x8e, 0x61, 0xd9, 0x5a, 0x43, 0xe6, 0x94, 0x1c, 0x8a, 0x56, + 0xa1, 0xea, 0xe0, 0xc0, 0xe8, 0x1b, 0x81, 0xa1, 0x35, 0x79, 0x1d, 0x2d, 0xb2, 0x3a, 0x62, 0x39, + 0xde, 0x79, 0x1e, 0x4f, 0x44, 0xf5, 0x93, 0xe0, 0x96, 0xd6, 0xa1, 0x91, 0x99, 0x9a, 0xaa, 0x82, + 0xfe, 0xc8, 0x01, 0x7a, 0x4e, 0xfa, 0xd6, 0xfe, 0x90, 0xed, 0xb1, 0x23, 0xb2, 0x76, 0xba, 0x7a, + 0x7a, 0x08, 0x75, 0x62, 0xf7, 0x7b, 0x49, 0x85, 0xc8, 0xd4, 0x55, 0xc6, 0x82, 0xad, 0xe0, 0xe2, + 0xe3, 0xde, 0x54, 0x35, 0x96, 0xb1, 0x68, 0x3b, 0x30, 0xcf, 0x6e, 0xf0, 0xd4, 0x27, 0xa1, 0xa7, + 0x63, 0xdb, 0x60, 0x8c, 0xc2, 0xca, 0x76, 0xc0, 0x06, 0x64, 0x09, 0x3a, 0x41, 0xa3, 0x65, 0x28, + 0xb1, 0xf8, 0x53, 0x2d, 0xcf, 0xa3, 0x50, 0x15, 0x51, 0xd0, 0xa3, 0xe1, 0xf6, 0x5f, 0x25, 0x50, + 0x92, 0xfd, 0x2e, 0x9d, 0x7e, 0x12, 0x12, 0x29, 0xc8, 0x93, 0x48, 0x96, 0x0e, 0x8a, 0x17, 0xa4, + 0x83, 0xd2, 0xec, 0x74, 0x50, 0x9e, 0x89, 0x0e, 0x2a, 0x33, 0xd0, 0x41, 0x55, 0x9e, 0x0e, 0x56, + 0xa0, 0xea, 0xc7, 0x59, 0x12, 0x33, 0xcf, 0x82, 0x08, 0x71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xf9, 0x7d, 0x0e, 0x56, 0x4c, 0xe2, 0x74, 0x02, 0xec, 0x9a, 0xd8, 0x0d, + 0x3a, 0x1e, 0xb1, 0x0d, 0xdf, 0xa2, 0x1d, 0xea, 0x61, 0xd3, 0xda, 0xb7, 0x4c, 0xde, 0x43, 0x77, + 0x0c, 0xcf, 0x62, 0xc1, 0xa2, 0xd8, 0x0c, 0x7d, 0x2b, 0x18, 0x6e, 0x36, 0x76, 0xe3, 0xaf, 0x1d, + 0x96, 0x17, 0xdf, 0x3c, 0x18, 0x58, 0xc1, 0x41, 0xb8, 0xd7, 0x31, 0x89, 0xd3, 0x8d, 0x17, 0x70, + 0x30, 0x3d, 0xe8, 0x66, 0x16, 0xe9, 0x46, 0xee, 0xeb, 0x0e, 0x48, 0xd7, 0xf0, 0xac, 0xee, 0xd1, + 0x4a, 0x57, 0x2c, 0xb7, 0x57, 0xe6, 0xe9, 0x75, 0xfb, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x5b, + 0x9d, 0xbb, 0x0c, 0xc7, 0x1b, 0x00, 0x00, } diff --git a/source/go/api/v1/service_manage/request.pb.go b/source/go/api/v1/service_manage/request.pb.go index 4b91fa4a..209e55fd 100644 --- a/source/go/api/v1/service_manage/request.pb.go +++ b/source/go/api/v1/service_manage/request.pb.go @@ -31,6 +31,10 @@ const ( DiscoverRequest_NAMESPACES DiscoverRequest_DiscoverRequestType = 12 DiscoverRequest_FAULT_DETECTOR DiscoverRequest_DiscoverRequestType = 13 DiscoverRequest_LANE DiscoverRequest_DiscoverRequestType = 100 + // 自定义路由规则 + DiscoverRequest_CUSTOM_ROUTE_RULE DiscoverRequest_DiscoverRequestType = 101 + // 就近路由规则 + DiscoverRequest_NEARBY_ROUTE_RULE DiscoverRequest_DiscoverRequestType = 102 ) var DiscoverRequest_DiscoverRequestType_name = map[int32]string{ @@ -44,25 +48,29 @@ var DiscoverRequest_DiscoverRequestType_name = map[int32]string{ 12: "NAMESPACES", 13: "FAULT_DETECTOR", 100: "LANE", + 101: "CUSTOM_ROUTE_RULE", + 102: "NEARBY_ROUTE_RULE", } var DiscoverRequest_DiscoverRequestType_value = map[string]int32{ - "UNKNOWN": 0, - "INSTANCE": 1, - "CLUSTER": 2, - "ROUTING": 3, - "RATE_LIMIT": 4, - "CIRCUIT_BREAKER": 5, - "SERVICES": 6, - "NAMESPACES": 12, - "FAULT_DETECTOR": 13, - "LANE": 100, + "UNKNOWN": 0, + "INSTANCE": 1, + "CLUSTER": 2, + "ROUTING": 3, + "RATE_LIMIT": 4, + "CIRCUIT_BREAKER": 5, + "SERVICES": 6, + "NAMESPACES": 12, + "FAULT_DETECTOR": 13, + "LANE": 100, + "CUSTOM_ROUTE_RULE": 101, + "NEARBY_ROUTE_RULE": 102, } func (x DiscoverRequest_DiscoverRequestType) String() string { return proto.EnumName(DiscoverRequest_DiscoverRequestType_name, int32(x)) } func (DiscoverRequest_DiscoverRequestType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_request_e3c7c74833c22ef4, []int{1, 0} + return fileDescriptor_request_2aa6dfc510952749, []int{1, 0} } type DiscoverFilter struct { @@ -76,7 +84,7 @@ func (m *DiscoverFilter) Reset() { *m = DiscoverFilter{} } func (m *DiscoverFilter) String() string { return proto.CompactTextString(m) } func (*DiscoverFilter) ProtoMessage() {} func (*DiscoverFilter) Descriptor() ([]byte, []int) { - return fileDescriptor_request_e3c7c74833c22ef4, []int{0} + return fileDescriptor_request_2aa6dfc510952749, []int{0} } func (m *DiscoverFilter) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DiscoverFilter.Unmarshal(m, b) @@ -116,7 +124,7 @@ func (m *DiscoverRequest) Reset() { *m = DiscoverRequest{} } func (m *DiscoverRequest) String() string { return proto.CompactTextString(m) } func (*DiscoverRequest) ProtoMessage() {} func (*DiscoverRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_request_e3c7c74833c22ef4, []int{1} + return fileDescriptor_request_2aa6dfc510952749, []int{1} } func (m *DiscoverRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DiscoverRequest.Unmarshal(m, b) @@ -163,36 +171,37 @@ func init() { proto.RegisterEnum("v1.DiscoverRequest_DiscoverRequestType", DiscoverRequest_DiscoverRequestType_name, DiscoverRequest_DiscoverRequestType_value) } -func init() { proto.RegisterFile("request.proto", fileDescriptor_request_e3c7c74833c22ef4) } - -var fileDescriptor_request_e3c7c74833c22ef4 = []byte{ - // 439 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0x41, 0x6f, 0xd3, 0x30, - 0x14, 0xc7, 0x49, 0x97, 0xb5, 0x91, 0xdb, 0x66, 0x96, 0x7b, 0xa9, 0x76, 0x40, 0x53, 0x24, 0xc4, - 0xc4, 0x21, 0xa1, 0xe3, 0xc0, 0x81, 0x53, 0x9a, 0x7a, 0x10, 0xd6, 0xa5, 0x93, 0xe3, 0x80, 0xc4, - 0xa5, 0xf2, 0x8c, 0x69, 0x2d, 0xb5, 0x71, 0x48, 0xdc, 0x48, 0xf9, 0x10, 0x7c, 0x1e, 0x3e, 0x0f, - 0xdf, 0x04, 0xb9, 0x49, 0x25, 0x98, 0x76, 0x7c, 0xef, 0xff, 0xff, 0xff, 0xde, 0x4b, 0x9e, 0xc1, - 0xb8, 0x14, 0x3f, 0x0f, 0xa2, 0xd2, 0x7e, 0x51, 0x2a, 0xad, 0x50, 0xaf, 0x9e, 0x5d, 0x8e, 0x2b, - 0x51, 0xd6, 0x92, 0x8b, 0xb6, 0x75, 0xe9, 0x72, 0x95, 0xeb, 0x92, 0xf1, 0xce, 0xe2, 0xcd, 0x81, - 0xbb, 0x90, 0x15, 0x57, 0xb5, 0x28, 0x6f, 0xe5, 0x4e, 0x8b, 0x12, 0xbd, 0x05, 0x93, 0x55, 0xbe, - 0x6b, 0x3e, 0x09, 0xb6, 0xd3, 0xdb, 0x26, 0xce, 0x2b, 0xcd, 0x72, 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 0x0c, 0xbf, 0x7b, 0xb6, 0x33, 0x80, 0x43, 0xcf, 0x76, 0x5c, 0xc8, 0x3f, 0xdb, 0xce, - 0x19, 0x3c, 0x9f, 0xff, 0xb2, 0xc0, 0x7b, 0xae, 0xf6, 0xbe, 0x16, 0x39, 0x17, 0xb9, 0xf6, 0x0b, - 0xb5, 0x63, 0xa5, 0xac, 0xfc, 0xaa, 0x10, 0x5c, 0xfe, 0x90, 0x9c, 0x69, 0xa9, 0x72, 0x9f, 0x15, - 0xd2, 0xfc, 0x83, 0xd3, 0xc9, 0xf7, 0x2c, 0x67, 0x1b, 0x31, 0x1f, 0x75, 0x1f, 0xfc, 0x60, 0x2e, - 0xfe, 0x6d, 0xb1, 0x91, 0x7a, 0x7b, 0x78, 0xf4, 0xb9, 0xda, 0x07, 0x1d, 0x65, 0x2f, 0xaa, 0x6d, - 0xf0, 0x1f, 0x29, 0xa8, 0xd4, 0xa1, 0xe4, 0x22, 0xd8, 0xa8, 0x80, 0x15, 0x32, 0xa8, 0x67, 0x41, - 0xc7, 0x5c, 0xb7, 0xcc, 0xc7, 0xfe, 0xf1, 0xf9, 0xbc, 0xfb, 0x1b, 0x00, 0x00, 0xff, 0xff, 0xea, - 0x5c, 0x0d, 0x87, 0x72, 0x02, 0x00, 0x00, +func init() { proto.RegisterFile("request.proto", fileDescriptor_request_2aa6dfc510952749) } + +var fileDescriptor_request_2aa6dfc510952749 = []byte{ + // 463 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x52, 0x4f, 0x6b, 0xdb, 0x3c, + 0x18, 0x7f, 0x9d, 0xb8, 0x89, 0x51, 0x12, 0x57, 0xaf, 0xc2, 0x20, 0xf4, 0x30, 0x4a, 0x60, 0xac, + 0xec, 0x60, 0x2f, 0xdd, 0x61, 0x87, 0x9d, 0x1c, 0x47, 0xdd, 0xbc, 0x26, 0x76, 0x91, 0xe5, 0x8d,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xff, 0xd0, 0x10, 0x58, 0x41, 0x18, 0x53, 0x2f, 0xf4, 0x31, 0x34, 0x34, + 0xe5, 0x2f, 0x93, 0x98, 0x62, 0x02, 0x3b, 0x7a, 0x20, 0x51, 0x42, 0x83, 0xf0, 0x23, 0xec, 0x22, + 0x1b, 0x00, 0xe2, 0x51, 0x9c, 0x2e, 0x83, 0x55, 0x40, 0xa1, 0x89, 0xc6, 0xe0, 0xdc, 0x0f, 0x88, + 0x9f, 0x04, 0x34, 0x9d, 0x13, 0xec, 0xdd, 0x62, 0x02, 0xcf, 0x74, 0x58, 0x8c, 0xc9, 0x97, 0xc0, + 0xc7, 0x31, 0xec, 0x69, 0x4b, 0xe8, 0xad, 0x70, 0x7c, 0xe7, 0xe9, 0x79, 0x88, 0x10, 0xb0, 0x6f, + 0xbc, 0x64, 0x49, 0xd3, 0x05, 0xa6, 0xd8, 0xa7, 0x11, 0x81, 0x23, 0x64, 0x01, 0x73, 0xe9, 0x85, + 0x18, 0xfe, 0x40, 0x2f, 0xc0, 0xff, 0x7e, 0x12, 0xd3, 0x68, 0x95, 0xea, 0xa5, 0x38, 0x25, 0xc9, + 0x12, 0x43, 0xae, 0xe1, 0x10, 0x7b, 0x64, 0xfe, 0xed, 0x31, 0xfc, 0x30, 0x35, 0xad, 0x3e, 0x1c, + 0x4c, 0x4d, 0xcb, 0x86, 0xec, 0xb3, 0x69, 0x75, 0xe1, 0xd9, 0xfc, 0x97, 0x01, 0xde, 0x33, 0xb9, + 0x73, 0x14, 0xcf, 0x19, 0xcf, 0x95, 0x53, 0xc8, 0x6d, 0x56, 0x8a, 0xca, 0xa9, 0x0a, 0xce, 0xc4, + 0x83, 0x60, 0x99, 0x12, 0x32, 0x77, 0xb2, 0x42, 0xe8, 0x8f, 0x9d, 0x0a, 0xb2, 0xcb, 0xf2, 0x6c, + 0xcd, 0xe7, 0xc3, 0xf6, 0x3d, 0x77, 0xba, 0x1f, 0xdf, 0x17, 0x6b, 0xa1, 0x36, 0xfb, 0x7b, 0x87, + 0xc9, 0x9d, 0xdb, 0xa6, 0xec, 0x78, 0xb5, 0x71, 0xff, 0x49, 0x72, 0x2b, 0xb9, 0x2f, 0x19, 0x77, + 0xd7, 0xd2, 0xcd, 0x0a, 0xe1, 0xd6, 0x33, 0xb7, 0xcd, 0x4c, 0x9b, 0xcc, 0xfb, 0xde, 0xb1, 0x6c, + 0xef, 0xfe, 0x06, 0x00, 0x00, 0xff, 0xff, 0x31, 0x85, 0x27, 0xb8, 0xa0, 0x02, 0x00, 0x00, } diff --git a/source/go/api/v1/service_manage/response.pb.go b/source/go/api/v1/service_manage/response.pb.go index f3a7ecf3..17800c38 100644 --- a/source/go/api/v1/service_manage/response.pb.go +++ b/source/go/api/v1/service_manage/response.pb.go @@ -37,6 +37,10 @@ const ( DiscoverResponse_NAMESPACES DiscoverResponse_DiscoverResponseType = 12 DiscoverResponse_FAULT_DETECTOR DiscoverResponse_DiscoverResponseType = 13 DiscoverResponse_LANE DiscoverResponse_DiscoverResponseType = 100 + // 自定义路由规则 + DiscoverResponse_CUSTOM_ROUTE_RULE DiscoverResponse_DiscoverResponseType = 101 + // 就近路由规则 + DiscoverResponse_NEARBY_ROUTE_RULE DiscoverResponse_DiscoverResponseType = 102 ) var DiscoverResponse_DiscoverResponseType_name = map[int32]string{ @@ -50,25 +54,29 @@ var DiscoverResponse_DiscoverResponseType_name = map[int32]string{ 12: "NAMESPACES", 13: "FAULT_DETECTOR", 100: "LANE", + 101: "CUSTOM_ROUTE_RULE", + 102: "NEARBY_ROUTE_RULE", } var DiscoverResponse_DiscoverResponseType_value = map[string]int32{ - "UNKNOWN": 0, - "INSTANCE": 1, - "CLUSTER": 2, - "ROUTING": 3, - "RATE_LIMIT": 4, - "CIRCUIT_BREAKER": 5, - "SERVICES": 6, - "NAMESPACES": 12, - "FAULT_DETECTOR": 13, - "LANE": 100, + "UNKNOWN": 0, + "INSTANCE": 1, + "CLUSTER": 2, + "ROUTING": 3, + "RATE_LIMIT": 4, + "CIRCUIT_BREAKER": 5, + "SERVICES": 6, + "NAMESPACES": 12, + "FAULT_DETECTOR": 13, + "LANE": 100, + "CUSTOM_ROUTE_RULE": 101, + "NEARBY_ROUTE_RULE": 102, } func (x DiscoverResponse_DiscoverResponseType) String() string { return proto.EnumName(DiscoverResponse_DiscoverResponseType_name, int32(x)) } func (DiscoverResponse_DiscoverResponseType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_response_4c25fa54242d5154, []int{3, 0} + return fileDescriptor_response_2a16a4fe3b45dfe4, []int{3, 0} } type Response struct { @@ -104,7 +112,7 @@ func (m *Response) Reset() { *m = Response{} } func (m *Response) String() string { return proto.CompactTextString(m) } func (*Response) ProtoMessage() {} func (*Response) Descriptor() ([]byte, []int) { - return fileDescriptor_response_4c25fa54242d5154, []int{0} + return fileDescriptor_response_2a16a4fe3b45dfe4, []int{0} } func (m *Response) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Response.Unmarshal(m, b) @@ -299,7 +307,7 @@ func (m *BatchWriteResponse) Reset() { *m = BatchWriteResponse{} } func (m *BatchWriteResponse) String() string { return proto.CompactTextString(m) } func (*BatchWriteResponse) ProtoMessage() {} func (*BatchWriteResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_response_4c25fa54242d5154, []int{1} + return fileDescriptor_response_2a16a4fe3b45dfe4, []int{1} } func (m *BatchWriteResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_BatchWriteResponse.Unmarshal(m, b) @@ -374,7 +382,7 @@ func (m *BatchQueryResponse) Reset() { *m = BatchQueryResponse{} } func (m *BatchQueryResponse) String() string { return proto.CompactTextString(m) } func (*BatchQueryResponse) ProtoMessage() {} func (*BatchQueryResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_response_4c25fa54242d5154, []int{2} + return fileDescriptor_response_2a16a4fe3b45dfe4, []int{2} } func (m *BatchQueryResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_BatchQueryResponse.Unmarshal(m, b) @@ -514,29 +522,33 @@ func (m *BatchQueryResponse) GetSummary() *model.Summary { } type DiscoverResponse struct { - Code *wrapperspb.UInt32Value `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"` - Info *wrapperspb.StringValue `protobuf:"bytes,2,opt,name=info,proto3" json:"info,omitempty"` - Type DiscoverResponse_DiscoverResponseType `protobuf:"varint,3,opt,name=type,proto3,enum=v1.DiscoverResponse_DiscoverResponseType" json:"type,omitempty"` - Service *Service `protobuf:"bytes,4,opt,name=service,proto3" json:"service,omitempty"` - Instances []*Instance `protobuf:"bytes,5,rep,name=instances,proto3" json:"instances,omitempty"` - Routing *traffic_manage.Routing `protobuf:"bytes,6,opt,name=routing,proto3" json:"routing,omitempty"` - RateLimit *traffic_manage.RateLimit `protobuf:"bytes,7,opt,name=rateLimit,proto3" json:"rateLimit,omitempty"` - CircuitBreaker *fault_tolerance.CircuitBreaker `protobuf:"bytes,8,opt,name=circuitBreaker,proto3" json:"circuitBreaker,omitempty"` - Services []*Service `protobuf:"bytes,9,rep,name=services,proto3" json:"services,omitempty"` - Namespaces []*model.Namespace `protobuf:"bytes,10,rep,name=namespaces,proto3" json:"namespaces,omitempty"` - FaultDetector *fault_tolerance.FaultDetector `protobuf:"bytes,11,opt,name=faultDetector,proto3" json:"faultDetector,omitempty"` - AliasFor *Service `protobuf:"bytes,21,opt,name=aliasFor,proto3" json:"aliasFor,omitempty"` - Lanes []*traffic_manage.LaneGroup `protobuf:"bytes,22,rep,name=lanes,proto3" json:"lanes,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Code *wrapperspb.UInt32Value `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"` + Info *wrapperspb.StringValue `protobuf:"bytes,2,opt,name=info,proto3" json:"info,omitempty"` + Type DiscoverResponse_DiscoverResponseType `protobuf:"varint,3,opt,name=type,proto3,enum=v1.DiscoverResponse_DiscoverResponseType" json:"type,omitempty"` + Service *Service `protobuf:"bytes,4,opt,name=service,proto3" json:"service,omitempty"` + Instances []*Instance `protobuf:"bytes,5,rep,name=instances,proto3" json:"instances,omitempty"` + Routing *traffic_manage.Routing `protobuf:"bytes,6,opt,name=routing,proto3" json:"routing,omitempty"` + RateLimit *traffic_manage.RateLimit `protobuf:"bytes,7,opt,name=rateLimit,proto3" json:"rateLimit,omitempty"` + CircuitBreaker *fault_tolerance.CircuitBreaker `protobuf:"bytes,8,opt,name=circuitBreaker,proto3" json:"circuitBreaker,omitempty"` + Services []*Service `protobuf:"bytes,9,rep,name=services,proto3" json:"services,omitempty"` + Namespaces []*model.Namespace `protobuf:"bytes,10,rep,name=namespaces,proto3" json:"namespaces,omitempty"` + FaultDetector *fault_tolerance.FaultDetector `protobuf:"bytes,11,opt,name=faultDetector,proto3" json:"faultDetector,omitempty"` + AliasFor *Service `protobuf:"bytes,21,opt,name=aliasFor,proto3" json:"aliasFor,omitempty"` + Lanes []*traffic_manage.LaneGroup `protobuf:"bytes,22,rep,name=lanes,proto3" json:"lanes,omitempty"` + // 自定义路由规则内容 + CustomRouteRules []*traffic_manage.RouteRule `protobuf:"bytes,23,rep,name=customRouteRules,proto3" json:"customRouteRules,omitempty"` + // 就近路由规则内容 + NearbyRouteRules []*traffic_manage.RouteRule `protobuf:"bytes,24,rep,name=nearbyRouteRules,proto3" json:"nearbyRouteRules,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *DiscoverResponse) Reset() { *m = DiscoverResponse{} } func (m *DiscoverResponse) String() string { return proto.CompactTextString(m) } func (*DiscoverResponse) ProtoMessage() {} func (*DiscoverResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_response_4c25fa54242d5154, []int{3} + return fileDescriptor_response_2a16a4fe3b45dfe4, []int{3} } func (m *DiscoverResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DiscoverResponse.Unmarshal(m, b) @@ -647,6 +659,20 @@ func (m *DiscoverResponse) GetLanes() []*traffic_manage.LaneGroup { return nil } +func (m *DiscoverResponse) GetCustomRouteRules() []*traffic_manage.RouteRule { + if m != nil { + return m.CustomRouteRules + } + return nil +} + +func (m *DiscoverResponse) GetNearbyRouteRules() []*traffic_manage.RouteRule { + if m != nil { + return m.NearbyRouteRules + } + return nil +} + type OptionSwitch struct { Options map[string]string `protobuf:"bytes,1,rep,name=options,proto3" json:"options,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -658,7 +684,7 @@ func (m *OptionSwitch) Reset() { *m = OptionSwitch{} } func (m *OptionSwitch) String() string { return proto.CompactTextString(m) } func (*OptionSwitch) ProtoMessage() {} func (*OptionSwitch) Descriptor() ([]byte, []int) { - return fileDescriptor_response_4c25fa54242d5154, []int{4} + return fileDescriptor_response_2a16a4fe3b45dfe4, []int{4} } func (m *OptionSwitch) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OptionSwitch.Unmarshal(m, b) @@ -696,7 +722,7 @@ func (m *InstanceLabels) Reset() { *m = InstanceLabels{} } func (m *InstanceLabels) String() string { return proto.CompactTextString(m) } func (*InstanceLabels) ProtoMessage() {} func (*InstanceLabels) Descriptor() ([]byte, []int) { - return fileDescriptor_response_4c25fa54242d5154, []int{5} + return fileDescriptor_response_2a16a4fe3b45dfe4, []int{5} } func (m *InstanceLabels) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_InstanceLabels.Unmarshal(m, b) @@ -735,98 +761,102 @@ func init() { proto.RegisterEnum("v1.DiscoverResponse_DiscoverResponseType", DiscoverResponse_DiscoverResponseType_name, DiscoverResponse_DiscoverResponseType_value) } -func init() { proto.RegisterFile("response.proto", fileDescriptor_response_4c25fa54242d5154) } - -var fileDescriptor_response_4c25fa54242d5154 = []byte{ - // 1428 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00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 0xdb, 0xf1, 0x03, 0x40, - 0xa2, 0xc7, 0x1c, 0x17, 0x65, 0x3f, 0xe6, 0x04, 0x3b, 0x43, 0x40, 0xdf, 0x41, 0x45, 0xcf, 0x00, - 0xc7, 0x25, 0x49, 0xce, 0x49, 0x76, 0x02, 0x8a, 0x36, 0xc7, 0x43, 0xc9, 0x71, 0x39, 0x6d, 0x73, - 0x22, 0xda, 0x29, 0x2c, 0x82, 0x6a, 0x65, 0x16, 0x8a, 0xbc, 0x3c, 0x2f, 0xdb, 0x09, 0x88, 0x76, - 0xa0, 0x2c, 0x85, 0x99, 0x72, 0x5c, 0x95, 0xbc, 0xeb, 0xca, 0x1d, 0x13, 0xd0, 0x36, 0x40, 0x22, - 0xd0, 0x1c, 0x83, 0xa4, 0xa7, 0xe2, 0x9d, 0xc1, 0x90, 0x05, 0x48, 0x29, 0xeb, 0x5b, 0x16, 0x5e, - 0x0e, 0xe2, 0xea, 0x6a, 0xd2, 0x63, 0x23, 0x95, 0xe1, 0x0c, 0x4a, 0x6e, 0x70, 0x40, 0x5b, 0x50, - 0x14, 0x8a, 0xca, 0x31, 0x4a, 0xdf, 0x25, 0x05, 0x59, 0x99, 0x45, 0xa7, 0x13, 0xc5, 0xe5, 0x78, - 0x2d, 0xed, 0x74, 0xaa, 0x37, 0x19, 0x02, 0x7a, 0x06, 0xf5, 0x8c, 0xda, 0x32, 0xca, 0xf1, 0x7a, - 0x5a, 0x72, 0x4e, 0xe7, 0xe6, 0x78, 0xe8, 0x01, 0x94, 0xd5, 0x97, 0x31, 0xc7, 0x1b, 0xd2, 0x25, - 0xfb, 0x3d, 0x1d, 0x43, 0x89, 0x46, 0xdc, 0x96, 0x94, 0x45, 0x1a, 0x21, 0xbe, 0xa5, 0xa3, 0xc9, - 0xc4, 0x0e, 0x66, 0x5a, 0xae, 0xd5, 0x91, 0x2b, 0x13, 0x89, 0x31, 0xa9, 0x05, 0xa8, 0xf1, 0xa1, - 0x04, 0xe6, 0x21, 0xe3, 0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- 0x01, 0xea, 0xf9, 0xc5, 0x04, 0xfd, 0x08, 0x25, 0x57, 0x2d, 0x2f, 0x2a, 0x8d, 0xad, 0xeb, 0xcb, - 0x4b, 0x53, 0xfd, 0x53, 0x79, 0x68, 0xf6, 0x66, 0x17, 0x6a, 0x19, 0xf3, 0x0d, 0x59, 0x3c, 0xc8, - 0x66, 0x51, 0xdb, 0xab, 0xeb, 0x25, 0x8c, 0x79, 0xe3, 0x1e, 0xe3, 0x61, 0x26, 0xab, 0x83, 0xbf, - 0x0a, 0xb0, 0xef, 0xf8, 0x93, 0x66, 0x48, 0x3d, 0x47, 0xfe, 0x1c, 0xf3, 0x5d, 0x3b, 0x60, 0xbc, - 0xc9, 0xa7, 0xd4, 0x61, 0x17, 0xcc, 0x91, 0x8b, 0x69, 0xd3, 0x9e, 0x32, 0x11, 0x22, 0xfe, 0x11, - 0x38, 0xb1, 0x3d, 0x7b, 0x4c, 0x0f, 0x56, 0xe3, 0x39, 0x7a, 0x2d, 0x74, 0xe7, 0xb7, 0xc3, 0x31, - 0x0b, 0x2f, 0xa3, 0xb3, 0xa6, 0xe3, 0x4f, 0x5a, 0x3a, 0xcc, 0x84, 0xf2, 0xcb, 0x56, 0x2e, 0x54, - 0x4b, 0xad, 0x7d, 0xad, 0xb1, 0xdf, 0xb2, 0xa7, 0xac, 0x75, 0xb5, 0xdb, 0xd2, 0x41, 0x4f, 0x55, - 0xd0, 0xb3, 0x92, 0x14, 0xb1, 0x27, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0x68, 0x3d, 0x0e, 0x26, - 0xd2, 0x0e, 0x00, 0x00, +func init() { proto.RegisterFile("response.proto", fileDescriptor_response_2a16a4fe3b45dfe4) } + +var fileDescriptor_response_2a16a4fe3b45dfe4 = []byte{ + // 1493 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0xcd, 0x6e, 0x1b, 0x47,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24, 0x2d, 0x60, 0x91, 0x8b, 0x9e, 0x41, 0xd5, 0x67, 0xc2, 0x0b, 0x7d, 0x9b, + 0x09, 0xbc, 0x99, 0xd6, 0x9c, 0xbc, 0x33, 0x06, 0x49, 0xca, 0x93, 0xdd, 0xf5, 0x66, 0xb2, 0xfc, + 0xc1, 0x47, 0x1e, 0xd8, 0x17, 0xf8, 0x9f, 0x69, 0x77, 0x4f, 0x32, 0x76, 0x92, 0x63, 0xc9, 0x99, + 0x8a, 0xc7, 0xba, 0x47, 0x4f, 0x99, 0x23, 0xf0, 0xfd, 0x74, 0xa6, 0xba, 0x39, 0x84, 0x2c, 0x30, + 0xd1, 0x36, 0x18, 0x67, 0x34, 0xa0, 0xf8, 0x81, 0xf2, 0x58, 0xbf, 0x72, 0xb5, 0xdb, 0xee, 0x9c, + 0x28, 0x86, 0xec, 0x87, 0xbe, 0x65, 0x1d, 0x2d, 0x34, 0x78, 0x2b, 0xed, 0xc7, 0x20, 0x0f, 0x91, + 0x45, 0xee, 0x37, 0x46, 0x65, 0xc5, 0x5c, 0x6b, 0xfc, 0x59, 0x00, 0x74, 0x40, 0x03, 0xfb, 0xe2, + 0xbd, 0xcf, 0x03, 0xf6, 0x45, 0x25, 0xe9, 0x29, 0x18, 0x82, 0xff, 0xc8, 0xb4, 0x20, 0x7d, 0xe2, + 0x1d, 0x92, 0x89, 0x76, 0xd4, 0x11, 0xaa, 0x0c, 0x05, 0x36, 0x1e, 0x2e, 0xc7, 0x6a, 0x92, 0x4c, + 0x5e, 0x0a, 0x37, 0xfe, 0x28, 0xe9, 0xc2, 0xbe, 0x0d, 0x99, 0x3f, 0xff, 0xa2, 0x85, 0x3d, 0x87, + 0x12, 0x9d, 0x7a, 0x61, 0xa2, 0xb5, 0x37, 0xbf, 0x45, 0x73, 0x93, 0x76, 0x18, 0x9f, 0xdd, 0x8e, + 0xff, 0x01, 0x24, 0x7a, 0x2c, 0x70, 0x51, 0xf5, 0x63, 0x41, 0xb0, 0x33, 0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9f, 0xfd, 0x15, 0x00, 0x00, 0xff, 0xff, 0x8c, 0xb9, 0x2c, + 0x63, 0x76, 0x0f, 0x00, 0x00, } diff --git a/source/go/api/v1/traffic_manage/lane.pb.go b/source/go/api/v1/traffic_manage/lane.pb.go index 689c571e..3f4aff05 100644 --- a/source/go/api/v1/traffic_manage/lane.pb.go +++ b/source/go/api/v1/traffic_manage/lane.pb.go @@ -43,7 +43,7 @@ func (x TrafficMatchRule_TrafficMatchMode) String() string { return proto.EnumName(TrafficMatchRule_TrafficMatchMode_name, int32(x)) } func (TrafficMatchRule_TrafficMatchMode) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_lane_3097fe36f56fba0e, []int{4, 0} + return fileDescriptor_lane_839cbd83584c3604, []int{4, 0} } type LaneRule_LaneMatchMode int32 @@ -68,14 +68,15 @@ func (x LaneRule_LaneMatchMode) String() string { return proto.EnumName(LaneRule_LaneMatchMode_name, int32(x)) } func (LaneRule_LaneMatchMode) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_lane_3097fe36f56fba0e, []int{5, 0} + return fileDescriptor_lane_839cbd83584c3604, []int{5, 0} } // 流量入口 type TrafficEntry struct { // 标记流量入口类型 - // type == "polarismesh.cn/gateway/spring-cloud-gateway", 则 selector 为 ServiceGatewaySelector - // type == "polarismesh.cn/service, 则 selector 为 ServiceSelector + // type == "polarismesh.cn/gateway/spring-cloud-gateway", 则 selector 为 + // ServiceGatewaySelector type == "polarismesh.cn/service, 则 selector 为 + // ServiceSelector Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` Selector *anypb.Any `protobuf:"bytes,2,opt,name=selector,proto3" json:"selector,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -87,7 +88,7 @@ func (m *TrafficEntry) Reset() { *m = TrafficEntry{} } func (m *TrafficEntry) String() string { return proto.CompactTextString(m) } func (*TrafficEntry) ProtoMessage() {} func (*TrafficEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_lane_3097fe36f56fba0e, []int{0} + return fileDescriptor_lane_839cbd83584c3604, []int{0} } func (m *TrafficEntry) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_TrafficEntry.Unmarshal(m, b) @@ -136,7 +137,7 @@ func (m *ServiceGatewaySelector) Reset() { *m = ServiceGatewaySelector{} func (m *ServiceGatewaySelector) String() string { return proto.CompactTextString(m) } func (*ServiceGatewaySelector) ProtoMessage() {} func (*ServiceGatewaySelector) Descriptor() ([]byte, []int) { - return fileDescriptor_lane_3097fe36f56fba0e, []int{1} + return fileDescriptor_lane_839cbd83584c3604, []int{1} } func (m *ServiceGatewaySelector) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ServiceGatewaySelector.Unmarshal(m, b) @@ -192,7 +193,7 @@ func (m *ServiceSelector) Reset() { *m = ServiceSelector{} } func (m *ServiceSelector) String() string { return proto.CompactTextString(m) } func (*ServiceSelector) ProtoMessage() {} func (*ServiceSelector) Descriptor() ([]byte, []int) { - return fileDescriptor_lane_3097fe36f56fba0e, []int{2} + return fileDescriptor_lane_839cbd83584c3604, []int{2} } func (m *ServiceSelector) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ServiceSelector.Unmarshal(m, b) @@ -252,17 +253,19 @@ type LaneGroup struct { // 泳道组的更新时间 Mtime string `protobuf:"bytes,10,opt,name=mtime,proto3" json:"mtime,omitempty"` // 泳道组内的流量入口信息 - Rules []*LaneRule `protobuf:"bytes,11,rep,name=rules,proto3" json:"rules,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Rules []*LaneRule `protobuf:"bytes,11,rep,name=rules,proto3" json:"rules,omitempty"` + // 泳道组标签信息 + Metadata map[string]string `protobuf:"bytes,20,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *LaneGroup) Reset() { *m = LaneGroup{} } func (m *LaneGroup) String() string { return proto.CompactTextString(m) } func (*LaneGroup) ProtoMessage() {} func (*LaneGroup) Descriptor() ([]byte, []int) { - return fileDescriptor_lane_3097fe36f56fba0e, []int{3} + return fileDescriptor_lane_839cbd83584c3604, []int{3} } func (m *LaneGroup) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_LaneGroup.Unmarshal(m, b) @@ -345,6 +348,13 @@ func (m *LaneGroup) GetRules() []*LaneRule { return nil } +func (m *LaneGroup) GetMetadata() map[string]string { + if m != nil { + return m.Metadata + } + return nil +} + // TrafficMatchRule 流量匹配规则 type TrafficMatchRule struct { // 流量匹配规则,判断哪些流量需要进入泳道 @@ -359,7 +369,7 @@ func (m *TrafficMatchRule) Reset() { *m = TrafficMatchRule{} } func (m *TrafficMatchRule) String() string { return proto.CompactTextString(m) } func (*TrafficMatchRule) ProtoMessage() {} func (*TrafficMatchRule) Descriptor() ([]byte, []int) { - return fileDescriptor_lane_3097fe36f56fba0e, []int{4} + return fileDescriptor_lane_839cbd83584c3604, []int{4} } func (m *TrafficMatchRule) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_TrafficMatchRule.Unmarshal(m, b) @@ -427,7 +437,7 @@ func (m *LaneRule) Reset() { *m = LaneRule{} } func (m *LaneRule) String() string { return proto.CompactTextString(m) } func (*LaneRule) ProtoMessage() {} func (*LaneRule) Descriptor() ([]byte, []int) { - return fileDescriptor_lane_3097fe36f56fba0e, []int{5} + return fileDescriptor_lane_839cbd83584c3604, []int{5} } func (m *LaneRule) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_LaneRule.Unmarshal(m, b) @@ -545,63 +555,67 @@ func init() { proto.RegisterType((*ServiceSelector)(nil), "v1.ServiceSelector") proto.RegisterMapType((map[string]*model.MatchString)(nil), "v1.ServiceSelector.LabelsEntry") proto.RegisterType((*LaneGroup)(nil), "v1.LaneGroup") + proto.RegisterMapType((map[string]string)(nil), "v1.LaneGroup.MetadataEntry") proto.RegisterType((*TrafficMatchRule)(nil), "v1.TrafficMatchRule") proto.RegisterType((*LaneRule)(nil), "v1.LaneRule") proto.RegisterEnum("v1.TrafficMatchRule_TrafficMatchMode", TrafficMatchRule_TrafficMatchMode_name, TrafficMatchRule_TrafficMatchMode_value) proto.RegisterEnum("v1.LaneRule_LaneMatchMode", LaneRule_LaneMatchMode_name, LaneRule_LaneMatchMode_value) } -func init() { proto.RegisterFile("lane.proto", fileDescriptor_lane_3097fe36f56fba0e) } - -var fileDescriptor_lane_3097fe36f56fba0e = []byte{ - // 777 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0xcd, 0x8e, 0xe3, 0x44, - 0x10, 0x5e, 0x27, 0x93, 0xbf, 0xca, 0xcf, 0x9a, 0x26, 0x5a, 0x99, 0x08, 0x44, 0x64, 0xb4, 0x28, - 0x02, 0x61, 0x33, 0xe1, 0xb0, 0x0b, 0x07, 0xa4, 0x9d, 0x9d, 0xd1, 0x6a, 0xd0, 0xce, 0xb2, 0xea, - 0x44, 0x7b, 0xe0, 0x12, 0x75, 0x9c, 0x8a, 0xa7, 0x85, 0xdd, 0x6d, 0xb5, 0xdb, 0x41, 0x79, 0x05, - 0x5e, 0x83, 0x23, 0xef, 0xc2, 0x13, 0xc0, 0xbb, 0xa0, 0x6e, 0x3b, 0xbf, 0xcc, 0x01, 0x84, 0xb4, - 0xb7, 0xae, 0xef, 0xab, 0xae, 0xaa, 0xaf, 0xfa, 0x8b, 0x03, 0x90, 0x30, 0x81, 0x41, 0xa6, 0xa4, - 0x96, 0xa4, 0xb6, 0xb9, 0x1c, 0x7d, 0x14, 0x4b, 0x19, 0x27, 0x18, 0x5a, 0x64, 0x59, 0xac, 0x43, - 0x26, 0xb6, 0x25, 0x3d, 0xea, 0xa6, 0x72, 0x85, 0x49, 0x15, 0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 0x82, 0x7e, 0xab, 0x41, 0xe7, 0x35, 0x13, 0xf8, 0x4a, 0xc9, 0x22, 0x23, 0x03, 0xa8, 0xf1, - 0x55, 0x55, 0xa9, 0xc6, 0x57, 0xc6, 0x13, 0x46, 0x49, 0x35, 0xb9, 0x3d, 0x93, 0x2f, 0xa0, 0x85, - 0x42, 0x2b, 0x8e, 0xbb, 0xb9, 0x5d, 0x53, 0xfe, 0xd8, 0x4a, 0x74, 0x97, 0x40, 0x9e, 0x43, 0x6f, - 0x85, 0xb9, 0xe6, 0x82, 0x69, 0x2e, 0x45, 0xee, 0x5d, 0xd8, 0x0b, 0x43, 0x73, 0xe1, 0xfa, 0x80, - 0xdb, 0xde, 0xf4, 0x24, 0x93, 0x8c, 0xa0, 0xad, 0x70, 0xc3, 0x73, 0x2e, 0x85, 0xd7, 0xb2, 0xdd, - 0xf7, 0x31, 0x19, 0x43, 0x77, 0x85, 0x79, 0xa4, 0x78, 0x66, 0x72, 0xbd, 0xb6, 0xa5, 0x8f, 0x21, - 0x32, 0x84, 0x46, 0xa4, 0x79, 0x8a, 0x5e, 0xc7, 0x72, 0x65, 0x60, 0xd0, 0xd4, 0xa2, 0x50, 0xa2, - 0x36, 0x20, 0x3e, 0x34, 0x54, 0x91, 0x60, 0xee, 0x75, 0xed, 0x70, 0x3d, 0x33, 0x9c, 0xd9, 0x08, - 0x2d, 0x12, 0xa4, 0x25, 0xe5, 0xff, 0xee, 0x80, 0x5b, 0x29, 0xb4, 0x7b, 0x34, 0x1c, 0xf9, 0x0a, - 0x3a, 0x4c, 0xc5, 0x45, 0x8a, 0x42, 0xef, 0x94, 0xd9, 0x4d, 0xcf, 0x64, 0xa1, 0x22, 0x2c, 0xf3, - 0x0e, 0x19, 0xe4, 0x25, 0x74, 0x52, 0x83, 0xdd, 0xc9, 0x15, 0x7a, 0x83, 0xb1, 0x33, 0x19, 0x4c, - 0x9f, 0x1e, 0x6d, 0x6e, 0x5f, 0xf7, 0x04, 0x30, 0xc9, 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, 0xb7, - 0xb3, 0xd9, 0xed, 0xbb, 0x1b, 0xd7, 0xb9, 0xfa, 0xd5, 0x81, 0x67, 0x91, 0x4c, 0x03, 0x8d, 0x22, - 0x42, 0xa1, 0x83, 0x4c, 0x26, 0x4c, 0xf1, 0x3c, 0xc8, 0x33, 0x8c, 0xf8, 0x9a, 0x47, 0xf6, 0x27, - 0x14, 0xb0, 0x8c, 0x9b, 0xbd, 0x54, 0x2f, 0x11, 0xa4, 0x4c, 0xb0, 0x18, 0xaf, 0xec, 0x8f, 0xfd, - 0xad, 0xf9, 0x76, 0xff, 0x74, 0x1d, 0x73, 0x7d, 0x5f, 0x2c, 0x83, 0x48, 0xa6, 0x61, 0x55, 0x22, - 0xc5, 0xfc, 0x3e, 0x3c, 0x29, 0x13, 0xe6, 0xd6, 0xcd, 0x61, 0x2c, 0x43, 0x96, 0xf1, 0x70, 0x73, - 0x19, 0x1e, 0xac, 0x60, 0x0a, 0x2e, 0x9b, 0xf6, 0x8f, 0xe0, 0x9b, 0xbf, 0x03, 0x00, 0x00, 0xff, - 0xff, 0x78, 0xdc, 0xc3, 0x0b, 0x96, 0x06, 0x00, 0x00, +func init() { proto.RegisterFile("lane.proto", fileDescriptor_lane_839cbd83584c3604) } + +var fileDescriptor_lane_839cbd83584c3604 = []byte{ + // 818 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0xdd, 0x6e, 0xe3, 0x44, + 0x14, 0x5e, 0x27, 0x4d, 0x9a, 0x9c, 0x34, 0xd9, 0x30, 0x44, 0x2b, 0x13, 0x40, 0x44, 0x41, 0x8b, + 0x22, 0x10, 0x36, 0x2d, 0x17, 0x5d, 0x40, 0x42, 0xda, 0x6e, 0xab, 0x55, 0xd1, 0x76, 0x59, 0x4d, + 0xaa, 0xbd, 0xe0, 0x26, 0x9a, 0x38, 0x27, 0xee, 0x08, 0x7b, 0xc6, 0x1a, 0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 0x1d, 0x8a, 0x4c, 0x86, 0xab, 0xd3, 0x70, 0xb7, 0x0a, 0x2e, 0xe0, 0xbc, + 0x49, 0xbf, 0x9f, 0xaf, 0xff, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x7e, 0xe3, 0x0e, 0x60, 0x0c, 0x07, + 0x00, 0x00, } diff --git a/source/go/api/v1/traffic_manage/ratelimit.pb.go b/source/go/api/v1/traffic_manage/ratelimit.pb.go index 8af78ab3..20c63a2f 100644 --- a/source/go/api/v1/traffic_manage/ratelimit.pb.go +++ b/source/go/api/v1/traffic_manage/ratelimit.pb.go @@ -44,7 +44,7 @@ func (x Rule_Resource) String() string { return proto.EnumName(Rule_Resource_name, int32(x)) } func (Rule_Resource) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_ratelimit_75db226431fe691e, []int{1, 0} + return fileDescriptor_ratelimit_6eb2b3b9acb3f338, []int{1, 0} } // 限流类型 @@ -69,7 +69,7 @@ func (x Rule_Type) String() string { return proto.EnumName(Rule_Type_name, int32(x)) } func (Rule_Type) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_ratelimit_75db226431fe691e, []int{1, 1} + return fileDescriptor_ratelimit_6eb2b3b9acb3f338, []int{1, 1} } // 限流阈值模 @@ -93,7 +93,7 @@ func (x Rule_AmountMode) String() string { return proto.EnumName(Rule_AmountMode_name, int32(x)) } func (Rule_AmountMode) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_ratelimit_75db226431fe691e, []int{1, 2} + return fileDescriptor_ratelimit_6eb2b3b9acb3f338, []int{1, 2} } // 与限流集群连接失败时降级模式 @@ -117,7 +117,7 @@ func (x Rule_FailoverType) String() string { return proto.EnumName(Rule_FailoverType_name, int32(x)) } func (Rule_FailoverType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_ratelimit_75db226431fe691e, []int{1, 3} + return fileDescriptor_ratelimit_6eb2b3b9acb3f338, []int{1, 3} } // label type for gateway request @@ -159,7 +159,7 @@ func (x MatchArgument_Type) String() string { return proto.EnumName(MatchArgument_Type_name, int32(x)) } func (MatchArgument_Type) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_ratelimit_75db226431fe691e, []int{2, 0} + return fileDescriptor_ratelimit_6eb2b3b9acb3f338, []int{2, 0} } // 同一服务下限流规则集合 @@ -177,7 +177,7 @@ func (m *RateLimit) Reset() { *m = RateLimit{} } func (m *RateLimit) String() string { return proto.CompactTextString(m) } func (*RateLimit) ProtoMessage() {} func (*RateLimit) Descriptor() ([]byte, []int) { - return fileDescriptor_ratelimit_75db226431fe691e, []int{0} + return fileDescriptor_ratelimit_6eb2b3b9acb3f338, []int{0} } func (m *RateLimit) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_RateLimit.Unmarshal(m, b) @@ -262,17 +262,19 @@ type Rule struct { // 限流规则启用时间 Etime *wrapperspb.StringValue `protobuf:"bytes,25,opt,name=etime,proto3" json:"etime,omitempty"` // 最大排队时长,单位秒 - MaxQueueDelay *wrapperspb.UInt32Value `protobuf:"bytes,26,opt,name=max_queue_delay,proto3" json:"max_queue_delay,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + MaxQueueDelay *wrapperspb.UInt32Value `protobuf:"bytes,26,opt,name=max_queue_delay,proto3" json:"max_queue_delay,omitempty"` + // 限流规则标签数据 + Metadata map[string]string `protobuf:"bytes,50,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *Rule) Reset() { *m = Rule{} } func (m *Rule) String() string { return proto.CompactTextString(m) } func (*Rule) ProtoMessage() {} func (*Rule) Descriptor() ([]byte, []int) { - return fileDescriptor_ratelimit_75db226431fe691e, []int{1} + return fileDescriptor_ratelimit_6eb2b3b9acb3f338, []int{1} } func (m *Rule) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Rule.Unmarshal(m, b) @@ -474,6 +476,13 @@ func (m *Rule) GetMaxQueueDelay() *wrapperspb.UInt32Value { return nil } +func (m *Rule) GetMetadata() map[string]string { + if m != nil { + return m.Metadata + } + return nil +} + type MatchArgument struct { Type MatchArgument_Type `protobuf:"varint,1,opt,name=type,proto3,enum=v1.MatchArgument_Type" json:"type,omitempty"` // header key or query key @@ -489,7 +498,7 @@ func (m *MatchArgument) Reset() { *m = MatchArgument{} } func (m *MatchArgument) String() string { return proto.CompactTextString(m) } func (*MatchArgument) ProtoMessage() {} func (*MatchArgument) Descriptor() ([]byte, []int) { - return fileDescriptor_ratelimit_75db226431fe691e, []int{2} + return fileDescriptor_ratelimit_6eb2b3b9acb3f338, []int{2} } func (m *MatchArgument) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MatchArgument.Unmarshal(m, b) @@ -544,7 +553,7 @@ func (m *RateLimitCluster) Reset() { *m = RateLimitCluster{} } func (m *RateLimitCluster) String() string { return proto.CompactTextString(m) } func (*RateLimitCluster) ProtoMessage() {} func (*RateLimitCluster) Descriptor() ([]byte, []int) { - return fileDescriptor_ratelimit_75db226431fe691e, []int{3} + return fileDescriptor_ratelimit_6eb2b3b9acb3f338, []int{3} } func (m *RateLimitCluster) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_RateLimitCluster.Unmarshal(m, b) @@ -599,7 +608,7 @@ func (m *Amount) Reset() { *m = Amount{} } func (m *Amount) String() string { return proto.CompactTextString(m) } func (*Amount) ProtoMessage() {} func (*Amount) Descriptor() ([]byte, []int) { - return fileDescriptor_ratelimit_75db226431fe691e, []int{4} + return fileDescriptor_ratelimit_6eb2b3b9acb3f338, []int{4} } func (m *Amount) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Amount.Unmarshal(m, b) @@ -669,7 +678,7 @@ func (m *Report) Reset() { *m = Report{} } func (m *Report) String() string { return proto.CompactTextString(m) } func (*Report) ProtoMessage() {} func (*Report) Descriptor() ([]byte, []int) { - return fileDescriptor_ratelimit_75db226431fe691e, []int{5} + return fileDescriptor_ratelimit_6eb2b3b9acb3f338, []int{5} } func (m *Report) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Report.Unmarshal(m, b) @@ -715,7 +724,7 @@ func (m *AmountAdjuster) Reset() { *m = AmountAdjuster{} } func (m *AmountAdjuster) String() string { return proto.CompactTextString(m) } func (*AmountAdjuster) ProtoMessage() {} func (*AmountAdjuster) Descriptor() ([]byte, []int) { - return fileDescriptor_ratelimit_75db226431fe691e, []int{6} + return fileDescriptor_ratelimit_6eb2b3b9acb3f338, []int{6} } func (m *AmountAdjuster) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AmountAdjuster.Unmarshal(m, b) @@ -757,7 +766,7 @@ func (m *ClimbConfig) Reset() { *m = ClimbConfig{} } func (m *ClimbConfig) String() string { return proto.CompactTextString(m) } func (*ClimbConfig) ProtoMessage() {} func (*ClimbConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_ratelimit_75db226431fe691e, []int{7} + return fileDescriptor_ratelimit_6eb2b3b9acb3f338, []int{7} } func (m *ClimbConfig) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ClimbConfig.Unmarshal(m, b) @@ -822,7 +831,7 @@ func (m *ClimbConfig_MetricConfig) Reset() { *m = ClimbConfig_MetricConf func (m *ClimbConfig_MetricConfig) String() string { return proto.CompactTextString(m) } func (*ClimbConfig_MetricConfig) ProtoMessage() {} func (*ClimbConfig_MetricConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_ratelimit_75db226431fe691e, []int{7, 0} + return fileDescriptor_ratelimit_6eb2b3b9acb3f338, []int{7, 0} } func (m *ClimbConfig_MetricConfig) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ClimbConfig_MetricConfig.Unmarshal(m, b) @@ -876,7 +885,7 @@ func (m *ClimbConfig_TriggerPolicy) Reset() { *m = ClimbConfig_TriggerPo func (m *ClimbConfig_TriggerPolicy) String() string { return proto.CompactTextString(m) } func (*ClimbConfig_TriggerPolicy) ProtoMessage() {} func (*ClimbConfig_TriggerPolicy) Descriptor() ([]byte, []int) { - return fileDescriptor_ratelimit_75db226431fe691e, []int{7, 1} + return fileDescriptor_ratelimit_6eb2b3b9acb3f338, []int{7, 1} } func (m *ClimbConfig_TriggerPolicy) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ClimbConfig_TriggerPolicy.Unmarshal(m, b) @@ -925,7 +934,7 @@ func (m *ClimbConfig_TriggerPolicy_ErrorRate) Reset() { *m = ClimbConfig func (m *ClimbConfig_TriggerPolicy_ErrorRate) String() string { return proto.CompactTextString(m) } func (*ClimbConfig_TriggerPolicy_ErrorRate) ProtoMessage() {} func (*ClimbConfig_TriggerPolicy_ErrorRate) Descriptor() ([]byte, []int) { - return fileDescriptor_ratelimit_75db226431fe691e, []int{7, 1, 0} + return fileDescriptor_ratelimit_6eb2b3b9acb3f338, []int{7, 1, 0} } func (m *ClimbConfig_TriggerPolicy_ErrorRate) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ClimbConfig_TriggerPolicy_ErrorRate.Unmarshal(m, b) @@ -991,7 +1000,7 @@ func (m *ClimbConfig_TriggerPolicy_ErrorRate_SpecialConfig) String() string { } func (*ClimbConfig_TriggerPolicy_ErrorRate_SpecialConfig) ProtoMessage() {} func (*ClimbConfig_TriggerPolicy_ErrorRate_SpecialConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_ratelimit_75db226431fe691e, []int{7, 1, 0, 0} + return fileDescriptor_ratelimit_6eb2b3b9acb3f338, []int{7, 1, 0, 0} } func (m *ClimbConfig_TriggerPolicy_ErrorRate_SpecialConfig) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ClimbConfig_TriggerPolicy_ErrorRate_SpecialConfig.Unmarshal(m, b) @@ -1046,7 +1055,7 @@ func (m *ClimbConfig_TriggerPolicy_SlowRate) Reset() { *m = ClimbConfig_ func (m *ClimbConfig_TriggerPolicy_SlowRate) String() string { return proto.CompactTextString(m) } func (*ClimbConfig_TriggerPolicy_SlowRate) ProtoMessage() {} func (*ClimbConfig_TriggerPolicy_SlowRate) Descriptor() ([]byte, []int) { - return fileDescriptor_ratelimit_75db226431fe691e, []int{7, 1, 1} + return fileDescriptor_ratelimit_6eb2b3b9acb3f338, []int{7, 1, 1} } func (m *ClimbConfig_TriggerPolicy_SlowRate) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ClimbConfig_TriggerPolicy_SlowRate.Unmarshal(m, b) @@ -1106,7 +1115,7 @@ func (m *ClimbConfig_ClimbThrottling) Reset() { *m = ClimbConfig_ClimbTh func (m *ClimbConfig_ClimbThrottling) String() string { return proto.CompactTextString(m) } func (*ClimbConfig_ClimbThrottling) ProtoMessage() {} func (*ClimbConfig_ClimbThrottling) Descriptor() ([]byte, []int) { - return fileDescriptor_ratelimit_75db226431fe691e, []int{7, 2} + return fileDescriptor_ratelimit_6eb2b3b9acb3f338, []int{7, 2} } func (m *ClimbConfig_ClimbThrottling) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ClimbConfig_ClimbThrottling.Unmarshal(m, b) @@ -1186,6 +1195,7 @@ func init() { proto.RegisterType((*RateLimit)(nil), "v1.RateLimit") proto.RegisterType((*Rule)(nil), "v1.Rule") proto.RegisterMapType((map[string]*model.MatchString)(nil), "v1.Rule.LabelsEntry") + proto.RegisterMapType((map[string]string)(nil), "v1.Rule.MetadataEntry") proto.RegisterMapType((map[string]*model.MatchString)(nil), "v1.Rule.SubsetEntry") proto.RegisterType((*MatchArgument)(nil), "v1.MatchArgument") proto.RegisterType((*RateLimitCluster)(nil), "v1.RateLimitCluster") @@ -1206,108 +1216,110 @@ func init() { proto.RegisterEnum("v1.MatchArgument_Type", MatchArgument_Type_name, MatchArgument_Type_value) } -func init() { proto.RegisterFile("ratelimit.proto", fileDescriptor_ratelimit_75db226431fe691e) } +func init() { proto.RegisterFile("ratelimit.proto", fileDescriptor_ratelimit_6eb2b3b9acb3f338) } -var fileDescriptor_ratelimit_75db226431fe691e = []byte{ - // 1590 bytes of a gzipped FileDescriptorProto +var fileDescriptor_ratelimit_6eb2b3b9acb3f338 = []byte{ + // 1628 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x58, 0xdd, 0x72, 0xdb, 0xc6, - 0x15, 0x36, 0xf8, 0x27, 0xf2, 0x50, 0xa4, 0xe8, 0x75, 0xec, 0x22, 0x6c, 0x93, 0xba, 0x9c, 0xb4, - 0xf1, 0x74, 0x52, 0xb0, 0x52, 0xec, 0x38, 0x4d, 0x67, 0xea, 0x52, 0x14, 0x5d, 0xab, 0x43, 0x45, - 0xd2, 0x92, 0xf2, 0x34, 0xbd, 0xe1, 0x80, 0xc0, 0x8a, 0xda, 0x04, 0xc0, 0x32, 0x8b, 0x05, 0x65, - 0x5d, 0x77, 0x26, 0xb7, 0x7d, 0x8c, 0xf6, 0x15, 0x7a, 0xd1, 0x99, 0x3e, 0x41, 0xa7, 0x6f, 0xd0, - 0x67, 0xe8, 0x1b, 0x74, 0x76, 0xb1, 0x04, 0x01, 0xea, 0x87, 0xb0, 0x7d, 0x07, 0xed, 0xf9, 0xbe, - 0x73, 0xce, 0x9e, 0xfd, 0xf6, 0x9c, 0x15, 0x61, 0x87, 0xdb, 0x82, 0x78, 0xd4, 0xa7, 0xc2, 0x9a, - 0x73, 0x26, 0x18, 0x2a, 0x2c, 0x76, 0xdb, 0x1f, 0xcf, 0x18, 0x9b, 0x79, 0xa4, 0xab, 0x56, 0xa6, - 0xd1, 0x79, 0xf7, 0x92, 0xdb, 0xf3, 0x39, 0xe1, 0x61, 0x8c, 0xb9, 0x6e, 0x77, 0x23, 0x6e, 0x0b, - 0xca, 0x02, 0x6d, 0xaf, 0xfb, 0xcc, 0x25, 0x5e, 0xfc, 0x47, 0x87, 0x40, 0x0d, 0xdb, 0x82, 0x0c, - 0x65, 0x0c, 0xf4, 0x31, 0x94, 0x79, 0xe4, 0x91, 0xd0, 0x34, 0x1e, 0x17, 0x9f, 0xd4, 0xf7, 0xaa, - 0xd6, 0x62, 0xd7, 0xc2, 0x91, 0x47, 0x70, 0xbc, 0x8c, 0xbe, 0x84, 0x2a, 0x27, 0x0b, 0x1a, 0x52, - 0x16, 0x98, 0x85, 0xc7, 0xc6, 0x93, 0xfa, 0xde, 0x4f, 0xac, 0x38, 0x98, 0xb5, 0x0c, 0x66, 0x8d, - 0x04, 0xa7, 0xc1, 0xec, 0xb5, 0xed, 0x45, 0x04, 0x27, 0xe8, 0xce, 0x0f, 0x0d, 0x28, 0x49, 0x4f, - 0xe8, 0x33, 0x28, 0x50, 0xd7, 0x34, 0x72, 0x90, 0x0b, 0xd4, 0x45, 0x5f, 0xc0, 0x56, 0x48, 0xf8, - 0x82, 0x3a, 0x24, 0x57, 0xbc, 0x25, 0x18, 0x7d, 0x05, 0xb5, 0xc0, 0xf6, 0x49, 0x38, 0xb7, 0x1d, - 0x62, 0x16, 0x73, 0x30, 0x57, 0x70, 0xf4, 0x19, 0x54, 0xc2, 0x68, 0x1a, 0x12, 0x61, 0x96, 0x54, - 0x15, 0x3e, 0x58, 0x56, 0xc1, 0x1a, 0xa9, 0xe5, 0x41, 0x20, 0xf8, 0x15, 0xd6, 0x18, 0x59, 0x92, - 0x39, 0xa7, 0x8c, 0x53, 0x71, 0x65, 0x96, 0x6f, 0x09, 0x74, 0x76, 0x18, 0x88, 0xcf, 0xf7, 0x74, - 0x49, 0x96, 0x68, 0xf4, 0x2b, 0x59, 0xcc, 0x90, 0x45, 0xdc, 0x21, 0x66, 0xe5, 0xb1, 0xf1, 0xa4, - 0xb9, 0x77, 0x3f, 0x89, 0x84, 0xb5, 0x01, 0x27, 0x10, 0xf4, 0x33, 0x28, 0x89, 0xab, 0x39, 0x31, - 0xb7, 0x14, 0xb4, 0x91, 0x40, 0xc7, 0x57, 0x73, 0x82, 0x95, 0x49, 0x66, 0xee, 0xd9, 0x53, 0xe2, - 0x85, 0x66, 0x75, 0x2d, 0xf3, 0xa1, 0x5a, 0xd6, 0x99, 0xc7, 0x18, 0xf4, 0x09, 0x6c, 0xd9, 0x3e, - 0x8b, 0x02, 0x11, 0x9a, 0x35, 0x05, 0x07, 0x09, 0xef, 0xa9, 0x25, 0xbc, 0x34, 0xa1, 0xa7, 0x50, - 0xb1, 0x1d, 0x29, 0x1e, 0x13, 0x72, 0x94, 0x51, 0x63, 0xd1, 0x53, 0xd8, 0x72, 0x69, 0x68, 0x4f, - 0x3d, 0x62, 0xd6, 0x15, 0xad, 0x7d, 0x8d, 0xb6, 0xcf, 0x98, 0xa7, 0x4f, 0x4d, 0x43, 0x51, 0x07, - 0x2a, 0x9c, 0xcc, 0x19, 0x17, 0xe6, 0xb6, 0x22, 0xa9, 0x84, 0xb0, 0x5a, 0xc1, 0xda, 0x82, 0xf6, - 0xa0, 0xec, 0x08, 0xea, 0x13, 0xb3, 0x91, 0x23, 0x9d, 0x18, 0x2a, 0x39, 0xbe, 0xe2, 0x34, 0xf3, - 0x70, 0x14, 0x34, 0x23, 0xf5, 0x9d, 0xb7, 0x91, 0x3a, 0xda, 0x87, 0x86, 0x96, 0xe1, 0x44, 0xb0, - 0xef, 0x48, 0x60, 0xb6, 0x72, 0xd0, 0xb3, 0x14, 0x64, 0x41, 0xd5, 0x76, 0xbf, 0x8d, 0x42, 0x41, - 0xb8, 0x79, 0x5f, 0xd1, 0xd1, 0xea, 0x70, 0x7a, 0xda, 0x82, 0x13, 0x0c, 0xfa, 0x3d, 0x34, 0x38, - 0x99, 0x91, 0x37, 0x13, 0x87, 0xf9, 0x53, 0x1a, 0x10, 0x13, 0x6d, 0xac, 0x7a, 0x96, 0x80, 0x9e, - 0x42, 0x3d, 0x3e, 0xf2, 0x89, 0xec, 0x0e, 0xe6, 0x03, 0xa5, 0xb2, 0x07, 0x89, 0x80, 0xe2, 0xc8, - 0x47, 0xcc, 0x25, 0x18, 0xec, 0xe4, 0x1b, 0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x2e, 0x50, 0x17, 0x7d, 0x0e, 0x9b, 0x21, + 0xe1, 0x73, 0xea, 0x90, 0x5c, 0xf1, 0x16, 0x60, 0xf4, 0x25, 0x54, 0x03, 0xec, 0x93, 0x70, 0x86, + 0x1d, 0x62, 0x16, 0x73, 0x30, 0x97, 0x70, 0xf4, 0x29, 0x94, 0xc3, 0x68, 0x12, 0x12, 0x61, 0x96, + 0x54, 0x15, 0x1e, 0x2e, 0xaa, 0x60, 0x0d, 0xd5, 0x72, 0x3f, 0x10, 0xfc, 0xca, 0xd6, 0x18, 0x59, + 0x92, 0x19, 0xa7, 0x8c, 0x53, 0x71, 0x65, 0x6e, 0xdc, 0x12, 0xe8, 0xec, 0x30, 0x10, 0x9f, 0x75, + 0x74, 0x49, 0x16, 0x68, 0xf4, 0x2b, 0x59, 0xcc, 0x90, 0x45, 0xdc, 0x21, 0x66, 0xf9, 0xb1, 0xf1, + 0x64, 0xbb, 0x73, 0x3f, 0x89, 0x64, 0x6b, 0x83, 0x9d, 0x40, 0xd0, 0xcf, 0xa0, 0x24, 0xae, 0x66, + 0xc4, 0xdc, 0x54, 0xd0, 0x7a, 0x02, 0x1d, 0x5d, 0xcd, 0x88, 0xad, 0x4c, 0x32, 0x73, 0x0f, 0x4f, + 0x88, 0x17, 0x9a, 0x95, 0x95, 0xcc, 0x07, 0x6a, 0x59, 0x67, 0x1e, 0x63, 0xd0, 0xc7, 0xb0, 0x89, + 0x7d, 0x16, 0x05, 0x22, 0x34, 0xab, 0x0a, 0x0e, 0x12, 0xde, 0x55, 0x4b, 0xf6, 0xc2, 0x84, 0x9e, + 0x42, 0x19, 0x3b, 0x52, 0x3c, 0x26, 0xe4, 0x28, 0xa3, 0xc6, 0xa2, 0xa7, 0xb0, 0xe9, 0xd2, 0x10, + 0x4f, 0x3c, 0x62, 0xd6, 0x14, 0xad, 0x79, 0x8d, 0xb6, 0xcf, 0x98, 0xa7, 0x4f, 0x4d, 0x43, 0x51, + 0x0b, 0xca, 0x9c,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f, 0xfe, 0x9a, 0x5c, 0x32, 0x04, 0xd4, 0x83, 0x6d, 0xa1, 0xab, 0xa6, 0x5d, + 0x54, 0xd6, 0xbb, 0x58, 0xa1, 0xec, 0xff, 0xd5, 0x80, 0xe7, 0x0e, 0xf3, 0x2d, 0x41, 0x02, 0x39, + 0x9b, 0xad, 0x19, 0xf3, 0x30, 0xa7, 0xa1, 0xa5, 0xee, 0xfe, 0x39, 0x75, 0xe2, 0x5f, 0x91, 0xf0, + 0x8c, 0xca, 0x1e, 0x22, 0x38, 0x3e, 0x3f, 0xa7, 0x8e, 0xe5, 0xe3, 0x00, 0x4f, 0xc9, 0xfe, 0x76, + 0xf2, 0x26, 0x3c, 0x91, 0x91, 0xfe, 0x74, 0x30, 0xa5, 0xe2, 0x22, 0x9a, 0x58, 0x0e, 0xf3, 0xdb, + 0xda, 0x8f, 0x4f, 0xc2, 0x8b, 0x76, 0xc6, 0x57, 0x3b, 0x7e, 0xc7, 0xb7, 0xa7, 0xac, 0x8d, 0x67, + 0xb4, 0x3d, 0xdf, 0x6b, 0x6b, 0xaf, 0xe3, 0xd8, 0xeb, 0xa4, 0xac, 0xd2, 0xfe, 0xec, 0x87, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x27, 0x39, 0x43, 0x06, 0x09, 0x13, 0x00, 0x00, } diff --git a/source/go/api/v1/traffic_manage/routing.pb.go b/source/go/api/v1/traffic_manage/routing.pb.go index f59f23de..66edaff2 100644 --- a/source/go/api/v1/traffic_manage/routing.pb.go +++ b/source/go/api/v1/traffic_manage/routing.pb.go @@ -43,7 +43,7 @@ func (x RoutingPolicy) String() string { return proto.EnumName(RoutingPolicy_name, int32(x)) } func (RoutingPolicy) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_routing_324655e2b410f0cc, []int{0} + return fileDescriptor_routing_898df1958aeef2db, []int{0} } type MetadataFailover_FailoverRange int32 @@ -72,7 +72,44 @@ func (x MetadataFailover_FailoverRange) String() string { return proto.EnumName(MetadataFailover_FailoverRange_name, int32(x)) } func (MetadataFailover_FailoverRange) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_routing_324655e2b410f0cc, []int{5, 0} + return fileDescriptor_routing_898df1958aeef2db, []int{5, 0} +} + +type NearbyRoutingConfig_LocationLevel int32 + +const ( + // 未知就近级别,等同于未定义级别 + NearbyRoutingConfig_UNKNOWN NearbyRoutingConfig_LocationLevel = 0 + // 机房就近级别 + NearbyRoutingConfig_CAMPUS NearbyRoutingConfig_LocationLevel = 1 + // 可用区就近级别 + NearbyRoutingConfig_ZONE NearbyRoutingConfig_LocationLevel = 2 + // 地域就近级别 + NearbyRoutingConfig_REGION NearbyRoutingConfig_LocationLevel = 3 + // 全局就近级别 + NearbyRoutingConfig_ALL NearbyRoutingConfig_LocationLevel = 4 +) + +var NearbyRoutingConfig_LocationLevel_name = map[int32]string{ + 0: "UNKNOWN", + 1: "CAMPUS", + 2: "ZONE", + 3: "REGION", + 4: "ALL", +} +var NearbyRoutingConfig_LocationLevel_value = map[string]int32{ + "UNKNOWN": 0, + "CAMPUS": 1, + "ZONE": 2, + "REGION": 3, + "ALL": 4, +} + +func (x NearbyRoutingConfig_LocationLevel) String() string { + return proto.EnumName(NearbyRoutingConfig_LocationLevel_name, int32(x)) +} +func (NearbyRoutingConfig_LocationLevel) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_routing_898df1958aeef2db, []int{7, 0} } // label type for gateway request @@ -93,6 +130,8 @@ const ( SourceMatch_PATH SourceMatch_Type = 5 // cookie match http cookie SourceMatch_COOKIE SourceMatch_Type = 6 + // indicate the caller instance metadata + SourceMatch_CALLER_METADATA SourceMatch_Type = 7 ) var SourceMatch_Type_name = map[int32]string{ @@ -103,22 +142,24 @@ var SourceMatch_Type_name = map[int32]string{ 4: "CALLER_IP", 5: "PATH", 6: "COOKIE", + 7: "CALLER_METADATA", } var SourceMatch_Type_value = map[string]int32{ - "CUSTOM": 0, - "METHOD": 1, - "HEADER": 2, - "QUERY": 3, - "CALLER_IP": 4, - "PATH": 5, - "COOKIE": 6, + "CUSTOM": 0, + "METHOD": 1, + "HEADER": 2, + "QUERY": 3, + "CALLER_IP": 4, + "PATH": 5, + "COOKIE": 6, + "CALLER_METADATA": 7, } func (x SourceMatch_Type) String() string { return proto.EnumName(SourceMatch_Type_name, int32(x)) } func (SourceMatch_Type) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_routing_324655e2b410f0cc, []int{11, 0} + return fileDescriptor_routing_898df1958aeef2db, []int{12, 0} } type Routing struct { @@ -143,7 +184,7 @@ func (m *Routing) Reset() { *m = Routing{} } func (m *Routing) String() string { return proto.CompactTextString(m) } func (*Routing) ProtoMessage() {} func (*Routing) Descriptor() ([]byte, []int) { - return fileDescriptor_routing_324655e2b410f0cc, []int{0} + return fileDescriptor_routing_898df1958aeef2db, []int{0} } func (m *Routing) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Routing.Unmarshal(m, b) @@ -244,7 +285,7 @@ func (m *Route) Reset() { *m = Route{} } func (m *Route) String() string { return proto.CompactTextString(m) } func (*Route) ProtoMessage() {} func (*Route) Descriptor() ([]byte, []int) { - return fileDescriptor_routing_324655e2b410f0cc, []int{1} + return fileDescriptor_routing_898df1958aeef2db, []int{1} } func (m *Route) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Route.Unmarshal(m, b) @@ -302,7 +343,7 @@ func (m *Source) Reset() { *m = Source{} } func (m *Source) String() string { return proto.CompactTextString(m) } func (*Source) ProtoMessage() {} func (*Source) Descriptor() ([]byte, []int) { - return fileDescriptor_routing_324655e2b410f0cc, []int{2} + return fileDescriptor_routing_898df1958aeef2db, []int{2} } func (m *Source) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Source.Unmarshal(m, b) @@ -378,7 +419,7 @@ func (m *Destination) Reset() { *m = Destination{} } func (m *Destination) String() string { return proto.CompactTextString(m) } func (*Destination) ProtoMessage() {} func (*Destination) Descriptor() ([]byte, []int) { - return fileDescriptor_routing_324655e2b410f0cc, []int{3} + return fileDescriptor_routing_898df1958aeef2db, []int{3} } func (m *Destination) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Destination.Unmarshal(m, b) @@ -481,7 +522,10 @@ type RouteRule struct { Description string `protobuf:"bytes,12,opt,name=description,proto3" json:"description,omitempty"` // extendInfo 用于承载一些额外信息 // case 1: 升级到 v2 版本时,记录对应到 v1 版本的 id 信息 - ExtendInfo map[string]string `protobuf:"bytes,20,rep,name=extendInfo,proto3" json:"extendInfo,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // deprecated_filed only for compatible to the old version server + ExtendInfo map[string]string `protobuf:"bytes,20,rep,name=extendInfo,proto3" json:"extendInfo,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // 路由规则标签数据 + Metadata map[string]string `protobuf:"bytes,50,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -491,7 +535,7 @@ func (m *RouteRule) Reset() { *m = RouteRule{} } func (m *RouteRule) String() string { return proto.CompactTextString(m) } func (*RouteRule) ProtoMessage() {} func (*RouteRule) Descriptor() ([]byte, []int) { - return fileDescriptor_routing_324655e2b410f0cc, []int{4} + return fileDescriptor_routing_898df1958aeef2db, []int{4} } func (m *RouteRule) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_RouteRule.Unmarshal(m, b) @@ -602,6 +646,13 @@ func (m *RouteRule) GetExtendInfo() map[string]string { return nil } +func (m *RouteRule) GetMetadata() map[string]string { + if m != nil { + return m.Metadata + } + return nil +} + type MetadataFailover struct { // failover_range metadata route bottom type FailoverRange MetadataFailover_FailoverRange `protobuf:"varint,1,opt,name=failover_range,json=failoverRange,proto3,enum=v1.MetadataFailover_FailoverRange" json:"failover_range,omitempty"` @@ -616,7 +667,7 @@ func (m *MetadataFailover) Reset() { *m = MetadataFailover{} } func (m *MetadataFailover) String() string { return proto.CompactTextString(m) } func (*MetadataFailover) ProtoMessage() {} func (*MetadataFailover) Descriptor() ([]byte, []int) { - return fileDescriptor_routing_324655e2b410f0cc, []int{5} + return fileDescriptor_routing_898df1958aeef2db, []int{5} } func (m *MetadataFailover) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MetadataFailover.Unmarshal(m, b) @@ -668,7 +719,7 @@ func (m *MetadataRoutingConfig) Reset() { *m = MetadataRoutingConfig{} } func (m *MetadataRoutingConfig) String() string { return proto.CompactTextString(m) } func (*MetadataRoutingConfig) ProtoMessage() {} func (*MetadataRoutingConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_routing_324655e2b410f0cc, []int{6} + return fileDescriptor_routing_898df1958aeef2db, []int{6} } func (m *MetadataRoutingConfig) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MetadataRoutingConfig.Unmarshal(m, b) @@ -716,14 +767,90 @@ func (m *MetadataRoutingConfig) GetFailover() *MetadataFailover { return nil } +// NearbyRoutingConfig routing configuration +type NearbyRoutingConfig struct { + // 被调服务名,支持*,代表全部服务 + Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` + // 被调命名空间 + Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` + // 默认就近级别 + MatchLevel NearbyRoutingConfig_LocationLevel `protobuf:"varint,3,opt,name=match_level,proto3,enum=v1.NearbyRoutingConfig_LocationLevel" json:"match_level,omitempty"` + // 最大就近级别 + MaxMatchLevel NearbyRoutingConfig_LocationLevel `protobuf:"varint,4,opt,name=max_match_level,proto3,enum=v1.NearbyRoutingConfig_LocationLevel" json:"max_match_level,omitempty"` + // 是否强制就近 + StrictNearby bool `protobuf:"varint,5,opt,name=strict_nearby,proto3" json:"strict_nearby,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *NearbyRoutingConfig) Reset() { *m = NearbyRoutingConfig{} } +func (m *NearbyRoutingConfig) String() string { return proto.CompactTextString(m) } +func (*NearbyRoutingConfig) ProtoMessage() {} +func (*NearbyRoutingConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_routing_898df1958aeef2db, []int{7} +} +func (m *NearbyRoutingConfig) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_NearbyRoutingConfig.Unmarshal(m, b) +} +func (m *NearbyRoutingConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_NearbyRoutingConfig.Marshal(b, m, deterministic) +} +func (dst *NearbyRoutingConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_NearbyRoutingConfig.Merge(dst, src) +} +func (m *NearbyRoutingConfig) XXX_Size() int { + return xxx_messageInfo_NearbyRoutingConfig.Size(m) +} +func (m *NearbyRoutingConfig) XXX_DiscardUnknown() { + xxx_messageInfo_NearbyRoutingConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_NearbyRoutingConfig proto.InternalMessageInfo + +func (m *NearbyRoutingConfig) GetService() string { + if m != nil { + return m.Service + } + return "" +} + +func (m *NearbyRoutingConfig) GetNamespace() string { + if m != nil { + return m.Namespace + } + return "" +} + +func (m *NearbyRoutingConfig) GetMatchLevel() NearbyRoutingConfig_LocationLevel { + if m != nil { + return m.MatchLevel + } + return NearbyRoutingConfig_UNKNOWN +} + +func (m *NearbyRoutingConfig) GetMaxMatchLevel() NearbyRoutingConfig_LocationLevel { + if m != nil { + return m.MaxMatchLevel + } + return NearbyRoutingConfig_UNKNOWN +} + +func (m *NearbyRoutingConfig) GetStrictNearby() bool { + if m != nil { + return m.StrictNearby + } + return false +} + // RuleRoutingConfig routing configuration type RuleRoutingConfig struct { // source source info - // deprecated: only for compatible to the old version server - Sources []*SourceService `protobuf:"bytes,1,rep,name=sources,proto3" json:"sources,omitempty"` + // deprecated_filed only for compatible to the old version server + Sources []*SourceService `protobuf:"bytes,1,rep,name=sources,proto3" json:"sources,omitempty"` // Deprecated: Do not use. // destination destinations info - // deprecated: only for compatible to the old version server - Destinations []*DestinationGroup `protobuf:"bytes,2,rep,name=destinations,proto3" json:"destinations,omitempty"` + // deprecated_filed only for compatible to the old version server + Destinations []*DestinationGroup `protobuf:"bytes,2,rep,name=destinations,proto3" json:"destinations,omitempty"` // Deprecated: Do not use. // rule route chain Rules []*SubRuleRouting `protobuf:"bytes,3,rep,name=rules,proto3" json:"rules,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -735,7 +862,7 @@ func (m *RuleRoutingConfig) Reset() { *m = RuleRoutingConfig{} } func (m *RuleRoutingConfig) String() string { return proto.CompactTextString(m) } func (*RuleRoutingConfig) ProtoMessage() {} func (*RuleRoutingConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_routing_324655e2b410f0cc, []int{7} + return fileDescriptor_routing_898df1958aeef2db, []int{8} } func (m *RuleRoutingConfig) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_RuleRoutingConfig.Unmarshal(m, b) @@ -755,6 +882,7 @@ func (m *RuleRoutingConfig) XXX_DiscardUnknown() { var xxx_messageInfo_RuleRoutingConfig proto.InternalMessageInfo +// Deprecated: Do not use. func (m *RuleRoutingConfig) GetSources() []*SourceService { if m != nil { return m.Sources @@ -762,6 +890,7 @@ func (m *RuleRoutingConfig) GetSources() []*SourceService { return nil } +// Deprecated: Do not use. func (m *RuleRoutingConfig) GetDestinations() []*DestinationGroup { if m != nil { return m.Destinations @@ -793,7 +922,7 @@ func (m *SubRuleRouting) Reset() { *m = SubRuleRouting{} } func (m *SubRuleRouting) String() string { return proto.CompactTextString(m) } func (*SubRuleRouting) ProtoMessage() {} func (*SubRuleRouting) Descriptor() ([]byte, []int) { - return fileDescriptor_routing_324655e2b410f0cc, []int{8} + return fileDescriptor_routing_898df1958aeef2db, []int{9} } func (m *SubRuleRouting) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SubRuleRouting.Unmarshal(m, b) @@ -850,7 +979,7 @@ func (m *SourceService) Reset() { *m = SourceService{} } func (m *SourceService) String() string { return proto.CompactTextString(m) } func (*SourceService) ProtoMessage() {} func (*SourceService) Descriptor() ([]byte, []int) { - return fileDescriptor_routing_324655e2b410f0cc, []int{9} + return fileDescriptor_routing_898df1958aeef2db, []int{10} } func (m *SourceService) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SourceService.Unmarshal(m, b) @@ -926,7 +1055,7 @@ func (m *DestinationGroup) Reset() { *m = DestinationGroup{} } func (m *DestinationGroup) String() string { return proto.CompactTextString(m) } func (*DestinationGroup) ProtoMessage() {} func (*DestinationGroup) Descriptor() ([]byte, []int) { - return fileDescriptor_routing_324655e2b410f0cc, []int{10} + return fileDescriptor_routing_898df1958aeef2db, []int{11} } func (m *DestinationGroup) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DestinationGroup.Unmarshal(m, b) @@ -1018,7 +1147,7 @@ func (m *SourceMatch) Reset() { *m = SourceMatch{} } func (m *SourceMatch) String() string { return proto.CompactTextString(m) } func (*SourceMatch) ProtoMessage() {} func (*SourceMatch) Descriptor() ([]byte, []int) { - return fileDescriptor_routing_324655e2b410f0cc, []int{11} + return fileDescriptor_routing_898df1958aeef2db, []int{12} } func (m *SourceMatch) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SourceMatch.Unmarshal(m, b) @@ -1069,10 +1198,12 @@ func init() { proto.RegisterMapType((map[string]*model.MatchString)(nil), "v1.Destination.MetadataEntry") proto.RegisterType((*RouteRule)(nil), "v1.RouteRule") proto.RegisterMapType((map[string]string)(nil), "v1.RouteRule.ExtendInfoEntry") + proto.RegisterMapType((map[string]string)(nil), "v1.RouteRule.MetadataEntry") proto.RegisterType((*MetadataFailover)(nil), "v1.MetadataFailover") proto.RegisterMapType((map[string]string)(nil), "v1.MetadataFailover.LabelsEntry") proto.RegisterType((*MetadataRoutingConfig)(nil), "v1.MetadataRoutingConfig") proto.RegisterMapType((map[string]string)(nil), "v1.MetadataRoutingConfig.LabelsEntry") + proto.RegisterType((*NearbyRoutingConfig)(nil), "v1.NearbyRoutingConfig") proto.RegisterType((*RuleRoutingConfig)(nil), "v1.RuleRoutingConfig") proto.RegisterType((*SubRuleRouting)(nil), "v1.SubRuleRouting") proto.RegisterType((*SourceService)(nil), "v1.SourceService") @@ -1081,89 +1212,101 @@ func init() { proto.RegisterType((*SourceMatch)(nil), "v1.SourceMatch") proto.RegisterEnum("v1.RoutingPolicy", RoutingPolicy_name, RoutingPolicy_value) proto.RegisterEnum("v1.MetadataFailover_FailoverRange", MetadataFailover_FailoverRange_name, MetadataFailover_FailoverRange_value) + proto.RegisterEnum("v1.NearbyRoutingConfig_LocationLevel", NearbyRoutingConfig_LocationLevel_name, NearbyRoutingConfig_LocationLevel_value) proto.RegisterEnum("v1.SourceMatch_Type", SourceMatch_Type_name, SourceMatch_Type_value) } -func init() { proto.RegisterFile("routing.proto", fileDescriptor_routing_324655e2b410f0cc) } - -var fileDescriptor_routing_324655e2b410f0cc = []byte{ - // 1247 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x56, 0x5f, 0x6f, 0x1b, 0x45, - 0x10, 0xef, 0x9d, 0xff, 0xc4, 0x37, 0xae, 0xdd, 0xeb, 0xca, 0xad, 0xae, 0x56, 0x41, 0x91, 0xa1, - 0x22, 0x02, 0x71, 0x6e, 0x93, 0x08, 0x92, 0x8a, 0x3e, 0x24, 0x8d, 0x21, 0x69, 0x13, 0xa5, 0x5c, - 0x52, 0xa4, 0xf6, 0x25, 0x3a, 0x9f, 0xd7, 0xce, 0xaa, 0xe7, 0xdd, 0xd3, 0xdd, 0xda, 0xc5, 0x6f, - 0x3c, 0x22, 0x21, 0xbe, 0x01, 0x8f, 0x7c, 0x1c, 0xc4, 0x27, 0x40, 0x7c, 0x0e, 0x24, 0x5e, 0xd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, 0x24, 0x22, 0x8c, 0x5a, 0x6b, 0x2b, 0xa8, 0xa5, 0x68, 0xb4, - 0x0f, 0x2d, 0x95, 0xb8, 0x0b, 0xce, 0x5e, 0x60, 0x6a, 0x35, 0x56, 0x50, 0x2f, 0xaa, 0xa0, 0x0f, - 0xa0, 0x16, 0xce, 0x7c, 0x1c, 0x59, 0x37, 0x44, 0x2a, 0x5a, 0x59, 0x2a, 0x66, 0x3e, 0x76, 0xa4, - 0xec, 0x51, 0xb5, 0x61, 0x98, 0x37, 0x7a, 0xbf, 0x69, 0x50, 0x13, 0x22, 0xf4, 0x21, 0xac, 0x45, - 0x6c, 0x16, 0x7a, 0x38, 0xb2, 0x34, 0xa1, 0x06, 0xb1, 0xda, 0x99, 0x38, 0x72, 0x12, 0x11, 0xda, - 0x82, 0xab, 0x23, 0x1c, 0x71, 0x42, 0x5d, 0x4e, 0x18, 0x8d, 0x2c, 0x5d, 0x40, 0xaf, 0xc5, 0xd0, - 0x83, 0xec, 0xdc, 0x29, 0x80, 0xd0, 0x2e, 0x00, 0xfe, 0x96, 0x63, 0x3a, 0x3a, 0xa2, 0x63, 0xa6, - 0xde, 0xf1, 0x56, 0xea, 0x94, 0x3d, 0x48, 0x65, 0x03, 0xca, 0xc3, 0x85, 0x93, 0x03, 0x77, 0x1f, - 0xc0, 0xb5, 0x92, 0x18, 0x99, 0x50, 0x79, 0x81, 0x17, 0xa2, 0x06, 0x0d, 0x27, 0x5e, 0xa2, 0x0e, - 0xd4, 0xe6, 0x71, 0x1e, 0x44, 0x75, 0x19, 0x8e, 0xdc, 0xdc, 0xd7, 0x77, 0xb4, 0xde, 0x77, 0x3a, - 0xd4, 0x65, 0x08, 0xef, 0xa4, 0x7c, 0xb7, 0xa1, 0x31, 0xc5, 0xdc, 0x1d, 0xb9, 0xdc, 0x55, 0x61, - 0x5b, 0x59, 0x52, 0xed, 0x13, 0x25, 0x92, 0x51, 0xa7, 0xc8, 0xee, 0x31, 0xb4, 0x0a, 0xa2,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x07, 0xc4, 0x43, 0x77, 0x3c, 0x26, 0x9e, 0x3d, 0x75, 0xa9, - 0x3b, 0xc1, 0xfb, 0x57, 0x93, 0xeb, 0xe2, 0x29, 0xfc, 0xfc, 0x60, 0x42, 0xf8, 0xe5, 0x6c, 0x68, - 0x7b, 0x6c, 0xda, 0x57, 0x56, 0xa6, 0x38, 0xba, 0xec, 0x17, 0x2c, 0xf5, 0x65, 0xfb, 0xf5, 0x27, - 0xac, 0xef, 0x06, 0xa4, 0x3f, 0xbf, 0xd7, 0x57, 0x36, 0x2f, 0xa4, 0xcd, 0x61, 0x5d, 0x8c, 0xf4, - 0xad, 0xbf, 0x02, 0x00, 0x00, 0xff, 0xff, 0x3e, 0x58, 0xd4, 0x4a, 0xdb, 0x0e, 0x00, 0x00, +func init() { proto.RegisterFile("routing.proto", fileDescriptor_routing_898df1958aeef2db) } + +var fileDescriptor_routing_898df1958aeef2db = []byte{ + // 1418 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x56, 0xcd, 0x6e, 0xdb, 0x46, + 0x10, 0x0e, 0x29, 0x59, 0x12, 0x47, 0x91, 0xcc, 0x6c, 0x94, 0x80, 0x51, 0xd3, 0xc2, 0x50, 0x13, + 0xd4, 0x68, 0x51, 0x2a, 0x91, 0x8d, 0xc6, 0x4e, 0x93, 0x83, 0x1c, 0xab, 0xb6, 0x13, 0xd9, 0x72, + 0x69, 0xb9, 0x45, 0x72, 0x11, 0x28, 0x6a, 0x25, 0x2f, 0x42, 0x91, 0x04, 0x49, 0x29, 0xd1, 0xad, + 0xc7, 0x02, 0x45, 0xdf, 0xa0, 0x8f, 0xd0, 0x67, 0xe9, 0xb1, 0xa7, 0xa2, 0x40, 0x5f, 0xa0, 0x2f, + 0xd0, 0x4b, 0xc1, 0xdd, 0xa5, 0xf8, 0x13, 0x29, 0x51, 0x7e, 0x80, 0xdc, 0x76, 0x67, 0xb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5, 0xb0, 0xc7, 0x75, 0xee, 0x65, + 0x8c, 0xbd, 0x8b, 0x7a, 0xc2, 0x53, 0x9d, 0xf5, 0x64, 0x7d, 0x64, 0xd7, 0x75, 0x87, 0xd4, 0xa7, + 0x77, 0xeb, 0xdc, 0x67, 0x8f, 0xf9, 0xec, 0xe7, 0xe8, 0xf8, 0xb6, 0xf5, 0x7f, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x9b, 0x8d, 0xce, 0xc4, 0xc7, 0x10, 0x00, 0x00, } diff --git a/source/java/polaris-specification-test/pom.xml b/source/java/polaris-specification-test/pom.xml index 4642814e..37e5159e 100644 --- a/source/java/polaris-specification-test/pom.xml +++ b/source/java/polaris-specification-test/pom.xml @@ -14,7 +14,7 @@ - ##VERSION## + 2.0.0.0-SNAPSHOT 8 8 UTF-8 diff --git a/source/java/polaris-specification/pom.xml b/source/java/polaris-specification/pom.xml index 1cc493a7..a1868e2a 100644 --- a/source/java/polaris-specification/pom.xml +++ b/source/java/polaris-specification/pom.xml @@ -6,7 +6,7 @@ com.tencent.polaris polaris-specification - ##VERSION## + 2.0.0.0-SNAPSHOT 1.50.0 diff --git a/source/java/polaris-specification/src/main/proto/auth.proto b/source/java/polaris-specification/src/main/proto/auth.proto new file mode 100644 index 00000000..163f3e09 --- /dev/null +++ b/source/java/polaris-specification/src/main/proto/auth.proto @@ -0,0 +1,197 @@ +syntax = "proto3"; + +package v1; + +import "google/protobuf/wrappers.proto"; + +option go_package = "github.com/polarismesh/specification/source/go/api/v1/security"; +option java_package = "com.tencent.polaris.specification.api.v1.security"; +option java_outer_classname = "SecurityProto"; + +enum AuthAction { + // deprecated_filed 该字段从未使用过 + ONLY_READ = 0; + // deprecated_filed 使用 ALLOW 进行替代 + READ_WRITE = 1; + ALLOW = 10; + DENY = 11; +} + +enum ResourceType { + Namespaces = 0; + Services = 1; + ConfigGroups = 2; + RouteRules = 3; + RateLimitRules = 4; + CircuitBreakerRules = 5; + FaultDetectRules = 6; + LaneRules = 7; + Users = 20; + UserGroups = 21; + Roles = 22; + PolicyRules = 23; +} + +message LoginRequest { + google.protobuf.StringValue owner = 1; + google.protobuf.StringValue name = 2; + google.protobuf.StringValue password = 3; + map options = 4; +} + +message LoginResponse { + google.protobuf.StringValue user_id = 1 [ json_name = "user_id" ]; + google.protobuf.StringValue name = 2; + google.protobuf.StringValue role = 3; + google.protobuf.StringValue owner_id = 4 [ json_name = "owner_id" ]; + google.protobuf.StringValue token = 5; + map options = 6; +} + +message User { + google.protobuf.StringValue id = 1; + google.protobuf.StringValue name = 2; + google.protobuf.StringValue password = 3; + google.protobuf.StringValue owner = 4; + google.protobuf.StringValue source = 5; + google.protobuf.StringValue auth_token = 6 [ json_name = "auth_token" ]; + google.protobuf.BoolValue token_enable = 7 [ json_name = "token_enable" ]; + google.protobuf.StringValue comment = 8; + google.protobuf.StringValue ctime = 9; + google.protobuf.StringValue mtime = 10; + google.protobuf.StringValue user_type = 11 [ json_name = "user_type" ]; + google.protobuf.StringValue mobile = 12; + google.protobuf.StringValue email = 13; + map metadata = 14; +} + +message ModifyUserPassword { + google.protobuf.StringValue id = 1; + google.protobuf.StringValue old_password = 2 [ json_name = "old_password" ]; + google.protobuf.StringValue new_password = 3 [ json_name = "new_password" ]; +} + +message UserGroupRelation { + google.protobuf.StringValue group_id = 1 [ json_name = "group_id" ]; + repeated User users = 2; +} + +message UserGroup { + google.protobuf.StringValue id = 1; + google.protobuf.StringValue name = 2; + google.protobuf.StringValue owner = 3; + google.protobuf.StringValue auth_token = 4 [ json_name = "auth_token" ]; + google.protobuf.BoolValue token_enable = 5 [ json_name = "token_enable" ]; + google.protobuf.StringValue comment = 6; + google.protobuf.StringValue ctime = 7; + google.protobuf.StringValue mtime = 8; + UserGroupRelation relation = 9; + google.protobuf.UInt32Value user_count = 10 [ json_name = "user_count" ]; + google.protobuf.StringValue source = 11; + map metadata = 12; +} + +message ModifyUserGroup { + google.protobuf.StringValue id = 1; + google.protobuf.StringValue owner = 2; + google.protobuf.StringValue name = 3; + google.protobuf.StringValue auth_token = 4 [ json_name = "auth_token" ]; + google.protobuf.BoolValue token_enable = 5 [ json_name = "token_enable" ]; + google.protobuf.StringValue comment = 6; + UserGroupRelation add_relations = 7 [ json_name = "add_relations" ]; + UserGroupRelation remove_relations = 8 [ json_name = "remove_relations" ]; + map metadata = 9; + google.protobuf.StringValue source = 10; +} + +message Role { + string id = 1; + string name = 2; + string owner = 4; + string source = 5; + bool default_role = 6 [ json_name = "default_role" ]; + map metadata = 7; + string comment = 8; + string ctime = 9; + string mtime = 10; + repeated User users = 20; + repeated UserGroup user_groups = 21 [ json_name = "user_groups" ]; +} + +message Principal { + google.protobuf.StringValue id = 1; + google.protobuf.StringValue name = 2; +} + +message Principals { + repeated Principal users = 1; + repeated Principal groups = 2; + repeated Principal roles = 3; +} + +message StrategyResourceEntry { + google.protobuf.StringValue id = 1; + google.protobuf.StringValue namespace = 2; + google.protobuf.StringValue name = 3; +} + +message StrategyResources { + google.protobuf.StringValue strategy_id = 1 [ json_name = "strategy_id" ]; + repeated StrategyResourceEntry namespaces = 2; + repeated StrategyResourceEntry services = 3; + repeated StrategyResourceEntry config_groups = 4 + [ json_name = "config_groups" ]; + repeated StrategyResourceEntry route_rules = 5 [ json_name = "route_rules" ]; + repeated StrategyResourceEntry ratelimit_rules = 6 [ json_name = "ratelimit_rules" ]; + repeated StrategyResourceEntry circuitbreaker_rules = 7 [ json_name = "circuitbreaker_rules" ]; + repeated StrategyResourceEntry faultdetect_rules = 8 [ json_name = "faultdetect_rules" ]; + repeated StrategyResourceEntry lane_rules = 9 [ json_name = "lane_rules" ]; + + repeated StrategyResourceEntry users = 21 [ json_name = "users" ]; + repeated StrategyResourceEntry user_groups = 22 [ json_name = "user_groups" ]; + repeated StrategyResourceEntry roles = 23 [ json_name = "roles" ]; + repeated StrategyResourceEntry auth_policies = 24 [ json_name = "auth_policies" ]; +} + +message StrategyResourceLabel { + string key = 1; + string value = 2; + string compare_type = 3 [ json_name = "compare_type" ]; +} + +message AuthStrategy { + google.protobuf.StringValue id = 1; + google.protobuf.StringValue name = 2; + Principals principals = 3; + StrategyResources resources = 4; + AuthAction action = 5; + google.protobuf.StringValue comment = 6; + google.protobuf.StringValue owner = 7; + google.protobuf.StringValue ctime = 8; + google.protobuf.StringValue mtime = 9; + google.protobuf.StringValue auth_token = 10 [ json_name = "auth_token" ]; + google.protobuf.BoolValue default_strategy = 11 + [ json_name = "default_strategy" ]; + map metadata = 12; + google.protobuf.StringValue source = 13; + repeated string functions = 14; + repeated StrategyResourceLabel resource_labels = 15 + [ json_name = "resource_labels" ]; +} + +message ModifyAuthStrategy { + google.protobuf.StringValue id = 1; + google.protobuf.StringValue name = 2; + Principals add_principals = 3 [ json_name = "add_principals" ]; + Principals remove_principals = 4 [ json_name = "remove_principals" ]; + StrategyResources add_resources = 5 [ json_name = "add_resources" ]; + StrategyResources remove_resources = 6 [ json_name = "remove_resources" ]; + AuthAction action = 7; + google.protobuf.StringValue comment = 8; + google.protobuf.StringValue owner = 9; + map metadata = 12; + google.protobuf.StringValue source = 13; + repeated string functions = 14; + repeated StrategyResourceLabel resource_labels = 15 + [ json_name = "resource_labels" ]; +} diff --git a/source/java/polaris-specification/src/main/proto/circuitbreaker.proto b/source/java/polaris-specification/src/main/proto/circuitbreaker.proto new file mode 100644 index 00000000..a47f2341 --- /dev/null +++ b/source/java/polaris-specification/src/main/proto/circuitbreaker.proto @@ -0,0 +1,356 @@ +syntax = "proto3"; + +package v1; + +import "google/protobuf/wrappers.proto"; +import "google/protobuf/duration.proto"; +import "model.proto"; + +option go_package = "github.com/polarismesh/specification/source/go/api/v1/fault_tolerance"; +option java_package = "com.tencent.polaris.specification.api.v1.fault.tolerance"; +option java_outer_classname = "CircuitBreakerProto"; + +//单个熔断规则定义 +message CircuitBreaker { + // deprecated + google.protobuf.StringValue id = 1; + + // 规则版本 + // deprecated + google.protobuf.StringValue version = 2; + + // 规则名 + // deprecated + google.protobuf.StringValue name = 3; + + // 规则命名空间 + // deprecated + google.protobuf.StringValue namespace = 4; + + // 规则所属服务 + google.protobuf.StringValue service = 5; + google.protobuf.StringValue service_namespace = 6; + + //熔断规则可以分为被调规则和主调规则 + //被调规则针对所有的指定主调生效,假如不指定则对所有的主调生效 + //主调规则为当前主调方的规则,假如不指定则针对所有被调生效 + // deprecated + repeated CbRule inbounds = 7; + // deprecated + repeated CbRule outbounds = 8; + + // deprecated + google.protobuf.StringValue token = 9; + // deprecated + google.protobuf.StringValue owners = 10; + + // 业务 + // deprecated + google.protobuf.StringValue business = 11; + // 部门 + // deprecated + google.protobuf.StringValue department = 12; + + // 规则描述 + // deprecated + google.protobuf.StringValue comment = 13; + // deprecated + google.protobuf.StringValue ctime = 14; + // deprecated + google.protobuf.StringValue mtime = 15; + + google.protobuf.StringValue revision = 16; + + reserved 17 to 20; + // circuitbreaker rules for current service + repeated CircuitBreakerRule rules = 21; +} + +// 主调匹配规则 +message SourceMatcher { + // 主调命名空间以及服务名,可以为*,代表全匹配 + google.protobuf.StringValue service = 1; + google.protobuf.StringValue namespace = 2; + // 可选,主调业务标签,用于匹配是否使用该熔断规则,可放置用户的接口信息等 + map labels = 3; +} + +// 熔断恢复配置 +message RecoverConfig { + // 触发熔断后到半开状态之间的等待间隔 + google.protobuf.Duration sleepWindow = 1; + // 半开后,最多重试多少次恢复 + google.protobuf.UInt32Value maxRetryAfterHalfOpen = 2; + // 半开后放量的最大百分比 + repeated google.protobuf.UInt32Value requestRateAfterHalfOpen = 3; + // 熔断器半开到关闭所必须的最少成功率,默认100% + google.protobuf.UInt32Value successRateToClose = 4; + // 半开后最大放量数(用户不配置最大百分比时默认使用该配置) + google.protobuf.UInt32Value requestCountAfterHalfOpen = 5; + //主动探测配置 + enum OutlierDetectWhen { + //不开启监控探测 + NEVER = 0; + //只有在熔断恢复时才开启健康探测 + ON_RECOVER = 1; + //一直开启健康探测 + ALWAYS = 2; + } + OutlierDetectWhen outlierDetectWhen = 6; +} + +// 熔断策略 +message CbPolicy { + // 错误率熔断配置 + message ErrRateConfig { + //是否启用错误率配置 + google.protobuf.BoolValue enable = 1; + // 触发错误率熔断的最低请求阈值 + google.protobuf.UInt32Value requestVolumeThreshold = 2; + // 可选。触发保持状态的错误率阈值,假如不配置,则默认不会进入Preserved状态 + google.protobuf.UInt32Value errorRateToPreserved = 3; + // 触发熔断的错误率阈值 + google.protobuf.UInt32Value errorRateToOpen = 4; + //错误码相关特定配置 + message SpecialConfig { + // 熔断关心的错误类型,用户可以自己定义 + google.protobuf.StringValue type = 1; + repeated google.protobuf.Int64Value errorCodes = 2; + google.protobuf.UInt32Value errorRateToPreserved = 3; + google.protobuf.UInt32Value errorRateToOpen = 4; + } + repeated SpecialConfig specials = 5; + } + ErrRateConfig errorRate = 1; + // 慢调用率熔断策略配置 + message SlowRateConfig { + // 是否启用慢调用率配置 + google.protobuf.BoolValue enable = 1; + // 最大响应时间,超过该时间属于慢调用请求 + google.protobuf.Duration maxRt = 2; + // 可选。触发保持状态的超时率阈值,假如不配置,则默认不会进入Preserved状态 + google.protobuf.UInt32Value slowRateToPreserved = 3; + // 触发熔断的超时率阈值 + google.protobuf.UInt32Value slowRateToOpen = 4; + } + SlowRateConfig slowRate = 2; + // 熔断的决策周期,多久触发一次熔断决策 + google.protobuf.Duration judgeDuration = 3; + //最大熔断比例,超过多少比例后不会继续熔断 + google.protobuf.UInt32Value maxEjectionPercent = 4; + //连续错误数熔断配置 + message ConsecutiveErrConfig { + // 是否启用连续错误数配置 + google.protobuf.BoolValue enable = 1; + // 连续错误数阈值,进入Preserved状态 + google.protobuf.UInt32Value consecutiveErrorToPreserved = 2; + // 连续错误数阈值,进入Open状态 + google.protobuf.UInt32Value consecutiveErrorToOpen = 3; + } + ConsecutiveErrConfig consecutive = 5; +} + +// 目标set的规则 +message DestinationSet { + // 被调命名空间以及服务名,可以为*,代表全匹配 + google.protobuf.StringValue service = 1; + google.protobuf.StringValue namespace = 2; + // 可选,SUBSET标识 + map metadata = 3; + // 需要进行熔断的资源 + // 支持SUBSET(子集群),以及INSTANCE(单个实例),默认为SUBSET + enum Resource { + // 针对实例分组进行熔断 + SUBSET = 0; + // 针对实例进行熔断 + INSTANCE = 1; + } + Resource resource = 4; + // 熔断决策类型,支持GLOBAL(分布式决策)以及LOCAL(本地决策),默认GLOBAL + // 当指定为GLOBAL时,则会定期上报统计数据并根据汇总数据进行熔断决策 + enum Type { + GLOBAL = 0; + LOCAL = 1; + } + Type type = 5; + + //熔断范围,是否扩散针对相同服务下所有接口进行熔断 + enum Scope { + //触发熔断条件,扩散熔断所有接口 + ALL = 0; + //触发熔断条件,只熔断当前接口 + CURRENT = 1; + } + Scope scope = 6; + + // 熔断数据度量周期 + // 所有的阈值指标按此周期进行统计 + google.protobuf.Duration metricWindow = 7; + + // 熔断数据统计精度,决定数据度量的最小周期 + // 度量滑窗的步长=window/precision + google.protobuf.UInt32Value metricPrecision = 8; + + // 熔断数据上报周期,对分布式熔断有效 + google.protobuf.Duration updateInterval = 9; + + // 触发熔断后恢复配置 + RecoverConfig recover = 10; + + // 熔断策略 + CbPolicy policy = 11; + + // 被调的接口信息,指定哪些接口会使用该规则 + MatchString method = 12; + + // 返回码,指定哪些返回码会使用该规则 + repeated google.protobuf.Int64Value errorCodes = 13; +} + +// 具体熔断规则 +message CbRule { + // 如果匹配Source规则,按照Destination进行熔断 + // 多个Source之间的关系为或 + repeated SourceMatcher sources = 1; + repeated DestinationSet destinations = 2; +} + +message RuleMatcher { + message SourceService { + string service = 1; + string namespace = 2; + } + + message DestinationService { + string service = 1; + string namespace = 2; + // deprecated_filed using api.path in blockConfig instead + MatchString method = 3 [deprecated = true]; + } + SourceService source = 1; + DestinationService destination = 2; +} + +// circuitbreaking level +enum Level { + UNKNOWN = 0; + // service level circuitbreaking + SERVICE = 1; + // method level circuitbreaking + METHOD = 2; + // group level circuitbreaking + GROUP = 3; + // instance level circuitbreaking + INSTANCE = 4; +} + +// new specific rule for circuitbreaker config +message CircuitBreakerRule { + string id = 1; + // rule name + string name = 2; + // namespace of rule + string namespace = 3; + // enable this router + bool enable = 4; + // revision routing version + string revision = 5; + // ctime create time of the rules + string ctime = 6; + // mtime modify time of the rules + string mtime = 7; + // etime enable time of the rules + string etime = 8; + // description simple description rules + string description = 9; + // reserve for metadata + reserved 10 to 20; + // the circuitbreaking level + Level level = 21; + // match condition for this rule + RuleMatcher rule_matcher = 22; + // deprecated_filed error conditions to judge an invocation as an error + repeated ErrorCondition error_conditions = 23 [deprecated = true]; + // deprecated_filed trigger condition to trigger circuitbreaking + repeated TriggerCondition trigger_condition = 24 [deprecated = true]; + // the maximum % of an upstream cluster that can be ejected + uint32 max_ejection_percent = 25; + // recover condition to make resource open to close + RecoverCondition recoverCondition = 26; + // fault detection enable config + FaultDetectConfig faultDetectConfig = 27; + // fall back configuration + FallbackConfig fallbackConfig = 28; + // list for block configuration + repeated BlockConfig block_configs = 29 [ json_name = "block_configs" ]; + // priority rules priority + uint32 priority = 30 [ json_name = "priority" ]; + // 熔断规则标签数据 + map metadata = 50; +} + +// the condition to judge an input invocation as an error +message ErrorCondition { + enum InputType { + UNKNOWN = 0; + RET_CODE = 1; + DELAY = 2; + } + InputType input_type = 1; + MatchString condition = 2; +} + +// the error condition to trigger circuitbreaking +message TriggerCondition { + enum TriggerType { + UNKNOWN = 0; + ERROR_RATE = 1; + CONSECUTIVE_ERROR = 2; + } + TriggerType trigger_type = 1; + uint32 error_count = 2; + uint32 error_percent = 3; + uint32 interval = 4; + uint32 minimum_request = 5; +} + +// circuitbreaking OPEN status recover +message RecoverCondition { + // seconds from open to half-open + uint32 sleep_window = 1; + // consecutive success request to recover + uint32 consecutiveSuccess = 2; +} + +// fault detect config within circuitbreaking +message FaultDetectConfig { + bool enable = 1; +} + +// fallback config +message FallbackConfig { + bool enable = 1; + FallbackResponse response = 2; +} + +// fallback response +message FallbackResponse { + int32 code = 1; + message MessageHeader { + string key = 1; + string value = 2; + } + repeated MessageHeader headers = 2; + string body = 3; +} + +// blocking strategy +message BlockConfig { + string name = 1 [ json_name = "name" ]; + // blocking target api + API api = 2 [ json_name = "api" ]; + // conditions to judge an invocation as an error + repeated ErrorCondition error_conditions = 3 [ json_name = "error_conditions" ]; + // trigger condition to trigger circuitbreaking + repeated TriggerCondition trigger_conditions = 4 [ json_name = "trigger_conditions" ]; +} \ No newline at end of file diff --git a/source/java/polaris-specification/src/main/proto/client.proto b/source/java/polaris-specification/src/main/proto/client.proto new file mode 100644 index 00000000..e52dfcf7 --- /dev/null +++ b/source/java/polaris-specification/src/main/proto/client.proto @@ -0,0 +1,45 @@ +syntax = "proto3"; + +package v1; + +import "google/protobuf/wrappers.proto"; +import "model.proto"; + +option go_package = "github.com/polarismesh/specification/source/go/api/v1/service_manage"; +option java_package = "com.tencent.polaris.specification.api.v1.service.manage"; +option java_outer_classname = "ClientProto"; + +message Client { + google.protobuf.StringValue host = 1; + + enum ClientType { + UNKNOWN = 0; + SDK = 1; + AGENT = 2; + } + + ClientType type = 2; + + google.protobuf.StringValue version = 3; + + Location location = 4; + + google.protobuf.StringValue id = 5; + + repeated StatInfo stat = 6; + + google.protobuf.StringValue ctime = 7; + google.protobuf.StringValue mtime = 8; +} + +message StatInfo { + + google.protobuf.StringValue target = 1; + + google.protobuf.UInt32Value port = 2; + + google.protobuf.StringValue path = 3; + + google.protobuf.StringValue protocol = 4; + +} \ No newline at end of file diff --git a/source/java/polaris-specification/src/main/proto/code.proto b/source/java/polaris-specification/src/main/proto/code.proto new file mode 100644 index 00000000..baad235d --- /dev/null +++ b/source/java/polaris-specification/src/main/proto/code.proto @@ -0,0 +1,194 @@ +syntax = "proto3"; + +package v1; + +option go_package = "github.com/polarismesh/specification/source/go/api/v1/model"; + +option java_package = "com.tencent.polaris.specification.api.v1.model"; +option java_outer_classname = "CodeProto"; + +enum Code { + // base module status codes + Unknown = 0; + ExecuteSuccess = 200000; + DataNoChange = 200001; + NoNeedUpdate = 200002; + BadRequest = 400000; + ParseException = 400001; + EmptyRequest = 400002; + BatchSizeOverLimit = 400003; + InvalidDiscoverResource = 400004; + InvalidRequestID = 400100; + InvalidUserName = 400101; + InvalidUserToken = 400102; + InvalidParameter = 400103; + EmptyQueryParameter = 400104; + InvalidQueryInsParameter = 400105; + InvalidNamespaceName = 400110; + InvalidNamespaceOwners = 400111; + InvalidNamespaceToken = 400112; + InvalidServiceName = 400120; + InvalidServiceOwners = 400121; + InvalidServiceToken = 400122; + InvalidServiceMetadata = 400123; + InvalidServicePorts = 400124; + InvalidServiceBusiness = 400125; + InvalidServiceDepartment = 400126; + InvalidServiceCMDB = 400127; + InvalidServiceComment = 400128; + InvalidServiceAliasComment = 400129; + InvalidInstanceID = 400130; + InvalidInstanceHost = 400131; + InvalidInstancePort = 400132; + InvalidServiceAlias = 400133; + InvalidNamespaceWithAlias = 400134; + InvalidServiceAliasOwners = 400135; + InvalidInstanceProtocol = 400136; + InvalidInstanceVersion = 400137; + InvalidInstanceLogicSet = 400138; + InvalidInstanceIsolate = 400139; + HealthCheckNotOpen = 400140; + HeartbeatOnDisabledIns = 400141; + HeartbeatExceedLimit = 400142; + HeartbeatTypeNotFound = 400143; + InvalidMetadata = 400150; + InvalidRateLimitID = 400151; + InvalidRateLimitLabels = 400152; + InvalidRateLimitAmounts = 400153; + InvalidRateLimitName = 400154; + InvalidCircuitBreakerID = 400160; + InvalidCircuitBreakerVersion = 400161; + InvalidCircuitBreakerName = 400162; + InvalidCircuitBreakerNamespace = 400163; + InvalidCircuitBreakerOwners = 400164; + InvalidCircuitBreakerToken = 400165; + InvalidCircuitBreakerBusiness = 400166; + InvalidCircuitBreakerDepartment = 400167; + InvalidCircuitBreakerComment = 400168; + CircuitBreakerRuleExisted = 400169; + InvalidRoutingID = 400700; + InvalidRoutingPolicy = 400701; + InvalidRoutingName = 400702; + InvalidRoutingPriority = 400703; + InvalidFaultDetectID = 400900; + InvalidFaultDetectName = 400901; + InvalidFaultDetectNamespace = 400902; + FaultDetectRuleExisted = 400903; + InvalidMatchRule = 400904; + + // network relative codes + ServicesExistedMesh = 400170; + ResourcesExistedMesh = 400171; + InvalidMeshParameter = 400172; + + // platform relative codes + InvalidPlatformID = 400180; + InvalidPlatformName = 400181; + InvalidPlatformDomain = 400182; + InvalidPlatformQPS = 400183; + InvalidPlatformToken = 400184; + InvalidPlatformOwner = 400185; + InvalidPlatformDepartment = 400186; + InvalidPlatformComment = 400187; + NotFoundPlatform = 400188; + + // flux relative codes + InvalidFluxRateLimitId = 400190; + InvalidFluxRateLimitQps = 400191; + InvalidFluxRateLimitSetKey = 400192; + + ExistedResource = 400201; + NotFoundResource = 400202; + NamespaceExistedServices = 400203; + ServiceExistedInstances = 400204; + ServiceExistedRoutings = 400205; + ServiceExistedRateLimits = 400206; + ExistReleasedConfig = 400207; + SameInstanceRequest = 400208; + ServiceExistedCircuitBreakers = 400209; + ServiceExistedAlias = 400210; + NamespaceExistedMeshResources = 400211; + NamespaceExistedCircuitBreakers = 400212; + ServiceSubscribedByMeshes = 400213; + ServiceExistedFluxRateLimits = 400214; + NamespaceExistedConfigGroups = 400219; + + NotFoundService = 400301; + NotFoundRouting = 400302; + NotFoundInstance = 400303; + NotFoundServiceAlias = 400304; + NotFoundNamespace = 400305; + NotFoundSourceService = 400306; + NotFoundRateLimit = 400307; + NotFoundCircuitBreaker = 400308; + NotFoundMasterConfig = 400309; + NotFoundTagConfig = 400310; + NotFoundTagConfigOrService = 400311; + ClientAPINotOpen = 400401; + NotAllowBusinessService = 400402; + NotAllowAliasUpdate = 400501; + NotAllowAliasCreateInstance = 400502; + NotAllowAliasCreateRouting = 400503; + NotAllowCreateAliasForAlias = 400504; + NotAllowAliasCreateRateLimit = 400505; + NotAllowAliasBindRule = 400506; + NotAllowDifferentNamespaceBindRule = 400507; + Unauthorized = 401000; + NotAllowedAccess = 401001; + CMDBNotFindHost = 404001; + DataConflict = 409000; + InstanceTooManyRequests = 429001; + IPRateLimit = 429002; + APIRateLimit = 403003; + ExecuteException = 500000; + StoreLayerException = 500001; + CMDBPluginException = 500002; + ParseRoutingException = 500004; + ParseRateLimitException = 500005; + ParseCircuitBreakerException = 500006; + HeartbeatException = 500007; + InstanceRegisTimeout = 500008; + + // config center status codes + InvalidConfigFileGroupName = 400801; + InvalidConfigFileName = 400802; + InvalidConfigFileContentLength = 400803; + InvalidConfigFileFormat = 400804; + InvalidConfigFileTags = 400805; + InvalidWatchConfigFileFormat = 400806; + NotFoundResourceConfigFile = 400807; + InvalidConfigFileTemplateName = 400808; + EncryptConfigFileException = 400809; + DecryptConfigFileException = 400810; + + // auth codes + InvalidUserOwners = 400410; + InvalidUserID = 400411; + InvalidUserPassword = 400412; + InvalidUserMobile = 400413; + InvalidUserEmail = 400414; + InvalidUserGroupOwners = 400420; + InvalidUserGroupID = 400421; + InvalidAuthStrategyOwners = 400430; + InvalidAuthStrategyName = 400431; + InvalidAuthStrategyID = 400432; + InvalidPrincipalType = 400440; + + UserExisted = 400215; + UserGroupExisted = 400216; + AuthStrategyRuleExisted = 400217; + SubAccountExisted = 400218; + NotFoundUser = 400312; + NotFoundOwnerUser = 400313; + NotFoundUserGroup = 400314; + NotFoundAuthStrategyRule = 400315; + NotAllowModifyDefaultStrategyPrincipal = 400508; + NotAllowModifyOwnerDefaultStrategy = 400509;; + + EmptyAutToken = 401002; + TokenDisabled = 401003; + TokenNotExisted = 401004; + + AuthTokenForbidden = 403001; + OperationRoleForbidden = 403002; +} diff --git a/source/java/polaris-specification/src/main/proto/config_file.proto b/source/java/polaris-specification/src/main/proto/config_file.proto new file mode 100644 index 00000000..80e2b8aa --- /dev/null +++ b/source/java/polaris-specification/src/main/proto/config_file.proto @@ -0,0 +1,213 @@ +syntax = "proto3"; + +package v1; + +import "google/protobuf/wrappers.proto"; +import "model.proto"; +option go_package = "github.com/polarismesh/specification/source/go/api/v1/config_manage"; +option java_package = "com.tencent.polaris.specification.api.v1.config.manage"; +option java_outer_classname = "ConfigFileProto"; + +message ConfigFileGroup { + google.protobuf.UInt64Value id = 1; + google.protobuf.StringValue name = 2; + google.protobuf.StringValue namespace = 3; + google.protobuf.StringValue comment = 4; + google.protobuf.StringValue create_time = 5; + google.protobuf.StringValue create_by = 6; + google.protobuf.StringValue modify_time = 7; + google.protobuf.StringValue modify_by = 8; + google.protobuf.UInt64Value fileCount = 9; + + repeated google.protobuf.StringValue user_ids = 10 [ json_name = "user_ids" ]; + repeated google.protobuf.StringValue group_ids = 11 + [ json_name = "group_ids" ]; + + repeated google.protobuf.StringValue remove_user_ids = 13 + [ json_name = "remove_user_ids" ]; + repeated google.protobuf.StringValue remove_group_ids = 14 + [ json_name = "remove_group_ids" ]; + + google.protobuf.BoolValue editable = 15; + google.protobuf.StringValue owner = 16; + + google.protobuf.StringValue business = 17; + google.protobuf.StringValue department = 18; + map metadata = 19; +} + +message ConfigFile { + google.protobuf.UInt64Value id = 1; + google.protobuf.StringValue name = 2; + google.protobuf.StringValue namespace = 3; + google.protobuf.StringValue group = 4; + google.protobuf.StringValue content = 5; + google.protobuf.StringValue format = 6; + google.protobuf.StringValue comment = 7; + google.protobuf.StringValue status = 8; + repeated ConfigFileTag tags = 9; + google.protobuf.StringValue create_time = 10; + google.protobuf.StringValue create_by = 11; + google.protobuf.StringValue modify_time = 12; + google.protobuf.StringValue modify_by = 13; + google.protobuf.StringValue release_time = 14; + google.protobuf.StringValue release_by = 15; + // 是否为加密配置文件 + google.protobuf.BoolValue encrypted = 16; + // 加密算法 + google.protobuf.StringValue encrypt_algo = 17; +} + +message ConfigFileTag { + google.protobuf.StringValue key = 1; + google.protobuf.StringValue value = 2; +} + +message ConfigFileRelease { + google.protobuf.UInt64Value id = 1; + google.protobuf.StringValue name = 2; + google.protobuf.StringValue namespace = 3; + google.protobuf.StringValue group = 4; + google.protobuf.StringValue file_name = 5; + google.protobuf.StringValue content = 6; + google.protobuf.StringValue comment = 7; + google.protobuf.StringValue md5 = 8; + google.protobuf.UInt64Value version = 9; + google.protobuf.StringValue create_time = 10; + google.protobuf.StringValue create_by = 11; + google.protobuf.StringValue modify_time = 12; + google.protobuf.StringValue modify_by = 13; + repeated ConfigFileTag tags = 14; + // 当前生效配置 + google.protobuf.BoolValue active = 15; + google.protobuf.StringValue format = 16; + google.protobuf.StringValue release_description = 17; + google.protobuf.StringValue release_type = 18; + // 配置灰度发布时需要匹配的客户端标签信息 + repeated ClientLabel beta_labels = 19; +} + +message ConfigFileReleaseHistory { + google.protobuf.UInt64Value id = 1; + google.protobuf.StringValue name = 2; + google.protobuf.StringValue namespace = 3; + google.protobuf.StringValue group = 4; + google.protobuf.StringValue file_name = 5; + google.protobuf.StringValue content = 6; + google.protobuf.StringValue format = 7; + google.protobuf.StringValue comment = 8; + google.protobuf.StringValue md5 = 9; + google.protobuf.StringValue type = 10; + google.protobuf.StringValue status = 11; + repeated ConfigFileTag tags = 12; + google.protobuf.StringValue create_time = 13; + google.protobuf.StringValue create_by = 14; + google.protobuf.StringValue modify_time = 15; + google.protobuf.StringValue modify_by = 16; + // 配置发布失败的原因 + google.protobuf.StringValue reason = 17; + google.protobuf.StringValue release_description = 18; +} + +message ConfigFileTemplate { + google.protobuf.UInt64Value id = 1; + google.protobuf.StringValue name = 2; + google.protobuf.StringValue content = 3; + google.protobuf.StringValue format = 4; + google.protobuf.StringValue comment = 5; + google.protobuf.StringValue create_time = 6; + google.protobuf.StringValue create_by = 7; + google.protobuf.StringValue modify_time = 8; + google.protobuf.StringValue modify_by = 9; +} + +message ClientConfigFileInfo { + google.protobuf.StringValue namespace = 1; + google.protobuf.StringValue group = 2; + google.protobuf.StringValue file_name = 3; + google.protobuf.StringValue content = 4; + google.protobuf.UInt64Value version = 5; + google.protobuf.StringValue md5 = 6; + repeated ConfigFileTag tags = 7; + // 是否为加密配置文件 + google.protobuf.BoolValue encrypted = 8; + // 公钥,用于加密数据密钥 + google.protobuf.StringValue public_key = 9; + // 配置文件版本名称 + google.protobuf.StringValue name = 10; + // 配置文件的发布时间 + google.protobuf.StringValue release_time = 11 [ json_name = "release_time" ]; +} + +message ClientWatchConfigFileRequest { + google.protobuf.StringValue client_ip = 1; + google.protobuf.StringValue service_name = 2; + repeated ClientConfigFileInfo watch_files = 3; +} + +message ConfigFileExportRequest { + google.protobuf.StringValue namespace = 1; + repeated google.protobuf.StringValue groups = 2; + repeated google.protobuf.StringValue names = 3; +} + +message ConfigFilePublishInfo { + google.protobuf.StringValue release_name = 1 [ json_name = "release_name" ]; + google.protobuf.StringValue namespace = 2; + google.protobuf.StringValue group = 3; + google.protobuf.StringValue file_name = 4 [ json_name = "file_name" ]; + google.protobuf.StringValue content = 5; + google.protobuf.StringValue comment = 6; + google.protobuf.StringValue format = 7; + google.protobuf.StringValue release_description = 8 + [ json_name = "release_description" ]; + google.protobuf.StringValue create_by = 11 [ json_name = "create_by" ]; + google.protobuf.StringValue modify_by = 13 [ json_name = "modify_by" ]; + repeated ConfigFileTag tags = 14; + google.protobuf.StringValue md5 = 15; + // 是否为加密配置文件 + google.protobuf.BoolValue encrypted = 16; + // 加密算法 + google.protobuf.StringValue encrypt_algo = 17; +} + +message ConfigFileGroupRequest { + google.protobuf.StringValue revision = 1; + ConfigFileGroup config_file_group = 2 [ json_name = "config_file_group" ]; + // 配置标签 + map client_labels = 12 [ json_name = "client_labels" ]; +} + +message ConfigDiscoverRequest { + enum ConfigDiscoverRequestType { + UNKNOWN = 0; + CONFIG_FILE = 1; + CONFIG_FILE_Names = 2; + CONFIG_FILE_GROUPS = 3; + } + ConfigDiscoverRequestType type = 1; + ClientConfigFileInfo config_file = 2 [ json_name = "config_file" ]; + string revision = 3; +} + +message ConfigDiscoverResponse { + enum ConfigDiscoverResponseType { + UNKNOWN = 0; + CONFIG_FILE = 1; + CONFIG_FILE_Names = 2; + CONFIG_FILE_GROUPS = 3; + } + + uint32 code = 1; + string info = 2; + string revision = 3; + + ConfigDiscoverResponseType type = 4; + + ClientConfigFileInfo config_file = 5 [ json_name = "config_file" ]; + + repeated ClientConfigFileInfo config_file_names = 6 + [ json_name = "config_file_names" ]; + repeated ConfigFileGroup config_file_groups = 7 + [ json_name = "config_file_groups" ]; +} diff --git a/source/java/polaris-specification/src/main/proto/config_file_response.proto b/source/java/polaris-specification/src/main/proto/config_file_response.proto new file mode 100644 index 00000000..29108bdd --- /dev/null +++ b/source/java/polaris-specification/src/main/proto/config_file_response.proto @@ -0,0 +1,82 @@ +syntax = "proto3"; + +package v1; + +import "google/protobuf/wrappers.proto"; +import "config_file.proto"; + +option go_package = "github.com/polarismesh/specification/source/go/api/v1/config_manage"; +option java_package = "com.tencent.polaris.specification.api.v1.config.manage"; +option java_outer_classname = "ConfigFileResponseProto"; + +message ConfigSimpleResponse { + google.protobuf.UInt32Value code = 1; + google.protobuf.StringValue info = 2; +} + +message ConfigResponse { + google.protobuf.UInt32Value code = 1; + google.protobuf.StringValue info = 2; + + ConfigFileGroup configFileGroup = 3; + ConfigFile configFile = 4; + ConfigFileRelease configFileRelease = 5; + ConfigFileReleaseHistory configFileReleaseHistory = 6; + ConfigFileTemplate configFileTemplate = 7; +} + +message ConfigBatchWriteResponse { + google.protobuf.UInt32Value code = 1; + google.protobuf.StringValue info = 2; + google.protobuf.UInt32Value total = 3; + + repeated ConfigResponse responses = 4; +} + +message ConfigBatchQueryResponse { + google.protobuf.UInt32Value code = 1; + google.protobuf.StringValue info = 2; + google.protobuf.UInt32Value total = 3; + repeated ConfigFileGroup configFileGroups = 4; + repeated ConfigFile configFiles = 5; + repeated ConfigFileRelease configFileReleases = 6; + repeated ConfigFileReleaseHistory configFileReleaseHistories = 7; + repeated ConfigFileTemplate configFileTemplates = 8; +} + +message ConfigClientResponse { + google.protobuf.UInt32Value code = 1; + google.protobuf.StringValue info = 2; + + ClientConfigFileInfo configFile = 3; +} + +message ConfigImportResponse { + google.protobuf.UInt32Value code = 1; + google.protobuf.StringValue info = 2; + repeated ConfigFile createConfigFiles = 3; + repeated ConfigFile skipConfigFiles = 4; + repeated ConfigFile overwriteConfigFiles = 5; +} + +message ConfigExportResponse { + google.protobuf.UInt32Value code = 1; + google.protobuf.StringValue info = 2; + google.protobuf.BytesValue data = 3; +} + +message ConfigEncryptAlgorithmResponse { + google.protobuf.UInt32Value code = 1; + google.protobuf.StringValue info = 2; + repeated google.protobuf.StringValue algorithms = 3; +} + +message ConfigClientListResponse { + google.protobuf.UInt32Value code = 1; + google.protobuf.StringValue info = 2; + google.protobuf.StringValue revision = 3; + + string namespace = 4; + string group = 5; + repeated ClientConfigFileInfo config_file_infos = 6 [json_name = "config_file_infos"]; +} \ No newline at end of file diff --git a/source/java/polaris-specification/src/main/proto/configrelease.proto b/source/java/polaris-specification/src/main/proto/configrelease.proto new file mode 100644 index 00000000..f0676255 --- /dev/null +++ b/source/java/polaris-specification/src/main/proto/configrelease.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; + +package v1; + +import "google/protobuf/wrappers.proto"; +import "service.proto"; +import "circuitbreaker.proto"; + +option go_package = "github.com/polarismesh/specification/source/go/api/v1/service_manage"; +option java_package = "com.tencent.polaris.specification.api.v1.service.manage"; +option java_outer_classname = "ConfigReleaseProto"; + +message ConfigRelease { + Service service = 1; + google.protobuf.StringValue ctime = 2; + google.protobuf.StringValue mtime = 3; + + CircuitBreaker circuitBreaker = 4; +} + +message ConfigWithService { + repeated Service services = 1; + CircuitBreaker circuitBreaker = 2; +} \ No newline at end of file diff --git a/source/java/polaris-specification/src/main/proto/contract.proto b/source/java/polaris-specification/src/main/proto/contract.proto new file mode 100644 index 00000000..c69f6ada --- /dev/null +++ b/source/java/polaris-specification/src/main/proto/contract.proto @@ -0,0 +1,75 @@ +syntax = "proto3"; + +package v1; + +option go_package = "github.com/polarismesh/specification/source/go/api/v1/service_manage"; +option java_package = "com.tencent.polaris.specification.api.v1.service.manage"; +option java_outer_classname = "ServiceContractProto"; + +message ServiceContract { + // 契约ID + string id = 1; + // 契约名称 + // deprecated, use type field + string name = 2; + // 所属命名空间 + string namespace = 3; + // 所属服务名称 + string service = 4; + // 协议,http/grpc/dubbo/thrift + string protocol = 5; + // 契约版本 + string version = 6; + // 信息摘要 + string revision = 7; + // 额外描述 + string content = 8; + // 接口描述信息 + repeated InterfaceDescriptor interfaces = 9; + // 创建时间 + string ctime = 10; + // 更新时间 + string mtime = 11; + // 接口状态,Offline/Online + string status = 12; + // 类型 + string type = 14; +} + +message InterfaceDescriptor { + enum Source { + UNKNOWN = 0; + Manual = 1; + Client = 2; + } + + // 接口ID + string id = 1; + // 方法名称,对应 http method/ dubbo interface func/grpc service func + string method = 2; + // 接口名称,http path/dubbo interface/grpc service + string path = 3; + // 接口描述信息 + string content = 4; + // 创建来源 + Source source = 5; + // 接口信息摘要 + string revision = 6; + // 创建时间 + string ctime = 7; + // 更新时间 + string mtime = 8; + // 接口名称描述信息 + // deprecated, use type field + string name = 9; + // 所属命名空间 + string namespace = 10; + // 所属服务名称 + string service = 11; + // 协议,http/grpc/dubbo/thrift + string protocol = 12; + // 契约版本 + string version = 13; + // 类型 + string type = 14; +} diff --git a/source/java/polaris-specification/src/main/proto/fault_detector.proto b/source/java/polaris-specification/src/main/proto/fault_detector.proto new file mode 100644 index 00000000..217669be --- /dev/null +++ b/source/java/polaris-specification/src/main/proto/fault_detector.proto @@ -0,0 +1,90 @@ +syntax = "proto3"; + +package v1; + +import "model.proto"; + +option go_package = "github.com/polarismesh/specification/source/go/api/v1/fault_tolerance"; +option java_package = "com.tencent.polaris.specification.api.v1.fault.tolerance"; +option java_outer_classname = "FaultDetectorProto"; + +message FaultDetector { + // fault detect rules for current service + repeated FaultDetectRule rules = 1; + // total revision for the fault detect rules + string revision = 2; +} + +message FaultDetectRule { + string id = 1; + // rule name + string name = 2; + // namespace of rule + string namespace = 3; + // revision routing version + string revision = 4; + // ctime create time of the rules + string ctime = 5; + // mtime modify time of the rules + string mtime = 6; + // description simple description rules + string description = 7; + + // reserve for metadata + reserved 8 to 20; + + message DestinationService { + string service = 1; + string namespace = 2; + // deprecated_filed use api.path instead + MatchString method = 3 [deprecated = true]; + API api = 4; + } + // detect target + DestinationService target_service = 21; + // detect interval + uint32 interval = 22; + // detect timeout + uint32 timeout = 23; + // detect port + uint32 port = 24; + // detect protocol + enum Protocol { + UNKNOWN = 0; + HTTP = 1; + TCP = 2; + UDP = 3; + } + Protocol protocol = 25; + // http detect config + HttpProtocolConfig http_config = 26; + // tcp detect config + TcpProtocolConfig tcp_config = 27; + // udp detect config + UdpProtocolConfig udp_config = 28; + // priority rules priority + uint32 priority = 29 [ json_name = "priority" ]; + // 探测规则标签数据 + map metadata = 50; +} + +message HttpProtocolConfig { + string method = 1; + string url = 2; + message MessageHeader { + string key = 1; + string value = 2; + } + repeated MessageHeader headers = 3; + string body = 4; +} + +message TcpProtocolConfig { + string send = 1; + repeated string receive = 2; +} + +message UdpProtocolConfig { + string send = 1; + repeated string receive = 2; +} diff --git a/source/java/polaris-specification/src/main/proto/grpc_config_api.proto b/source/java/polaris-specification/src/main/proto/grpc_config_api.proto new file mode 100644 index 00000000..c6103609 --- /dev/null +++ b/source/java/polaris-specification/src/main/proto/grpc_config_api.proto @@ -0,0 +1,37 @@ +syntax = "proto3"; + +package v1; + +import "config_file.proto"; +import "config_file_response.proto"; + +option go_package = "github.com/polarismesh/specification/source/go/api/v1/config_manage"; +option java_package = "com.tencent.polaris.specification.api.v1.config.manage"; +option java_outer_classname = "PolarisConfigGRPCService"; + +service PolarisConfigGRPC { + + // 拉取配置 + rpc GetConfigFile(ClientConfigFileInfo) returns (ConfigClientResponse) {} + + // 创建配置 + rpc CreateConfigFile(ConfigFile) returns (ConfigClientResponse) {} + + // 更新配置 + rpc UpdateConfigFile(ConfigFile) returns (ConfigClientResponse) {} + + // 发布配置 + rpc PublishConfigFile(ConfigFileRelease) returns (ConfigClientResponse) {} + + // 发布配置 + rpc UpsertAndPublishConfigFile(ConfigFilePublishInfo) returns (ConfigClientResponse) {} + + // 订阅配置变更 + rpc WatchConfigFiles(ClientWatchConfigFileRequest) returns (ConfigClientResponse) {} + + // 拉取指定配置分组下的配置文件列表 + rpc GetConfigFileMetadataList(ConfigFileGroupRequest) returns (ConfigClientListResponse) {} + + // 统一发现接口 + rpc Discover(stream ConfigDiscoverRequest) returns (stream ConfigDiscoverResponse) {} +} diff --git a/source/java/polaris-specification/src/main/proto/grpcapi.proto b/source/java/polaris-specification/src/main/proto/grpcapi.proto new file mode 100644 index 00000000..4a1e2cbf --- /dev/null +++ b/source/java/polaris-specification/src/main/proto/grpcapi.proto @@ -0,0 +1,44 @@ +syntax = "proto3"; + +package v1; + +import "client.proto"; +import "service.proto"; +import "request.proto"; +import "response.proto"; +import "heartbeat.proto"; +import "contract.proto"; + +option go_package = "github.com/polarismesh/specification/source/go/api/v1/service_manage"; +option java_package = "com.tencent.polaris.specification.api.v1.service.manage"; +option java_outer_classname = "PolarisGRPCService"; + +service PolarisGRPC { + // 客户端上报 + rpc ReportClient(Client) returns (Response) {} + // 被调方注册服务实例 + rpc RegisterInstance(Instance) returns (Response) {} + // 被调方反注册服务实例 + rpc DeregisterInstance(Instance) returns (Response) {} + // 统一发现接口 + rpc Discover(stream DiscoverRequest) returns (stream DiscoverResponse) {} + // 被调方上报心跳 + rpc Heartbeat(Instance) returns (Response) {} +} + +service PolarisHeartbeatGRPC { + // 被调方批量上报心跳 + rpc BatchHeartbeat(stream HeartbeatsRequest) + returns (stream HeartbeatsResponse) {} + // 批量获取心跳记录 + rpc BatchGetHeartbeat(GetHeartbeatsRequest) returns (GetHeartbeatsResponse) {} + // 批量删除心跳记录 + rpc BatchDelHeartbeat(DelHeartbeatsRequest) returns (DelHeartbeatsResponse) {} +} + +service PolarisServiceContractGRPC { + // 上报服务契约 + rpc ReportServiceContract(ServiceContract) returns (Response) {} + // 查询服务契约 + rpc GetServiceContract(ServiceContract) returns (Response) {} +} diff --git a/source/java/polaris-specification/src/main/proto/grpcapi_ratelimiter.proto b/source/java/polaris-specification/src/main/proto/grpcapi_ratelimiter.proto new file mode 100644 index 00000000..b1194ea2 --- /dev/null +++ b/source/java/polaris-specification/src/main/proto/grpcapi_ratelimiter.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; + +package polaris.metric.v2; + +option go_package = "github.com/polarismesh/specification/source/go/api/v1/traffic_manage/ratelimiter"; +option java_package = "com.tencent.polaris.specification.api.v1.traffic.manage.ratelimiter"; +option java_outer_classname = "RateLimiterService"; + +import "ratelimiter.proto"; + +service RateLimitGRPCV2 { + // 限流接口 + rpc Service(stream RateLimitRequest) returns(stream RateLimitResponse) {} + + //时间对齐接口 + rpc TimeAdjust(TimeAdjustRequest) returns(TimeAdjustResponse) {} +} \ No newline at end of file diff --git a/source/java/polaris-specification/src/main/proto/heartbeat.proto b/source/java/polaris-specification/src/main/proto/heartbeat.proto new file mode 100644 index 00000000..2751d6b9 --- /dev/null +++ b/source/java/polaris-specification/src/main/proto/heartbeat.proto @@ -0,0 +1,47 @@ +syntax = "proto3"; + +package v1; + +import "service.proto"; + +option go_package = "github.com/polarismesh/specification/source/go/api/v1/service_manage"; +option java_package = "com.tencent.polaris.specification.api.v1.service.manage"; + +message HeartbeatRecord { + string instanceId = 1 [ json_name = "instance_id" ]; + reserved 2 to 5; + int64 lastHeartbeatSec = 6 [ json_name = "last_heartbeat_sec" ]; + bool exist = 7 [ json_name = "exist" ]; +} + +message InstanceHeartbeat { + string instanceId = 1 [ json_name = "instance_id" ]; + string service = 2 [ json_name = "service" ]; + string namespace = 3 [ json_name = "namespace" ]; + string host = 4 [ json_name = "host" ]; + uint32 port = 5 [ json_name = "port" ]; +} + +message HeartbeatsRequest { + repeated InstanceHeartbeat heartbeats = 1 [ json_name = "heartbeats" ]; +} + +message HeartbeatsResponse { +} + +message GetHeartbeatsRequest { + repeated string instanceIds = 1 [ json_name = "instance_ids" ]; +} + +message GetHeartbeatsResponse { + repeated HeartbeatRecord records = 1 [ json_name = "records" ]; +} + +message DelHeartbeatsRequest { + repeated string instanceIds = 1 [ json_name = "instance_ids" ]; +} + +message DelHeartbeatsResponse { + uint32 code = 1; + string info = 2; +} diff --git a/source/java/polaris-specification/src/main/proto/lane.proto b/source/java/polaris-specification/src/main/proto/lane.proto new file mode 100644 index 00000000..9eb00f25 --- /dev/null +++ b/source/java/polaris-specification/src/main/proto/lane.proto @@ -0,0 +1,108 @@ +syntax = "proto3"; + +package v1; + +import "google/protobuf/any.proto"; +import "model.proto"; +import "routing.proto"; + +option go_package = "github.com/polarismesh/specification/source/go/api/v1/traffic_manage"; +option java_package = "com.tencent.polaris.specification.api.v1.traffic.manage"; +option java_outer_classname = "LaneProto"; + +// 流量入口 +message TrafficEntry { + // 标记流量入口类型 + // type == "polarismesh.cn/gateway/spring-cloud-gateway", 则 selector 为 + // ServiceGatewaySelector type == "polarismesh.cn/service, 则 selector 为 + // ServiceSelector + string type = 1; + google.protobuf.Any selector = 2; +} + +// 微服务网关入口定义 +message ServiceGatewaySelector { + string namespace = 1; + string service = 2; + // 决定要不要部份 + map labels = 3; +} + +// 普通服务入口定义 +message ServiceSelector { + string namespace = 1; + string service = 2; + // 决定要不要部份 + map labels = 3; +} + +// 泳道组实体定义 +message LaneGroup { + // 泳道组 ID + string id = 1; + // 泳道组名称 + string name = 2; + // 泳道组内的流量入口信息 + repeated TrafficEntry entries = 3; + // 在泳道组内的服务列表信息 + repeated DestinationGroup destinations = 4; + // 泳道组描述信息 + string revision = 7; + // 泳道组描述信息 + string description = 8; + // 泳道组的创建时间 + string ctime = 9; + // 泳道组的更新时间 + string mtime = 10; + // 泳道组内的流量入口信息 + repeated LaneRule rules = 11; + // 泳道组标签信息 + map metadata = 20; +} + +// TrafficMatchRule 流量匹配规则 +message TrafficMatchRule { + // 流量匹配规则,判断哪些流量需要进入泳道 + repeated SourceMatch arguments = 4; + // 多个 SourceMatch 之间的判断关系 + enum TrafficMatchMode { + // 与模式 + AND = 0; + // 或模式 + OR = 1; + } + TrafficMatchMode matchMode = 14; +} + +// 泳道规则 +message LaneRule { + string id = 1; + string name = 2; + // 所属泳道组的名称 + string group_name = 3; + // 流量匹配规则 + TrafficMatchRule traffic_match_rule = 4; + // 保存这个泳道的默认实例标签 + string default_label_value = 5; + // 泳道规则是否启用 + bool enable = 6; + enum LaneMatchMode { + // 严格匹配模式 + STRICT = 0; + // 宽松匹配模式 + PERMISSIVE = 1; + } + LaneMatchMode match_mode = 7; + // revision routing version + string revision = 8; + // ctime create time of the rules + string ctime = 9; + // mtime modify time of the rules + string mtime = 10; + // etime enable time of the rules + string etime = 11; + // priority rules priority + uint32 priority = 12; + // description simple description rules + string description = 13; +} \ No newline at end of file diff --git a/source/java/polaris-specification/src/main/proto/model.proto b/source/java/polaris-specification/src/main/proto/model.proto new file mode 100644 index 00000000..b24d8547 --- /dev/null +++ b/source/java/polaris-specification/src/main/proto/model.proto @@ -0,0 +1,71 @@ +syntax = "proto3"; + +package v1; + +import "google/protobuf/wrappers.proto"; + +option go_package = "github.com/polarismesh/specification/source/go/api/v1/model"; + +option java_package = "com.tencent.polaris.specification.api.v1.model"; +option java_outer_classname = "ModelProto"; + +message Location { + google.protobuf.StringValue region = 1; + google.protobuf.StringValue zone = 2; + google.protobuf.StringValue campus = 3; +} + +message MatchString { + enum MatchStringType { + // Equivalent match + EXACT = 0; + // Regular match + REGEX = 1; + // Not equals match + NOT_EQUALS = 2; + // Include match + IN = 3; + // Not include match + NOT_IN = 4; + // Range match + RANGE = 5; + } + + enum ValueType { + TEXT = 0; + PARAMETER = 1; + VARIABLE = 2; + } + + MatchStringType type = 1; + google.protobuf.StringValue value = 2; + ValueType value_type = 3 [ json_name = "value_type" ]; +} + +message StringList { repeated string values = 1; } + +// 汇总查询数据 +message Summary { + // 服务总数 + uint32 total_service_count = 1 [ json_name = "total_service_count" ]; + // 健康实例总数 + uint32 total_health_instance_count = 2 + [ json_name = "total_health_instance_count" ]; + // 实例总数 + uint32 total_instance_count = 3 [ json_name = "total_instance_count" ]; +} + +message ClientLabel { + string key = 1; + MatchString value = 2; +} + +// API统一数据结构 +message API { + // API的协议,*或者为空代表全部 + string protocol = 1 [ json_name = "protocol" ]; + // API的方法,*或者为空代表全部 + string method = 2 [ json_name = "method" ]; + // API的路径,支持多种匹配方式 + MatchString path = 3 [ json_name = "path" ]; +} \ No newline at end of file diff --git a/source/java/polaris-specification/src/main/proto/namespace.proto b/source/java/polaris-specification/src/main/proto/namespace.proto new file mode 100644 index 00000000..a23850d8 --- /dev/null +++ b/source/java/polaris-specification/src/main/proto/namespace.proto @@ -0,0 +1,35 @@ +syntax = "proto3"; + +package v1; + +import "google/protobuf/wrappers.proto"; + +option go_package = "github.com/polarismesh/specification/source/go/api/v1/model"; + +option java_package = "com.tencent.polaris.specification.api.v1.model"; +option java_outer_classname = "NamespaceProto"; + +message Namespace { + google.protobuf.StringValue name = 1; + google.protobuf.StringValue comment = 2; + google.protobuf.StringValue owners = 3; + google.protobuf.StringValue token = 4; + google.protobuf.StringValue ctime = 5; + google.protobuf.StringValue mtime = 6; + + google.protobuf.UInt32Value total_service_count = 7 [json_name = "total_service_count"]; + google.protobuf.UInt32Value total_health_instance_count = 8 [json_name = "total_health_instance_count"]; + google.protobuf.UInt32Value total_instance_count = 9 [json_name = "total_instance_count"]; + + repeated google.protobuf.StringValue user_ids = 10 [json_name = "user_ids"]; + repeated google.protobuf.StringValue group_ids = 11 [json_name = "group_ids"]; + + repeated google.protobuf.StringValue remove_user_ids = 13 [json_name = "remove_user_ids"]; + repeated google.protobuf.StringValue remove_group_ids = 14 [json_name = "remove_group_ids"]; + + google.protobuf.StringValue id = 12; + + google.protobuf.BoolValue editable = 15; + + repeated google.protobuf.StringValue service_export_to = 16 [ json_name = "service_export_to" ]; +} \ No newline at end of file diff --git a/source/java/polaris-specification/src/main/proto/ratelimit.proto b/source/java/polaris-specification/src/main/proto/ratelimit.proto new file mode 100644 index 00000000..a12d17f5 --- /dev/null +++ b/source/java/polaris-specification/src/main/proto/ratelimit.proto @@ -0,0 +1,216 @@ +syntax = "proto3"; + +package v1; + +import "google/protobuf/wrappers.proto"; +import "google/protobuf/duration.proto"; +import "model.proto"; + +option go_package = "github.com/polarismesh/specification/source/go/api/v1/traffic_manage"; +option java_package = "com.tencent.polaris.specification.api.v1.traffic.manage"; +option java_outer_classname = "RateLimitProto"; + +// 同一服务下限流规则集合 +message RateLimit { + // 限流规则集合 + repeated Rule rules = 1; + // 限流规则汇总的revision信息 + google.protobuf.StringValue revision = 2; +} + +// 单个限流规则信息 +message Rule { + // 限流规则唯一标识 + google.protobuf.StringValue id = 1; + // 限流规则所属服务名 + google.protobuf.StringValue service = 2; + // 限流规则所属命名空间 + google.protobuf.StringValue namespace = 3; + // 可选,SUBSET标识 + map subset = 4; + // 限流规则优先级,0值最高 + google.protobuf.UInt32Value priority = 5; + // 限流资源 + enum Resource { + // 针对QPS进行限流 + QPS = 0; + // 针对并发数进行限流 + CONCURRENCY = 1; + } + Resource resource = 6; + // 限流类型 + // global全局限流(默认)或者local单机限流 + enum Type { + GLOBAL = 0; + LOCAL = 1; + } + Type type = 7; + // 业务标签集合,通过KV进行匹配,全部匹配才使用该规则 + map labels = 8; + // 限流阈值 + // 可以有多个粒度的配置(比如同时针对秒级,分钟级,天级),匹配一个则进行限流 + // 全局限流模式下,该值为服务配额总量;单机限流模式下,该值为单个节点能处理的配额量 + repeated Amount amounts = 9; + // 限流动作,对应着客户端的插件名字 + google.protobuf.StringValue action = 10; + // 是否停用该限流规则,默认启用 + google.protobuf.BoolValue disable = 11; + // 限流上报方式,同时支持按固定周期上报,以及达到配额百分比后上报 + Report report = 12; + // 限流规则创建时间 + google.protobuf.StringValue ctime = 13; + // 限流规则修改时间 + google.protobuf.StringValue mtime = 14; + // 限流规则revision信息 + google.protobuf.StringValue revision = 15; + // 服务的TOKEN信息,仅用于控制台,discover接口不下发 + google.protobuf.StringValue service_token = 16 [json_name = "service_token"]; + // 配额调整算法 + AmountAdjuster adjuster = 17; + // 通配符是否合并计算,默认分开计数 + google.protobuf.BoolValue regex_combine = 18 [json_name = "regex_combine"]; + + // 限流阈值模 + enum AmountMode { + GLOBAL_TOTAL = 0; // 总体阈值 + SHARE_EQUALLY = 1; // 单机均摊阈值 + } + AmountMode amount_mode = 19; + // 与限流集群连接失败时降级模式 + enum FailoverType { + FAILOVER_LOCAL = 0; // 降级成本地阈值 + FAILOVER_PASS = 1; // 降级成直接通过 + } + FailoverType failover = 20; + // 分布式限流服务集群 + RateLimitCluster cluster = 21; + // 被调接口名 + MatchString method = 22; + // 被调的参数过滤条件,满足过滤条件才进入限流规则 + repeated MatchArgument arguments = 23; + // 限流规则名 + google.protobuf.StringValue name = 24; + // 限流规则启用时间 + google.protobuf.StringValue etime = 25; + // 最大排队时长,单位秒 + google.protobuf.UInt32Value max_queue_delay = 26 [json_name = "max_queue_delay"]; + // 限流规则标签数据 + map metadata = 50; +} + +message MatchArgument { + // label type for gateway request + enum Type { + // custom arguments + CUSTOM = 0; + // method, match the http post/get/put/delete or grpc method + METHOD = 1; + // header, match the http header, dubbo attachment, grpc header + HEADER = 2; + // query, match the http query, dubbo argument + QUERY = 3; + // caller service + CALLER_SERVICE = 4; + // caller host ip + CALLER_IP =5; + } + Type type = 1; + // header key or query key + string key = 2; + // header value or query value + MatchString value = 3; +} + +// 分布式限流服务集群 +message RateLimitCluster { + google.protobuf.StringValue service = 1; + // 限流规则所属命名空间 + google.protobuf.StringValue namespace = 2; +} + +// 限流配额 +message Amount { + // 时间周期内的最大配额数 + google.protobuf.UInt32Value maxAmount = 1; + // 配额生效的时间周期,必须大于等于1s + google.protobuf.Duration validDuration = 2; + // 请求统计精度 + google.protobuf.UInt32Value precision = 3; + // 可选,起始限流阈值,爬坡起始值 + google.protobuf.UInt32Value startAmount = 4; + // 可选,最小限流阈值,降低时最小值 + google.protobuf.UInt32Value minAmount = 5; +} + +// 限流上报方式 +message Report { + // 配额固定上报周期,单位毫秒 + google.protobuf.Duration interval = 1; + // 使用了百分之多少配额后启动一次实时上报,值范围(0,100] + google.protobuf.UInt32Value amountPercent = 2; +} + +// 配额调整算法 +message AmountAdjuster { + ClimbConfig climb = 1; +} + +// 限流调整算法Climb相关配置 +message ClimbConfig { + google.protobuf.BoolValue enable = 1; // 是否开启 + + // 限流数据统计配置 + message MetricConfig { + // 限流数据度量周期,默认60s + google.protobuf.Duration window = 1; + // 数据统计精度,决定数据度量的最小周期,度量滑窗的步长=window/precision + google.protobuf.UInt32Value precision = 2; + // 上报周期,默认20s + google.protobuf.Duration reportInterval = 3; + } + MetricConfig metric = 2; // 限流数据统计配置 + + // 触发调整的策略 + message TriggerPolicy { + // 错误率触发调整配置 + message ErrorRate { + google.protobuf.BoolValue enable = 1; // 是否开启 + google.protobuf.UInt32Value requestVolumeThreshold = 2; // 触发限流调整的最小的请求数 + google.protobuf.Int32Value errorRate = 3; // 触发限流的错误率配置 + + // 特殊错误码触发调整配置 + message SpecialConfig { + google.protobuf.StringValue type = 1; // 自定义错误类型 + repeated google.protobuf.Int64Value errorCodes = 2; // 特定规则针对的错误码 + google.protobuf.Int32Value errorRate = 3; //特定规则错误率 + } + repeated SpecialConfig specials = 4; // 针对部分错误码,使用额外的错误率统计,可设置多组特殊规则 + } + + // 慢调用触发调整配置 + message SlowRate { + google.protobuf.BoolValue enable = 1; // 是否开启 + google.protobuf.Duration maxRt = 2; // 最大响应时间,超过该响应时间属于慢调用 + google.protobuf.Int32Value slowRate = 3; // 慢请求率阈值,达到该阈值进行限流 + } + + ErrorRate errorRate = 1; // 按错误率阈值调整 + SlowRate slowRate = 2; // 慢调用进行触发调整 + } + + TriggerPolicy policy = 3; // 触发调整策略 + + // 爬坡调整相关参数 + message ClimbThrottling { + google.protobuf.Int32Value coldBelowTuneDownRate = 1; // 冷水位以下区间的下调百分比 + google.protobuf.Int32Value coldBelowTuneUpRate = 2; // 冷水位以下区间的上调百分比 + google.protobuf.Int32Value coldAboveTuneDownRate = 3; // 冷水位以上区间的下调百分比 + google.protobuf.Int32Value coldAboveTuneUpRate = 4; // 冷水位以上区间的上调百分比 + google.protobuf.Int32Value limitThresholdToTuneUp = 5; // 冷水位以上,超过该百分的请求被限流后进行阈值上调 + google.protobuf.Duration judgeDuration = 6; // 阈值调整规则的决策间隔 + google.protobuf.Int32Value tuneUpPeriod = 7; // 阈值上调周期数,连续N个决策间隔都为上调,才执行上调 + google.protobuf.Int32Value tuneDownPeriod = 8; // 阈值下调周期数,连续N个决策间隔都为下调,才执行下调 + } + + ClimbThrottling throttling = 4; // 限流调整相关参数 +} \ No newline at end of file diff --git a/source/java/polaris-specification/src/main/proto/ratelimiter.proto b/source/java/polaris-specification/src/main/proto/ratelimiter.proto new file mode 100644 index 00000000..e43c66c7 --- /dev/null +++ b/source/java/polaris-specification/src/main/proto/ratelimiter.proto @@ -0,0 +1,211 @@ +syntax = "proto3"; + +package polaris.metric.v2; + +option go_package = "github.com/polarismesh/specification/source/go/api/v1/traffic_manage/ratelimiter"; +option java_package = "com.tencent.polaris.specification.api.v1.traffic.manage.ratelimiter"; +option java_outer_classname = "RateLimiterProto"; + +//命令字 +enum RateLimitCmd { + INIT = 0; + ACQUIRE = 1; + BATCH_INIT = 2; + BATCH_ACQUIRE = 3; +} + +//限流请求 +message RateLimitRequest { + //命令字 + RateLimitCmd cmd = 1; + //初始化请求 + RateLimitInitRequest rateLimitInitRequest = 2; + //上报请求 + RateLimitReportRequest rateLimitReportRequest = 3; + //批量初始化请求 + RateLimitBatchInitRequest rateLimitBatchInitRequest = 4; +} + +//限流应答 +message RateLimitResponse { + //命令字 + RateLimitCmd cmd = 1; + //初始化应答 + RateLimitInitResponse rateLimitInitResponse = 2; + //上报应答 + RateLimitReportResponse rateLimitReportResponse = 3; + //批量初始化应答 + RateLimitBatchInitResponse rateLimitBatchInitResponse = 4; +} + +//限频模式 +enum Mode { + //自适应模式,根据历史流量自动调整 + ADAPTIVE = 0; + //批量抢占模式,客户端进行拉取,Server返回全量剩余配额 + BATCH_OCCUPY = 1; + //批量分摊模式,客户端进行拉取,Server按比例进行分摊 + BATCH_SHARE = 2; +} + +//初始化请求 +message RateLimitInitRequest { + //限流目标对象数据 + LimitTarget target = 1; + //客户端唯一标识 + string clientId = 2; + //限流规则信息 + repeated QuotaTotal totals = 3; + //客户端可指定滑窗数,不指定用默认值 + uint32 slideCount = 4; + //限流模式 + Mode mode = 5; +} + +//初始化应答 +message RateLimitInitResponse { + //应答错误码 + uint32 code = 1; + //限流目标对象,回传给客户端 + LimitTarget target = 2; + //客户端的标识,与clientId对应,一个server全局唯一,上报时候带入 + uint32 clientKey = 3; + //计数器的标识 + repeated QuotaCounter counters = 5; + //实际滑窗个数 + uint32 slideCount = 6; + //限流server绝对时间,单位ms + int64 timestamp = 7; +} + +//批量初始化请求 +message RateLimitBatchInitRequest { + //每条规则汇总成一个Init请求 + repeated RateLimitInitRequest request = 1; + //客户端唯一标识 + string clientId = 2; +} + +message LabeledQuotaCounter { + //自定义标签 + string labels = 1; + //计数器的标识 + repeated QuotaCounter counters = 2; +} + +message BatchInitResult { + //应答错误码 + uint32 code = 1; + //限流目标对象,回传给客户端,labels为规则 + LimitTarget target = 2; + //计数器的标识 + repeated LabeledQuotaCounter counters = 3; + //实际滑窗个数 + uint32 slideCount = 4; +} + +//批量初始化应答 +message RateLimitBatchInitResponse { + //应答错误码 + uint32 code = 1; + //客户端的标识,与clientId对应,一个server全局唯一,上报时候带入 + uint32 clientKey = 2; + //限流server绝对时间,单位ms + int64 timestamp = 3; + //批量初始化结果 + repeated BatchInitResult result = 4; +} + +//限流上报请求 +message RateLimitReportRequest { + //客户端标识 + uint32 clientKey = 1; + //已使用的配额数 + repeated QuotaSum quotaUses = 2; + //配额发生的时间,单位ms + int64 timestamp = 3; +} + +//限流上报应答 +message RateLimitReportResponse { + uint32 code = 1; + //剩余配额数 + repeated QuotaLeft quotaLefts = 2; + //限流server绝对时间,单位ms + int64 timestamp = 3; +} + +//限流目标,针对哪部分数据进行限流 +message LimitTarget { + //命名空间 + string namespace = 1; + //服务名 + string service = 2; + //自定义标签 + string labels = 3; + //批量自定义标签 + repeated string labels_list = 4; +} + +//阈值模式 +enum QuotaMode { + //整体阈值 + WHOLE = 0; + //单机均分阈值 + DIVIDE = 1; +} + +//阈值配置的值 +message QuotaTotal { + //阈值模式 + QuotaMode mode = 1; + //单位秒 + uint32 duration = 2; + //限流阈值 + uint32 maxAmount = 3; +} + +//限流计数器 +message QuotaCounter { + //单位秒 + uint32 duration = 1; + // bucket的标识,上报时候带入 + uint32 counterKey = 2; + //剩余配额数,应答返回,允许为负数 + int64 left = 3; + //实际限流模式 + Mode mode = 4; + //接入的客户端数量 + uint32 clientCount = 5; +} + +//客户端阈值使用统计 +message QuotaSum { + //计数器的标识,一个server全局唯一,上报时候带入 + uint32 counterKey = 1; + //已使用的配额数,上报时候带入 + uint32 used = 2; + //被限流数,上报时候带入 + uint32 limited = 3; +} + +//客户端阈值使用统计,由服务端返回 +message QuotaLeft { + //计数器的标识,一个server全局唯一,上报时候带入 + uint32 counterKey = 1; + //剩余配额数,应答返回,允许为负数 + int64 left = 2; + //当前限流模式 + Mode mode = 3; + //接入的客户端数量 + uint32 clientCount = 4; +} + +//时间点对齐的请求 +message TimeAdjustRequest {} + +//时间点对齐的应答 +message TimeAdjustResponse { + //服务器时间点,毫秒 + int64 serverTimestamp = 1; +} diff --git a/source/java/polaris-specification/src/main/proto/request.proto b/source/java/polaris-specification/src/main/proto/request.proto new file mode 100644 index 00000000..49f98b43 --- /dev/null +++ b/source/java/polaris-specification/src/main/proto/request.proto @@ -0,0 +1,41 @@ +syntax = "proto3"; + +package v1; + +import "service.proto"; +import "contract.proto"; + +option go_package = "github.com/polarismesh/specification/source/go/api/v1/service_manage"; +option java_package = "com.tencent.polaris.specification.api.v1.service.manage"; +option java_outer_classname = "RequestProto"; + +message DiscoverFilter { + bool OnlyHealthyInstance = 1; +} + +message DiscoverRequest { + enum DiscoverRequestType { + UNKNOWN = 0; + INSTANCE = 1; + CLUSTER = 2; + ROUTING = 3; + RATE_LIMIT = 4; + CIRCUIT_BREAKER = 5; + SERVICES = 6; + reserved 7 to 11; + NAMESPACES = 12; + FAULT_DETECTOR = 13; + reserved 14 to 99; + LANE = 100; + // 自定义路由规则 + CUSTOM_ROUTE_RULE = 101; + // 就近路由规则 + NEARBY_ROUTE_RULE = 102; + } + + DiscoverRequestType type = 1; + Service service = 2; + reserved 3 to 4; + DiscoverFilter Filter = 30; +} + diff --git a/source/java/polaris-specification/src/main/proto/response.proto b/source/java/polaris-specification/src/main/proto/response.proto new file mode 100644 index 00000000..d04f56e6 --- /dev/null +++ b/source/java/polaris-specification/src/main/proto/response.proto @@ -0,0 +1,126 @@ +syntax = "proto3"; + +package v1; + +import "google/protobuf/wrappers.proto"; +import "google/protobuf/any.proto"; +import "namespace.proto"; +import "service.proto"; +import "routing.proto"; +import "ratelimit.proto"; +import "circuitbreaker.proto"; +import "model.proto"; +import "client.proto"; +import "configrelease.proto"; +import "fault_detector.proto"; +import "auth.proto"; +import "contract.proto"; +import "lane.proto"; + +option go_package = "github.com/polarismesh/specification/source/go/api/v1/service_manage"; +option java_package = "com.tencent.polaris.specification.api.v1.service.manage"; +option java_outer_classname = "ResponseProto"; + +message Response { + google.protobuf.UInt32Value code = 1; + google.protobuf.StringValue info = 2; + Client client = 3; + Namespace namespace = 4; + Service service = 5; + Instance instance = 6; + Routing routing = 7; + ServiceAlias alias = 8; + Rule rateLimit = 9; + CircuitBreaker circuitBreaker = 10; + ConfigRelease configRelease = 11; + reserved 12 to 18; + User user = 19; + UserGroup userGroup = 20; + AuthStrategy authStrategy = 21; + UserGroupRelation relation = 22; + LoginResponse loginResponse = 23; + ModifyAuthStrategy modifyAuthStrategy = 24; + ModifyUserGroup modifyUserGroup = 25; + StrategyResources resources = 26; + OptionSwitch optionSwitch = 27; + InstanceLabels instanceLabels = 28; + + google.protobuf.Any data = 29; + + ServiceContract serviceContract = 30; +} + +message BatchWriteResponse { + google.protobuf.UInt32Value code = 1; + google.protobuf.StringValue info = 2; + google.protobuf.UInt32Value size = 3; + repeated Response responses = 4; +} + +message BatchQueryResponse { + google.protobuf.UInt32Value code = 1; + google.protobuf.StringValue info = 2; + google.protobuf.UInt32Value amount = 3; + google.protobuf.UInt32Value size = 4; + repeated Namespace namespaces = 5; + repeated Service services = 6; + repeated Instance instances = 7; + repeated Routing routings = 8; + repeated ServiceAlias aliases = 9; + repeated Rule rateLimits = 10; + repeated ConfigWithService configWithServices = 11; + reserved 12 to 17; + repeated User users = 18; + repeated UserGroup userGroups = 19; + repeated AuthStrategy authStrategies = 20; + repeated Client clients = 21; + + repeated google.protobuf.Any data = 22; + Summary summary = 23; +} + +message DiscoverResponse { + google.protobuf.UInt32Value code = 1; + google.protobuf.StringValue info = 2; + + enum DiscoverResponseType { + UNKNOWN = 0; + INSTANCE = 1; + CLUSTER = 2; + ROUTING = 3; + RATE_LIMIT = 4; + CIRCUIT_BREAKER = 5; + SERVICES = 6; + reserved 7 to 11; + reserved "MESH", "MESH_CONFIG", "FLUX_DBREFRESH", "FLUX_SDK", "FLUX_SERVER"; + NAMESPACES = 12; + FAULT_DETECTOR = 13; + reserved 14 to 99; + LANE = 100; + // 自定义路由规则 + CUSTOM_ROUTE_RULE = 101; + // 就近路由规则 + NEARBY_ROUTE_RULE = 102; + } + + DiscoverResponseType type = 3; + Service service = 4; + repeated Instance instances = 5; + Routing routing = 6; + RateLimit rateLimit = 7; + CircuitBreaker circuitBreaker = 8; + repeated Service services = 9; + repeated Namespace namespaces = 10; + FaultDetector faultDetector = 11; + reserved 12 to 20; + Service aliasFor = 21; + repeated LaneGroup lanes = 22; + // 自定义路由规则内容 + repeated RouteRule customRouteRules = 23; + // 就近路由规则内容 + repeated RouteRule nearbyRouteRules = 24; +} + +message OptionSwitch { map options = 1; } + +message InstanceLabels { map labels = 1; } diff --git a/source/java/polaris-specification/src/main/proto/routing.proto b/source/java/polaris-specification/src/main/proto/routing.proto new file mode 100644 index 00000000..0754f134 --- /dev/null +++ b/source/java/polaris-specification/src/main/proto/routing.proto @@ -0,0 +1,275 @@ +syntax = "proto3"; + +package v1; + +import "google/protobuf/wrappers.proto"; +import "google/protobuf/any.proto"; +import "model.proto"; + +option go_package = "github.com/polarismesh/specification/source/go/api/v1/traffic_manage"; +option java_package = "com.tencent.polaris.specification.api.v1.traffic.manage"; +option java_outer_classname = "RoutingProto"; + +message Routing { + // 规则所属服务以及命名空间 + + google.protobuf.StringValue service = 1; + google.protobuf.StringValue namespace = 2; + + // 每个服务可以配置多条入站或者出站规则 + // 对于每个请求,从上到下依次匹配,若命中则终止 + repeated Route inbounds = 3; + repeated Route outbounds = 4; + + google.protobuf.StringValue ctime = 5; + google.protobuf.StringValue mtime = 6; + google.protobuf.StringValue revision = 7; + + google.protobuf.StringValue service_token = 8 [ json_name = "service_token" ]; + + reserved 9 to 20; + // route rules for current service + repeated RouteRule rules = 21; +} + +// deprecated: only for compatible to the old version server +message Route { + // 如果匹配Source规则,按照Destination路由 + // 多个Source之间的关系为或 + repeated Source sources = 1; + repeated Destination destinations = 2; + + // extendInfo 用于承载一些额外信息 + // case 1: 升级到 v2 版本时,记录对应到 v2 版本的 id 信息 + map extendInfo = 3; +} + +// deprecated: only for compatible to the old version server +message Source { + // 主调方服务以及命名空间 + google.protobuf.StringValue service = 1; + google.protobuf.StringValue namespace = 2; + + // 主调方服务实例标签或者请求标签 + // value支持正则匹配 + map metadata = 3; +} + +// deprecated: only for compatible to the old version server +message Destination { + // 被调方服务以及命名空间 + google.protobuf.StringValue service = 1; + google.protobuf.StringValue namespace = 2; + + // 被调方服务实例标签 + // value支持正则匹配 + map metadata = 3; + + // 根据服务名和服务实例metadata筛选符合条件的服务实例子集 + // 服务实例子集可以设置优先级和权重 + // 优先级:整型,范围[0, 9],最高优先级为0 + // 权重:整型 + // 先按优先级路由,如果存在高优先级,不会使用低优先级 + // 如果存在优先级相同的子集,再按权重分配 + // 优先级和权重可以都不设置/设置一个/设置两个 + // 如果部分设置优先级,部分没有设置,认为没有设置的优先级最低 + // 如果部分设置权重,部分没有设置,认为没有设置的权重为0 + // 如果全部没有设置权重,认为权重相同 + google.protobuf.UInt32Value priority = 4; + google.protobuf.UInt32Value weight = 5; + + // 将请求转发到代理服务 + google.protobuf.StringValue transfer = 6; + + //是否对该set执行隔离,隔离后,不会再分配流量 + google.protobuf.BoolValue isolate = 7; + + // 实例分组名 + google.protobuf.StringValue name = 8; +} + +enum RoutingPolicy { + // Route by rule rule => RuleRoutingConfig + RulePolicy = 0; + // Route by destination metadata ==> MetadataRoutingConfig + MetadataPolicy = 1; +} + +// configuration root for route +message RouteRule { + string id = 1; + // route rule name + string name = 2; + // namespace namingspace of routing rules + string namespace = 3; + // Enable this router + bool enable = 4; + // Router type + RoutingPolicy routing_policy = 5 [ json_name = "routing_policy" ]; + // Routing configuration for router + google.protobuf.Any routing_config = 6 [ json_name = "routing_config" ]; + // revision routing version + string revision = 7; + // ctime create time of the rules + string ctime = 8; + // mtime modify time of the rules + string mtime = 9; + // etime enable time of the rules + string etime = 10; + // priority rules priority + uint32 priority = 11; + // description simple description rules + string description = 12; + // extendInfo 用于承载一些额外信息 + // case 1: 升级到 v2 版本时,记录对应到 v1 版本的 id 信息 + // deprecated_filed only for compatible to the old version server + map extendInfo = 20; + // 路由规则标签数据 + map metadata = 50; +} + +message MetadataFailover { + enum FailoverRange { + // ALL return all instances + ALL = 0; + // OTHERS retuen without thie labels instances + OTHERS = 1; + // OTHER_KEYS return other instances which match keys + OTHER_KEYS = 2; + } + // failover_range metadata route bottom type + FailoverRange failover_range = 1; + // only use to failover_range == OTHER_KEYS + map labels = 2; +} + +// MetadataRoutingConfig metadata routing configuration +message MetadataRoutingConfig { + // service + string service = 1; + // namespace + string namespace = 2; + map labels = 3; + // When metadata not found, it will fall back to the + MetadataFailover failover = 4; +} + +// NearbyRoutingConfig routing configuration +message NearbyRoutingConfig { + enum LocationLevel { + // 未知就近级别,等同于未定义级别 + UNKNOWN = 0; + // 机房就近级别 + CAMPUS = 1; + // 可用区就近级别 + ZONE = 2; + // 地域就近级别 + REGION = 3; + // 全局就近级别 + ALL = 4; + } + // 被调服务名,支持*,代表全部服务 + string service = 1 [ json_name = "service" ]; + // 被调命名空间 + string namespace = 2 [ json_name = "namespace" ]; + // 默认就近级别 + LocationLevel match_level = 3 [ json_name = "match_level" ]; + // 最大就近级别 + LocationLevel max_match_level = 4 [ json_name = "max_match_level" ]; + // 是否强制就近 + bool strict_nearby = 5 [ json_name = "strict_nearby" ]; +} + +// RuleRoutingConfig routing configuration +message RuleRoutingConfig { + // source source info + // deprecated_filed only for compatible to the old version server + repeated SourceService sources = 1 [deprecated = true]; + // destination destinations info + // deprecated_filed only for compatible to the old version server + repeated DestinationGroup destinations = 2 [deprecated = true]; + // rule route chain + repeated SubRuleRouting rules = 3; +} + +// SubRuleRouting sub routing configuration +message SubRuleRouting { + // sub routing rule name + string name = 1; + // source source info + repeated SourceService sources = 2; + // destination destinations info + repeated DestinationGroup destinations = 3; +} + +message SourceService { + // Main tuning service and namespace + string service = 1; + string namespace = 2; + + // Master Control Service Example Tag or Request Label + // Value supports regular matching + repeated SourceMatch arguments = 3; +} + +message DestinationGroup { + // Templated service and namespace + string service = 1; + string namespace = 2; + + // Templated service example label + // Value supports regular matching + map labels = 3; + + // According to the service name and service instance Metadata Filter the + // qualified service instance subset Service instance subset can set priority + // and weight Priority: integer, range [0, 9], the highest priority is 0 + // Weight: Integer + // Press priority routing, if there is high priority, low priority will not + // use If there is a subset of the same priority, then assign by weight + // Priority and weight can be not set / set up one / set two + // If the section is set priority, some are not set, it is considered that the + // priority is not set. If the part is set, some is not set, it is considered + // that the weight is not set to 0 If you have no weight, you think the weight + // is the same + uint32 priority = 4; + uint32 weight = 5; + + // Forward requests to proxy service + string transfer = 6; + + // Whether to isolate the SET, after isolation, no traffic will be allocated + bool isolate = 7; + + // name desition name + string name = 8; +} + +// SourceMatch +message SourceMatch { + // label type for gateway request + enum Type { + // custom arguments + CUSTOM = 0; + // method, match the http post/get/put/delete or grpc method + METHOD = 1; + // header, match the http header, dubbo attachment, grpc header + HEADER = 2; + // query, match the http query, dubbo argument + QUERY = 3; + // caller host ip + CALLER_IP = 4; + // path, math the http url + PATH = 5; + // cookie match http cookie + COOKIE = 6; + // indicate the caller instance metadata + CALLER_METADATA = 7; + } + Type type = 1; + // header key or query key + string key = 2; + // header value or query value + MatchString value = 3; +} + diff --git a/source/java/polaris-specification/src/main/proto/service.proto b/source/java/polaris-specification/src/main/proto/service.proto new file mode 100644 index 00000000..98338052 --- /dev/null +++ b/source/java/polaris-specification/src/main/proto/service.proto @@ -0,0 +1,109 @@ +syntax = "proto3"; + +package v1; + +import "google/protobuf/wrappers.proto"; +import "model.proto"; + +option go_package = "github.com/polarismesh/specification/source/go/api/v1/service_manage"; +option java_package = "com.tencent.polaris.specification.api.v1.service.manage"; +option java_outer_classname = "ServiceProto"; + +message Service { + google.protobuf.StringValue name = 1; + google.protobuf.StringValue namespace = 2; + + map metadata = 3; + + google.protobuf.StringValue ports = 4; + google.protobuf.StringValue business = 5; + google.protobuf.StringValue department = 6; + google.protobuf.StringValue cmdb_mod1 = 7 [json_name = "cmdb_mod1"]; + google.protobuf.StringValue cmdb_mod2 = 8 [json_name = "cmdb_mod2"]; + google.protobuf.StringValue cmdb_mod3 = 9 [json_name = "cmdb_mod3"]; + google.protobuf.StringValue comment = 10; + google.protobuf.StringValue owners = 11; + google.protobuf.StringValue token = 12; + + google.protobuf.StringValue ctime = 13; + google.protobuf.StringValue mtime = 14; + google.protobuf.StringValue revision = 15; + google.protobuf.StringValue platform_id = 16 [json_name = "platform_id"]; + + google.protobuf.UInt32Value total_instance_count = 17 [json_name = "total_instance_count"]; + google.protobuf.UInt32Value healthy_instance_count = 18 [json_name = "healthy_instance_count"]; + + repeated google.protobuf.StringValue user_ids = 19 [json_name = "user_ids"]; + repeated google.protobuf.StringValue group_ids = 20 [json_name = "group_ids"]; + + repeated google.protobuf.StringValue remove_user_ids = 22 [json_name = "remove_user_ids"]; + repeated google.protobuf.StringValue remove_group_ids = 23 [json_name = "remove_group_ids"]; + + google.protobuf.StringValue id = 21; + google.protobuf.BoolValue editable = 24; + repeated google.protobuf.StringValue export_to = 25 [ json_name = "export_to" ]; +} + +enum AliasType { + DEFAULT = 0; + CL5SID = 1; +} + +message ServiceAlias { + google.protobuf.StringValue service = 1; + google.protobuf.StringValue namespace = 2; + google.protobuf.StringValue alias = 3; + google.protobuf.StringValue alias_namespace = 4 [json_name = "alias_namespace"]; + AliasType type = 5; + google.protobuf.StringValue owners = 6; + google.protobuf.StringValue comment = 7; + google.protobuf.StringValue service_token = 8 [json_name = "service_token"]; + + google.protobuf.StringValue ctime = 9; + google.protobuf.StringValue mtime = 10; + + google.protobuf.StringValue id = 11; + google.protobuf.BoolValue editable = 12; +} + +message Instance { + google.protobuf.StringValue id = 1; + google.protobuf.StringValue service = 2; + google.protobuf.StringValue namespace = 3; + google.protobuf.StringValue vpc_id = 21 [json_name = "vpc_id"]; + google.protobuf.StringValue host = 4; + google.protobuf.UInt32Value port = 5; + google.protobuf.StringValue protocol = 6; + google.protobuf.StringValue version = 7; + google.protobuf.UInt32Value priority = 8; + google.protobuf.UInt32Value weight = 9; + google.protobuf.BoolValue enable_health_check = 20; + HealthCheck health_check = 10; + google.protobuf.BoolValue healthy = 11; + google.protobuf.BoolValue isolate = 12; + Location location = 13; + + map metadata = 14; + google.protobuf.StringValue logic_set = 15 [json_name = "logic_set"]; + + google.protobuf.StringValue ctime = 16; + google.protobuf.StringValue mtime = 17; + google.protobuf.StringValue revision = 18; + + google.protobuf.StringValue service_token = 19 [json_name = "service_token"]; +} + +message HealthCheck { + enum HealthCheckType { + UNKNOWN = 0; + HEARTBEAT = 1; + } + + HealthCheckType type = 1; + + HeartbeatHealthCheck heartbeat = 2; +} + +message HeartbeatHealthCheck { + google.protobuf.UInt32Value ttl = 1; +} diff --git a/source/rust/polaris-specification/Cargo.toml b/source/rust/polaris-specification/Cargo.toml index 5d566f08..77ee3186 100644 --- a/source/rust/polaris-specification/Cargo.toml +++ b/source/rust/polaris-specification/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polaris-specification" -version = "1.3.2" +version = "1.5.2" edition.workspace = true authors.workspace = true license = "MIT OR Apache-2.0" @@ -12,10 +12,12 @@ keywords = ["polaris", "solution", "governance", "specification", "proxyless"] categories = ["config", "asynchronous", "development-tools"] [dependencies] +tonic = "0.11.0" bytes.workspace = true prost.workspace = true # Only necessary if using Protobuf well-known types: prost-types.workspace = true [build-dependencies] -prost-build = "0.11.9" +prost-build = "0.12" +tonic-build = "0.11.0" diff --git a/source/rust/polaris-specification/build.rs b/source/rust/polaris-specification/build.rs index f74bdb54..135c4152 100644 --- a/source/rust/polaris-specification/build.rs +++ b/source/rust/polaris-specification/build.rs @@ -1,4 +1,3 @@ -use prost_build; use std::io::Result; use std::path::PathBuf; @@ -19,5 +18,11 @@ fn main() -> Result<()> { .out_dir("src") .compile_protos(&proto_list, &["proto/"]) .unwrap(); + + tonic_build::configure() + .build_server(true) + .out_dir("src") + .compile(&proto_list, &["proto/"]) + .unwrap(); Ok(()) } diff --git a/source/rust/polaris-specification/proto/auth.proto b/source/rust/polaris-specification/proto/auth.proto index 10f934dc..163f3e09 100644 --- a/source/rust/polaris-specification/proto/auth.proto +++ b/source/rust/polaris-specification/proto/auth.proto @@ -9,28 +9,43 @@ option java_package = "com.tencent.polaris.specification.api.v1.security"; option java_outer_classname = "SecurityProto"; enum AuthAction { + // deprecated_filed 该字段从未使用过 ONLY_READ = 0; + // deprecated_filed 使用 ALLOW 进行替代 READ_WRITE = 1; + ALLOW = 10; + DENY = 11; } enum ResourceType { Namespaces = 0; Services = 1; ConfigGroups = 2; + RouteRules = 3; + RateLimitRules = 4; + CircuitBreakerRules = 5; + FaultDetectRules = 6; + LaneRules = 7; + Users = 20; + UserGroups = 21; + Roles = 22; + PolicyRules = 23; } message LoginRequest { google.protobuf.StringValue owner = 1; google.protobuf.StringValue name = 2; google.protobuf.StringValue password = 3; + map options = 4; } message LoginResponse { - google.protobuf.StringValue user_id = 1 [json_name = "user_id"]; + google.protobuf.StringValue user_id = 1 [ json_name = "user_id" ]; google.protobuf.StringValue name = 2; google.protobuf.StringValue role = 3; - google.protobuf.StringValue owner_id = 4 [json_name = "owner_id"]; + google.protobuf.StringValue owner_id = 4 [ json_name = "owner_id" ]; google.protobuf.StringValue token = 5; + map options = 6; } message User { @@ -39,24 +54,25 @@ message User { google.protobuf.StringValue password = 3; google.protobuf.StringValue owner = 4; google.protobuf.StringValue source = 5; - google.protobuf.StringValue auth_token = 6 [json_name = "auth_token"]; - google.protobuf.BoolValue token_enable = 7 [json_name = "token_enable"]; + google.protobuf.StringValue auth_token = 6 [ json_name = "auth_token" ]; + google.protobuf.BoolValue token_enable = 7 [ json_name = "token_enable" ]; google.protobuf.StringValue comment = 8; google.protobuf.StringValue ctime = 9; google.protobuf.StringValue mtime = 10; - google.protobuf.StringValue user_type = 11 [json_name = "user_type"]; + google.protobuf.StringValue user_type = 11 [ json_name = "user_type" ]; google.protobuf.StringValue mobile = 12; google.protobuf.StringValue email = 13; + map metadata = 14; } message ModifyUserPassword { google.protobuf.StringValue id = 1; - google.protobuf.StringValue old_password = 2 [json_name = "old_password"]; - google.protobuf.StringValue new_password = 3 [json_name = "new_password"]; + google.protobuf.StringValue old_password = 2 [ json_name = "old_password" ]; + google.protobuf.StringValue new_password = 3 [ json_name = "new_password" ]; } message UserGroupRelation { - google.protobuf.StringValue group_id = 1 [json_name = "group_id"]; + google.protobuf.StringValue group_id = 1 [ json_name = "group_id" ]; repeated User users = 2; } @@ -64,24 +80,42 @@ message UserGroup { google.protobuf.StringValue id = 1; google.protobuf.StringValue name = 2; google.protobuf.StringValue owner = 3; - google.protobuf.StringValue auth_token = 4 [json_name = "auth_token"]; - google.protobuf.BoolValue token_enable = 5 [json_name = "token_enable"]; + google.protobuf.StringValue auth_token = 4 [ json_name = "auth_token" ]; + google.protobuf.BoolValue token_enable = 5 [ json_name = "token_enable" ]; google.protobuf.StringValue comment = 6; google.protobuf.StringValue ctime = 7; google.protobuf.StringValue mtime = 8; UserGroupRelation relation = 9; - google.protobuf.UInt32Value user_count = 10 [json_name = "user_count"]; + google.protobuf.UInt32Value user_count = 10 [ json_name = "user_count" ]; + google.protobuf.StringValue source = 11; + map metadata = 12; } message ModifyUserGroup { google.protobuf.StringValue id = 1; google.protobuf.StringValue owner = 2; google.protobuf.StringValue name = 3; - google.protobuf.StringValue auth_token = 4 [json_name = "auth_token"]; - google.protobuf.BoolValue token_enable = 5 [json_name = "token_enable"]; + google.protobuf.StringValue auth_token = 4 [ json_name = "auth_token" ]; + google.protobuf.BoolValue token_enable = 5 [ json_name = "token_enable" ]; google.protobuf.StringValue comment = 6; - UserGroupRelation add_relations = 7 [json_name = "add_relations"]; - UserGroupRelation remove_relations = 8 [json_name = "remove_relations"]; + UserGroupRelation add_relations = 7 [ json_name = "add_relations" ]; + UserGroupRelation remove_relations = 8 [ json_name = "remove_relations" ]; + map metadata = 9; + google.protobuf.StringValue source = 10; +} + +message Role { + string id = 1; + string name = 2; + string owner = 4; + string source = 5; + bool default_role = 6 [ json_name = "default_role" ]; + map metadata = 7; + string comment = 8; + string ctime = 9; + string mtime = 10; + repeated User users = 20; + repeated UserGroup user_groups = 21 [ json_name = "user_groups" ]; } message Principal { @@ -92,6 +126,7 @@ message Principal { message Principals { repeated Principal users = 1; repeated Principal groups = 2; + repeated Principal roles = 3; } message StrategyResourceEntry { @@ -101,10 +136,27 @@ message StrategyResourceEntry { } message StrategyResources { - google.protobuf.StringValue strategy_id = 1 [json_name = "strategy_id"]; + google.protobuf.StringValue strategy_id = 1 [ json_name = "strategy_id" ]; repeated StrategyResourceEntry namespaces = 2; repeated StrategyResourceEntry services = 3; - repeated StrategyResourceEntry config_groups = 4 [json_name = "config_groups"]; + repeated StrategyResourceEntry config_groups = 4 + [ json_name = "config_groups" ]; + repeated StrategyResourceEntry route_rules = 5 [ json_name = "route_rules" ]; + repeated StrategyResourceEntry ratelimit_rules = 6 [ json_name = "ratelimit_rules" ]; + repeated StrategyResourceEntry circuitbreaker_rules = 7 [ json_name = "circuitbreaker_rules" ]; + repeated StrategyResourceEntry faultdetect_rules = 8 [ json_name = "faultdetect_rules" ]; + repeated StrategyResourceEntry lane_rules = 9 [ json_name = "lane_rules" ]; + + repeated StrategyResourceEntry users = 21 [ json_name = "users" ]; + repeated StrategyResourceEntry user_groups = 22 [ json_name = "user_groups" ]; + repeated StrategyResourceEntry roles = 23 [ json_name = "roles" ]; + repeated StrategyResourceEntry auth_policies = 24 [ json_name = "auth_policies" ]; +} + +message StrategyResourceLabel { + string key = 1; + string value = 2; + string compare_type = 3 [ json_name = "compare_type" ]; } message AuthStrategy { @@ -117,18 +169,29 @@ message AuthStrategy { google.protobuf.StringValue owner = 7; google.protobuf.StringValue ctime = 8; google.protobuf.StringValue mtime = 9; - google.protobuf.StringValue auth_token = 10 [json_name = "auth_token"]; - google.protobuf.BoolValue default_strategy = 11 [json_name = "default_strategy"]; + google.protobuf.StringValue auth_token = 10 [ json_name = "auth_token" ]; + google.protobuf.BoolValue default_strategy = 11 + [ json_name = "default_strategy" ]; + map metadata = 12; + google.protobuf.StringValue source = 13; + repeated string functions = 14; + repeated StrategyResourceLabel resource_labels = 15 + [ json_name = "resource_labels" ]; } message ModifyAuthStrategy { google.protobuf.StringValue id = 1; google.protobuf.StringValue name = 2; - Principals add_principals = 3 [json_name = "add_principals"]; - Principals remove_principals = 4 [json_name = "remove_principals"]; - StrategyResources add_resources = 5 [json_name = "add_resources"]; - StrategyResources remove_resources = 6 [json_name = "remove_resources"]; + Principals add_principals = 3 [ json_name = "add_principals" ]; + Principals remove_principals = 4 [ json_name = "remove_principals" ]; + StrategyResources add_resources = 5 [ json_name = "add_resources" ]; + StrategyResources remove_resources = 6 [ json_name = "remove_resources" ]; AuthAction action = 7; google.protobuf.StringValue comment = 8; google.protobuf.StringValue owner = 9; + map metadata = 12; + google.protobuf.StringValue source = 13; + repeated string functions = 14; + repeated StrategyResourceLabel resource_labels = 15 + [ json_name = "resource_labels" ]; } diff --git a/source/rust/polaris-specification/proto/circuitbreaker.proto b/source/rust/polaris-specification/proto/circuitbreaker.proto index 97d51238..a47f2341 100644 --- a/source/rust/polaris-specification/proto/circuitbreaker.proto +++ b/source/rust/polaris-specification/proto/circuitbreaker.proto @@ -224,7 +224,8 @@ message RuleMatcher { message DestinationService { string service = 1; string namespace = 2; - MatchString method = 3; + // deprecated_filed using api.path in blockConfig instead + MatchString method = 3 [deprecated = true]; } SourceService source = 1; DestinationService destination = 2; @@ -268,10 +269,10 @@ message CircuitBreakerRule { Level level = 21; // match condition for this rule RuleMatcher rule_matcher = 22; - // error conditions to judge an invocation as an error - repeated ErrorCondition error_conditions = 23; - // trigger condition to trigger circuitbreaking - repeated TriggerCondition trigger_condition = 24; + // deprecated_filed error conditions to judge an invocation as an error + repeated ErrorCondition error_conditions = 23 [deprecated = true]; + // deprecated_filed trigger condition to trigger circuitbreaking + repeated TriggerCondition trigger_condition = 24 [deprecated = true]; // the maximum % of an upstream cluster that can be ejected uint32 max_ejection_percent = 25; // recover condition to make resource open to close @@ -280,6 +281,12 @@ message CircuitBreakerRule { FaultDetectConfig faultDetectConfig = 27; // fall back configuration FallbackConfig fallbackConfig = 28; + // list for block configuration + repeated BlockConfig block_configs = 29 [ json_name = "block_configs" ]; + // priority rules priority + uint32 priority = 30 [ json_name = "priority" ]; + // 熔断规则标签数据 + map metadata = 50; } // the condition to judge an input invocation as an error @@ -307,6 +314,7 @@ message TriggerCondition { uint32 minimum_request = 5; } +// circuitbreaking OPEN status recover message RecoverCondition { // seconds from open to half-open uint32 sleep_window = 1; @@ -314,15 +322,18 @@ message RecoverCondition { uint32 consecutiveSuccess = 2; } +// fault detect config within circuitbreaking message FaultDetectConfig { bool enable = 1; } +// fallback config message FallbackConfig { bool enable = 1; FallbackResponse response = 2; } +// fallback response message FallbackResponse { int32 code = 1; message MessageHeader { @@ -331,4 +342,15 @@ message FallbackResponse { } repeated MessageHeader headers = 2; string body = 3; +} + +// blocking strategy +message BlockConfig { + string name = 1 [ json_name = "name" ]; + // blocking target api + API api = 2 [ json_name = "api" ]; + // conditions to judge an invocation as an error + repeated ErrorCondition error_conditions = 3 [ json_name = "error_conditions" ]; + // trigger condition to trigger circuitbreaking + repeated TriggerCondition trigger_conditions = 4 [ json_name = "trigger_conditions" ]; } \ No newline at end of file diff --git a/source/rust/polaris-specification/proto/code.proto b/source/rust/polaris-specification/proto/code.proto index 9bc3d23d..baad235d 100644 --- a/source/rust/polaris-specification/proto/code.proto +++ b/source/rust/polaris-specification/proto/code.proto @@ -74,6 +74,7 @@ enum Code { InvalidFaultDetectName = 400901; InvalidFaultDetectNamespace = 400902; FaultDetectRuleExisted = 400903; + InvalidMatchRule = 400904; // network relative codes ServicesExistedMesh = 400170; @@ -190,4 +191,4 @@ enum Code { AuthTokenForbidden = 403001; OperationRoleForbidden = 403002; -} \ No newline at end of file +} diff --git a/source/rust/polaris-specification/proto/config_file.proto b/source/rust/polaris-specification/proto/config_file.proto index 90bd88db..80e2b8aa 100644 --- a/source/rust/polaris-specification/proto/config_file.proto +++ b/source/rust/polaris-specification/proto/config_file.proto @@ -3,6 +3,7 @@ syntax = "proto3"; package v1; import "google/protobuf/wrappers.proto"; +import "model.proto"; option go_package = "github.com/polarismesh/specification/source/go/api/v1/config_manage"; option java_package = "com.tencent.polaris.specification.api.v1.config.manage"; option java_outer_classname = "ConfigFileProto"; @@ -18,11 +19,14 @@ message ConfigFileGroup { google.protobuf.StringValue modify_by = 8; google.protobuf.UInt64Value fileCount = 9; - repeated google.protobuf.StringValue user_ids = 10 [json_name = "user_ids"]; - repeated google.protobuf.StringValue group_ids = 11 [json_name = "group_ids"]; + repeated google.protobuf.StringValue user_ids = 10 [ json_name = "user_ids" ]; + repeated google.protobuf.StringValue group_ids = 11 + [ json_name = "group_ids" ]; - repeated google.protobuf.StringValue remove_user_ids = 13 [json_name = "remove_user_ids"]; - repeated google.protobuf.StringValue remove_group_ids = 14 [json_name = "remove_group_ids"]; + repeated google.protobuf.StringValue remove_user_ids = 13 + [ json_name = "remove_user_ids" ]; + repeated google.protobuf.StringValue remove_group_ids = 14 + [ json_name = "remove_group_ids" ]; google.protobuf.BoolValue editable = 15; google.protobuf.StringValue owner = 16; @@ -76,6 +80,11 @@ message ConfigFileRelease { repeated ConfigFileTag tags = 14; // 当前生效配置 google.protobuf.BoolValue active = 15; + google.protobuf.StringValue format = 16; + google.protobuf.StringValue release_description = 17; + google.protobuf.StringValue release_type = 18; + // 配置灰度发布时需要匹配的客户端标签信息 + repeated ClientLabel beta_labels = 19; } message ConfigFileReleaseHistory { @@ -97,6 +106,7 @@ message ConfigFileReleaseHistory { google.protobuf.StringValue modify_by = 16; // 配置发布失败的原因 google.protobuf.StringValue reason = 17; + google.protobuf.StringValue release_description = 18; } message ConfigFileTemplate { @@ -126,7 +136,7 @@ message ClientConfigFileInfo { // 配置文件版本名称 google.protobuf.StringValue name = 10; // 配置文件的发布时间 - google.protobuf.StringValue release_time = 11 [json_name = "release_time"]; + google.protobuf.StringValue release_time = 11 [ json_name = "release_time" ]; } message ClientWatchConfigFileRequest { @@ -140,3 +150,64 @@ message ConfigFileExportRequest { repeated google.protobuf.StringValue groups = 2; repeated google.protobuf.StringValue names = 3; } + +message ConfigFilePublishInfo { + google.protobuf.StringValue release_name = 1 [ json_name = "release_name" ]; + google.protobuf.StringValue namespace = 2; + google.protobuf.StringValue group = 3; + google.protobuf.StringValue file_name = 4 [ json_name = "file_name" ]; + google.protobuf.StringValue content = 5; + google.protobuf.StringValue comment = 6; + google.protobuf.StringValue format = 7; + google.protobuf.StringValue release_description = 8 + [ json_name = "release_description" ]; + google.protobuf.StringValue create_by = 11 [ json_name = "create_by" ]; + google.protobuf.StringValue modify_by = 13 [ json_name = "modify_by" ]; + repeated ConfigFileTag tags = 14; + google.protobuf.StringValue md5 = 15; + // 是否为加密配置文件 + google.protobuf.BoolValue encrypted = 16; + // 加密算法 + google.protobuf.StringValue encrypt_algo = 17; +} + +message ConfigFileGroupRequest { + google.protobuf.StringValue revision = 1; + ConfigFileGroup config_file_group = 2 [ json_name = "config_file_group" ]; + // 配置标签 + map client_labels = 12 [ json_name = "client_labels" ]; +} + +message ConfigDiscoverRequest { + enum ConfigDiscoverRequestType { + UNKNOWN = 0; + CONFIG_FILE = 1; + CONFIG_FILE_Names = 2; + CONFIG_FILE_GROUPS = 3; + } + ConfigDiscoverRequestType type = 1; + ClientConfigFileInfo config_file = 2 [ json_name = "config_file" ]; + string revision = 3; +} + +message ConfigDiscoverResponse { + enum ConfigDiscoverResponseType { + UNKNOWN = 0; + CONFIG_FILE = 1; + CONFIG_FILE_Names = 2; + CONFIG_FILE_GROUPS = 3; + } + + uint32 code = 1; + string info = 2; + string revision = 3; + + ConfigDiscoverResponseType type = 4; + + ClientConfigFileInfo config_file = 5 [ json_name = "config_file" ]; + + repeated ClientConfigFileInfo config_file_names = 6 + [ json_name = "config_file_names" ]; + repeated ConfigFileGroup config_file_groups = 7 + [ json_name = "config_file_groups" ]; +} diff --git a/source/rust/polaris-specification/proto/config_file_response.proto b/source/rust/polaris-specification/proto/config_file_response.proto index 1df5d637..29108bdd 100644 --- a/source/rust/polaris-specification/proto/config_file_response.proto +++ b/source/rust/polaris-specification/proto/config_file_response.proto @@ -74,8 +74,9 @@ message ConfigEncryptAlgorithmResponse { message ConfigClientListResponse { google.protobuf.UInt32Value code = 1; google.protobuf.StringValue info = 2; + google.protobuf.StringValue revision = 3; - string namespace = 3; - string group = 4; - repeated ClientConfigFileInfo config_file_names = 5 [json_name = "config_file_names"]; + string namespace = 4; + string group = 5; + repeated ClientConfigFileInfo config_file_infos = 6 [json_name = "config_file_infos"]; } \ No newline at end of file diff --git a/source/rust/polaris-specification/proto/contract.proto b/source/rust/polaris-specification/proto/contract.proto new file mode 100644 index 00000000..c69f6ada --- /dev/null +++ b/source/rust/polaris-specification/proto/contract.proto @@ -0,0 +1,75 @@ +syntax = "proto3"; + +package v1; + +option go_package = "github.com/polarismesh/specification/source/go/api/v1/service_manage"; +option java_package = "com.tencent.polaris.specification.api.v1.service.manage"; +option java_outer_classname = "ServiceContractProto"; + +message ServiceContract { + // 契约ID + string id = 1; + // 契约名称 + // deprecated, use type field + string name = 2; + // 所属命名空间 + string namespace = 3; + // 所属服务名称 + string service = 4; + // 协议,http/grpc/dubbo/thrift + string protocol = 5; + // 契约版本 + string version = 6; + // 信息摘要 + string revision = 7; + // 额外描述 + string content = 8; + // 接口描述信息 + repeated InterfaceDescriptor interfaces = 9; + // 创建时间 + string ctime = 10; + // 更新时间 + string mtime = 11; + // 接口状态,Offline/Online + string status = 12; + // 类型 + string type = 14; +} + +message InterfaceDescriptor { + enum Source { + UNKNOWN = 0; + Manual = 1; + Client = 2; + } + + // 接口ID + string id = 1; + // 方法名称,对应 http method/ dubbo interface func/grpc service func + string method = 2; + // 接口名称,http path/dubbo interface/grpc service + string path = 3; + // 接口描述信息 + string content = 4; + // 创建来源 + Source source = 5; + // 接口信息摘要 + string revision = 6; + // 创建时间 + string ctime = 7; + // 更新时间 + string mtime = 8; + // 接口名称描述信息 + // deprecated, use type field + string name = 9; + // 所属命名空间 + string namespace = 10; + // 所属服务名称 + string service = 11; + // 协议,http/grpc/dubbo/thrift + string protocol = 12; + // 契约版本 + string version = 13; + // 类型 + string type = 14; +} diff --git a/source/rust/polaris-specification/proto/fault_detector.proto b/source/rust/polaris-specification/proto/fault_detector.proto index a2baa7ea..217669be 100644 --- a/source/rust/polaris-specification/proto/fault_detector.proto +++ b/source/rust/polaris-specification/proto/fault_detector.proto @@ -36,7 +36,9 @@ message FaultDetectRule { message DestinationService { string service = 1; string namespace = 2; - MatchString method = 3; + // deprecated_filed use api.path instead + MatchString method = 3 [deprecated = true]; + API api = 4; } // detect target DestinationService target_service = 21; @@ -60,6 +62,10 @@ message FaultDetectRule { TcpProtocolConfig tcp_config = 27; // udp detect config UdpProtocolConfig udp_config = 28; + // priority rules priority + uint32 priority = 29 [ json_name = "priority" ]; + // 探测规则标签数据 + map metadata = 50; } message HttpProtocolConfig { diff --git a/source/rust/polaris-specification/proto/grpc_config_api.proto b/source/rust/polaris-specification/proto/grpc_config_api.proto index dabed5ba..c6103609 100644 --- a/source/rust/polaris-specification/proto/grpc_config_api.proto +++ b/source/rust/polaris-specification/proto/grpc_config_api.proto @@ -23,10 +23,15 @@ service PolarisConfigGRPC { // 发布配置 rpc PublishConfigFile(ConfigFileRelease) returns (ConfigClientResponse) {} + // 发布配置 + rpc UpsertAndPublishConfigFile(ConfigFilePublishInfo) returns (ConfigClientResponse) {} + // 订阅配置变更 rpc WatchConfigFiles(ClientWatchConfigFileRequest) returns (ConfigClientResponse) {} - // 拉取配置变更列表 - rpc GetConfigFileMetadataList(ClientConfigFileInfo) returns (ConfigClientListResponse) {} + // 拉取指定配置分组下的配置文件列表 + rpc GetConfigFileMetadataList(ConfigFileGroupRequest) returns (ConfigClientListResponse) {} + // 统一发现接口 + rpc Discover(stream ConfigDiscoverRequest) returns (stream ConfigDiscoverResponse) {} } diff --git a/source/rust/polaris-specification/proto/grpcapi.proto b/source/rust/polaris-specification/proto/grpcapi.proto index 674cf470..4a1e2cbf 100644 --- a/source/rust/polaris-specification/proto/grpcapi.proto +++ b/source/rust/polaris-specification/proto/grpcapi.proto @@ -7,6 +7,7 @@ import "service.proto"; import "request.proto"; import "response.proto"; import "heartbeat.proto"; +import "contract.proto"; option go_package = "github.com/polarismesh/specification/source/go/api/v1/service_manage"; option java_package = "com.tencent.polaris.specification.api.v1.service.manage"; @@ -27,9 +28,17 @@ service PolarisGRPC { service PolarisHeartbeatGRPC { // 被调方批量上报心跳 - rpc BatchHeartbeat(stream HeartbeatsRequest) returns (stream HeartbeatsResponse) {} + rpc BatchHeartbeat(stream HeartbeatsRequest) + returns (stream HeartbeatsResponse) {} // 批量获取心跳记录 rpc BatchGetHeartbeat(GetHeartbeatsRequest) returns (GetHeartbeatsResponse) {} // 批量删除心跳记录 rpc BatchDelHeartbeat(DelHeartbeatsRequest) returns (DelHeartbeatsResponse) {} } + +service PolarisServiceContractGRPC { + // 上报服务契约 + rpc ReportServiceContract(ServiceContract) returns (Response) {} + // 查询服务契约 + rpc GetServiceContract(ServiceContract) returns (Response) {} +} diff --git a/source/rust/polaris-specification/proto/lane.proto b/source/rust/polaris-specification/proto/lane.proto new file mode 100644 index 00000000..9eb00f25 --- /dev/null +++ b/source/rust/polaris-specification/proto/lane.proto @@ -0,0 +1,108 @@ +syntax = "proto3"; + +package v1; + +import "google/protobuf/any.proto"; +import "model.proto"; +import "routing.proto"; + +option go_package = "github.com/polarismesh/specification/source/go/api/v1/traffic_manage"; +option java_package = "com.tencent.polaris.specification.api.v1.traffic.manage"; +option java_outer_classname = "LaneProto"; + +// 流量入口 +message TrafficEntry { + // 标记流量入口类型 + // type == "polarismesh.cn/gateway/spring-cloud-gateway", 则 selector 为 + // ServiceGatewaySelector type == "polarismesh.cn/service, 则 selector 为 + // ServiceSelector + string type = 1; + google.protobuf.Any selector = 2; +} + +// 微服务网关入口定义 +message ServiceGatewaySelector { + string namespace = 1; + string service = 2; + // 决定要不要部份 + map labels = 3; +} + +// 普通服务入口定义 +message ServiceSelector { + string namespace = 1; + string service = 2; + // 决定要不要部份 + map labels = 3; +} + +// 泳道组实体定义 +message LaneGroup { + // 泳道组 ID + string id = 1; + // 泳道组名称 + string name = 2; + // 泳道组内的流量入口信息 + repeated TrafficEntry entries = 3; + // 在泳道组内的服务列表信息 + repeated DestinationGroup destinations = 4; + // 泳道组描述信息 + string revision = 7; + // 泳道组描述信息 + string description = 8; + // 泳道组的创建时间 + string ctime = 9; + // 泳道组的更新时间 + string mtime = 10; + // 泳道组内的流量入口信息 + repeated LaneRule rules = 11; + // 泳道组标签信息 + map metadata = 20; +} + +// TrafficMatchRule 流量匹配规则 +message TrafficMatchRule { + // 流量匹配规则,判断哪些流量需要进入泳道 + repeated SourceMatch arguments = 4; + // 多个 SourceMatch 之间的判断关系 + enum TrafficMatchMode { + // 与模式 + AND = 0; + // 或模式 + OR = 1; + } + TrafficMatchMode matchMode = 14; +} + +// 泳道规则 +message LaneRule { + string id = 1; + string name = 2; + // 所属泳道组的名称 + string group_name = 3; + // 流量匹配规则 + TrafficMatchRule traffic_match_rule = 4; + // 保存这个泳道的默认实例标签 + string default_label_value = 5; + // 泳道规则是否启用 + bool enable = 6; + enum LaneMatchMode { + // 严格匹配模式 + STRICT = 0; + // 宽松匹配模式 + PERMISSIVE = 1; + } + LaneMatchMode match_mode = 7; + // revision routing version + string revision = 8; + // ctime create time of the rules + string ctime = 9; + // mtime modify time of the rules + string mtime = 10; + // etime enable time of the rules + string etime = 11; + // priority rules priority + uint32 priority = 12; + // description simple description rules + string description = 13; +} \ No newline at end of file diff --git a/source/rust/polaris-specification/proto/model.proto b/source/rust/polaris-specification/proto/model.proto index fa72e870..b24d8547 100644 --- a/source/rust/polaris-specification/proto/model.proto +++ b/source/rust/polaris-specification/proto/model.proto @@ -39,20 +39,33 @@ message MatchString { MatchStringType type = 1; google.protobuf.StringValue value = 2; - ValueType value_type = 3 [json_name = "value_type"]; + ValueType value_type = 3 [ json_name = "value_type" ]; } - -message StringList { - repeated string values = 1; -} +message StringList { repeated string values = 1; } // 汇总查询数据 message Summary { // 服务总数 - uint32 total_service_count = 1 [json_name = "total_service_count"]; + uint32 total_service_count = 1 [ json_name = "total_service_count" ]; // 健康实例总数 - uint32 total_health_instance_count = 2 [json_name = "total_health_instance_count"]; + uint32 total_health_instance_count = 2 + [ json_name = "total_health_instance_count" ]; // 实例总数 - uint32 total_instance_count = 3 [json_name = "total_instance_count"]; + uint32 total_instance_count = 3 [ json_name = "total_instance_count" ]; } + +message ClientLabel { + string key = 1; + MatchString value = 2; +} + +// API统一数据结构 +message API { + // API的协议,*或者为空代表全部 + string protocol = 1 [ json_name = "protocol" ]; + // API的方法,*或者为空代表全部 + string method = 2 [ json_name = "method" ]; + // API的路径,支持多种匹配方式 + MatchString path = 3 [ json_name = "path" ]; +} \ No newline at end of file diff --git a/source/rust/polaris-specification/proto/namespace.proto b/source/rust/polaris-specification/proto/namespace.proto index c3998d47..a23850d8 100644 --- a/source/rust/polaris-specification/proto/namespace.proto +++ b/source/rust/polaris-specification/proto/namespace.proto @@ -30,4 +30,6 @@ message Namespace { google.protobuf.StringValue id = 12; google.protobuf.BoolValue editable = 15; + + repeated google.protobuf.StringValue service_export_to = 16 [ json_name = "service_export_to" ]; } \ No newline at end of file diff --git a/source/rust/polaris-specification/proto/ratelimit.proto b/source/rust/polaris-specification/proto/ratelimit.proto index 004a4046..a12d17f5 100644 --- a/source/rust/polaris-specification/proto/ratelimit.proto +++ b/source/rust/polaris-specification/proto/ratelimit.proto @@ -94,6 +94,8 @@ message Rule { google.protobuf.StringValue etime = 25; // 最大排队时长,单位秒 google.protobuf.UInt32Value max_queue_delay = 26 [json_name = "max_queue_delay"]; + // 限流规则标签数据 + map metadata = 50; } message MatchArgument { diff --git a/source/rust/polaris-specification/proto/request.proto b/source/rust/polaris-specification/proto/request.proto index b82ba55c..49f98b43 100644 --- a/source/rust/polaris-specification/proto/request.proto +++ b/source/rust/polaris-specification/proto/request.proto @@ -3,11 +3,16 @@ syntax = "proto3"; package v1; import "service.proto"; +import "contract.proto"; option go_package = "github.com/polarismesh/specification/source/go/api/v1/service_manage"; option java_package = "com.tencent.polaris.specification.api.v1.service.manage"; option java_outer_classname = "RequestProto"; +message DiscoverFilter { + bool OnlyHealthyInstance = 1; +} + message DiscoverRequest { enum DiscoverRequestType { UNKNOWN = 0; @@ -20,10 +25,17 @@ message DiscoverRequest { reserved 7 to 11; NAMESPACES = 12; FAULT_DETECTOR = 13; + reserved 14 to 99; + LANE = 100; + // 自定义路由规则 + CUSTOM_ROUTE_RULE = 101; + // 就近路由规则 + NEARBY_ROUTE_RULE = 102; } DiscoverRequestType type = 1; Service service = 2; reserved 3 to 4; + DiscoverFilter Filter = 30; } diff --git a/source/rust/polaris-specification/proto/response.proto b/source/rust/polaris-specification/proto/response.proto index 15e34ba1..d04f56e6 100644 --- a/source/rust/polaris-specification/proto/response.proto +++ b/source/rust/polaris-specification/proto/response.proto @@ -14,6 +14,8 @@ import "client.proto"; import "configrelease.proto"; import "fault_detector.proto"; import "auth.proto"; +import "contract.proto"; +import "lane.proto"; option go_package = "github.com/polarismesh/specification/source/go/api/v1/service_manage"; option java_package = "com.tencent.polaris.specification.api.v1.service.manage"; @@ -44,6 +46,8 @@ message Response { InstanceLabels instanceLabels = 28; google.protobuf.Any data = 29; + + ServiceContract serviceContract = 30; } message BatchWriteResponse { @@ -70,7 +74,7 @@ message BatchQueryResponse { repeated UserGroup userGroups = 19; repeated AuthStrategy authStrategies = 20; repeated Client clients = 21; - + repeated google.protobuf.Any data = 22; Summary summary = 23; } @@ -91,6 +95,12 @@ message DiscoverResponse { reserved "MESH", "MESH_CONFIG", "FLUX_DBREFRESH", "FLUX_SDK", "FLUX_SERVER"; NAMESPACES = 12; FAULT_DETECTOR = 13; + reserved 14 to 99; + LANE = 100; + // 自定义路由规则 + CUSTOM_ROUTE_RULE = 101; + // 就近路由规则 + NEARBY_ROUTE_RULE = 102; } DiscoverResponseType type = 3; @@ -104,14 +114,13 @@ message DiscoverResponse { FaultDetector faultDetector = 11; reserved 12 to 20; Service aliasFor = 21; + repeated LaneGroup lanes = 22; + // 自定义路由规则内容 + repeated RouteRule customRouteRules = 23; + // 就近路由规则内容 + repeated RouteRule nearbyRouteRules = 24; } +message OptionSwitch { map options = 1; } -message OptionSwitch { - map options = 1; -} - -message InstanceLabels { - map labels = 1; -} - +message InstanceLabels { map labels = 1; } diff --git a/source/rust/polaris-specification/proto/routing.proto b/source/rust/polaris-specification/proto/routing.proto index 557b270d..0754f134 100644 --- a/source/rust/polaris-specification/proto/routing.proto +++ b/source/rust/polaris-specification/proto/routing.proto @@ -122,7 +122,10 @@ message RouteRule { string description = 12; // extendInfo 用于承载一些额外信息 // case 1: 升级到 v2 版本时,记录对应到 v1 版本的 id 信息 + // deprecated_filed only for compatible to the old version server map extendInfo = 20; + // 路由规则标签数据 + map metadata = 50; } message MetadataFailover { @@ -151,14 +154,40 @@ message MetadataRoutingConfig { MetadataFailover failover = 4; } +// NearbyRoutingConfig routing configuration +message NearbyRoutingConfig { + enum LocationLevel { + // 未知就近级别,等同于未定义级别 + UNKNOWN = 0; + // 机房就近级别 + CAMPUS = 1; + // 可用区就近级别 + ZONE = 2; + // 地域就近级别 + REGION = 3; + // 全局就近级别 + ALL = 4; + } + // 被调服务名,支持*,代表全部服务 + string service = 1 [ json_name = "service" ]; + // 被调命名空间 + string namespace = 2 [ json_name = "namespace" ]; + // 默认就近级别 + LocationLevel match_level = 3 [ json_name = "match_level" ]; + // 最大就近级别 + LocationLevel max_match_level = 4 [ json_name = "max_match_level" ]; + // 是否强制就近 + bool strict_nearby = 5 [ json_name = "strict_nearby" ]; +} + // RuleRoutingConfig routing configuration message RuleRoutingConfig { // source source info - // deprecated: only for compatible to the old version server - repeated SourceService sources = 1; + // deprecated_filed only for compatible to the old version server + repeated SourceService sources = 1 [deprecated = true]; // destination destinations info - // deprecated: only for compatible to the old version server - repeated DestinationGroup destinations = 2; + // deprecated_filed only for compatible to the old version server + repeated DestinationGroup destinations = 2 [deprecated = true]; // rule route chain repeated SubRuleRouting rules = 3; } @@ -234,6 +263,8 @@ message SourceMatch { PATH = 5; // cookie match http cookie COOKIE = 6; + // indicate the caller instance metadata + CALLER_METADATA = 7; } Type type = 1; // header key or query key diff --git a/source/rust/polaris-specification/proto/service.proto b/source/rust/polaris-specification/proto/service.proto index c1c8438b..98338052 100644 --- a/source/rust/polaris-specification/proto/service.proto +++ b/source/rust/polaris-specification/proto/service.proto @@ -33,7 +33,6 @@ message Service { google.protobuf.UInt32Value total_instance_count = 17 [json_name = "total_instance_count"]; google.protobuf.UInt32Value healthy_instance_count = 18 [json_name = "healthy_instance_count"]; - repeated google.protobuf.StringValue user_ids = 19 [json_name = "user_ids"]; repeated google.protobuf.StringValue group_ids = 20 [json_name = "group_ids"]; @@ -42,6 +41,7 @@ message Service { google.protobuf.StringValue id = 21; google.protobuf.BoolValue editable = 24; + repeated google.protobuf.StringValue export_to = 25 [ json_name = "export_to" ]; } enum AliasType { diff --git a/source/rust/polaris-specification/src/v1.rs b/source/rust/polaris-specification/src/v1.rs index 337a9498..7a301d8c 100644 --- a/source/rust/polaris-specification/src/v1.rs +++ b/source/rust/polaris-specification/src/v1.rs @@ -1,37 +1,4 @@ -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Namespace { - #[prost(message, optional, tag = "1")] - pub name: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "2")] - pub comment: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "3")] - pub owners: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "4")] - pub token: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "5")] - pub ctime: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "6")] - pub mtime: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "7")] - pub total_service_count: ::core::option::Option, - #[prost(message, optional, tag = "8")] - pub total_health_instance_count: ::core::option::Option, - #[prost(message, optional, tag = "9")] - pub total_instance_count: ::core::option::Option, - #[prost(message, repeated, tag = "10")] - pub user_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(message, repeated, tag = "11")] - pub group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(message, repeated, tag = "13")] - pub remove_user_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(message, repeated, tag = "14")] - pub remove_group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(message, optional, tag = "12")] - pub id: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "15")] - pub editable: ::core::option::Option, -} +// This file is @generated by prost-build. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Location { @@ -170,6 +137,28 @@ pub struct Summary { } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] +pub struct ClientLabel { + #[prost(string, tag = "1")] + pub key: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub value: ::core::option::Option, +} +/// API统一数据结构 +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Api { + /// API的协议,*或者为空代表全部 + #[prost(string, tag = "1")] + pub protocol: ::prost::alloc::string::String, + /// API的方法,*或者为空代表全部 + #[prost(string, tag = "2")] + pub method: ::prost::alloc::string::String, + /// API的路径,支持多种匹配方式 + #[prost(message, optional, tag = "3")] + pub path: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct Service { #[prost(message, optional, tag = "1")] pub name: ::core::option::Option<::prost::alloc::string::String>, @@ -222,6 +211,8 @@ pub struct Service { pub id: ::core::option::Option<::prost::alloc::string::String>, #[prost(message, optional, tag = "24")] pub editable: ::core::option::Option, + #[prost(message, repeated, tag = "25")] + pub export_to: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -379,169 +370,28 @@ impl AliasType { } } } -/// 规则所属服务以及命名空间 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Routing { - #[prost(message, optional, tag = "1")] - pub service: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "2")] - pub namespace: ::core::option::Option<::prost::alloc::string::String>, - /// 每个服务可以配置多条入站或者出站规则 - /// 对于每个请求,从上到下依次匹配,若命中则终止 - #[prost(message, repeated, tag = "3")] - pub inbounds: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "4")] - pub outbounds: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "5")] - pub ctime: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "6")] - pub mtime: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "7")] - pub revision: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "8")] - pub service_token: ::core::option::Option<::prost::alloc::string::String>, - /// route rules for current service - #[prost(message, repeated, tag = "21")] - pub rules: ::prost::alloc::vec::Vec, -} -/// deprecated: only for compatible to the old version server -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Route { - /// 如果匹配Source规则,按照Destination路由 - /// 多个Source之间的关系为或 - #[prost(message, repeated, tag = "1")] - pub sources: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "2")] - pub destinations: ::prost::alloc::vec::Vec, - /// extendInfo 用于承载一些额外信息 - /// case 1: 升级到 v2 版本时,记录对应到 v2 版本的 id 信息 - #[prost(map = "string, string", tag = "3")] - pub extend_info: ::std::collections::HashMap< - ::prost::alloc::string::String, - ::prost::alloc::string::String, - >, -} -/// deprecated: only for compatible to the old version server -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Source { - /// 主调方服务以及命名空间 - #[prost(message, optional, tag = "1")] - pub service: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "2")] - pub namespace: ::core::option::Option<::prost::alloc::string::String>, - /// 主调方服务实例标签或者请求标签 - /// value支持正则匹配 - #[prost(map = "string, message", tag = "3")] - pub metadata: ::std::collections::HashMap< - ::prost::alloc::string::String, - MatchString, - >, -} -/// deprecated: only for compatible to the old version server #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct Destination { - /// 被调方服务以及命名空间 +pub struct Client { #[prost(message, optional, tag = "1")] - pub service: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "2")] - pub namespace: ::core::option::Option<::prost::alloc::string::String>, - /// 被调方服务实例标签 - /// value支持正则匹配 - #[prost(map = "string, message", tag = "3")] - pub metadata: ::std::collections::HashMap< - ::prost::alloc::string::String, - MatchString, - >, - /// 根据服务名和服务实例metadata筛选符合条件的服务实例子集 - /// 服务实例子集可以设置优先级和权重 - /// 优先级:整型,范围[0, 9],最高优先级为0 - /// 权重:整型 - /// 先按优先级路由,如果存在高优先级,不会使用低优先级 - /// 如果存在优先级相同的子集,再按权重分配 - /// 优先级和权重可以都不设置/设置一个/设置两个 - /// 如果部分设置优先级,部分没有设置,认为没有设置的优先级最低 - /// 如果部分设置权重,部分没有设置,认为没有设置的权重为0 - /// 如果全部没有设置权重,认为权重相同 + pub host: ::core::option::Option<::prost::alloc::string::String>, + #[prost(enumeration = "client::ClientType", tag = "2")] + pub r#type: i32, + #[prost(message, optional, tag = "3")] + pub version: ::core::option::Option<::prost::alloc::string::String>, #[prost(message, optional, tag = "4")] - pub priority: ::core::option::Option, + pub location: ::core::option::Option, #[prost(message, optional, tag = "5")] - pub weight: ::core::option::Option, - /// 将请求转发到代理服务 - #[prost(message, optional, tag = "6")] - pub transfer: ::core::option::Option<::prost::alloc::string::String>, - /// 是否对该set执行隔离,隔离后,不会再分配流量 + pub id: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, repeated, tag = "6")] + pub stat: ::prost::alloc::vec::Vec, #[prost(message, optional, tag = "7")] - pub isolate: ::core::option::Option, - /// 实例分组名 + pub ctime: ::core::option::Option<::prost::alloc::string::String>, #[prost(message, optional, tag = "8")] - pub name: ::core::option::Option<::prost::alloc::string::String>, -} -/// configuration root for route -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RouteRule { - #[prost(string, tag = "1")] - pub id: ::prost::alloc::string::String, - /// route rule name - #[prost(string, tag = "2")] - pub name: ::prost::alloc::string::String, - /// namespace namingspace of routing rules - #[prost(string, tag = "3")] - pub namespace: ::prost::alloc::string::String, - /// Enable this router - #[prost(bool, tag = "4")] - pub enable: bool, - /// Router type - #[prost(enumeration = "RoutingPolicy", tag = "5")] - pub routing_policy: i32, - /// Routing configuration for router - #[prost(message, optional, tag = "6")] - pub routing_config: ::core::option::Option<::prost_types::Any>, - /// revision routing version - #[prost(string, tag = "7")] - pub revision: ::prost::alloc::string::String, - /// ctime create time of the rules - #[prost(string, tag = "8")] - pub ctime: ::prost::alloc::string::String, - /// mtime modify time of the rules - #[prost(string, tag = "9")] - pub mtime: ::prost::alloc::string::String, - /// etime enable time of the rules - #[prost(string, tag = "10")] - pub etime: ::prost::alloc::string::String, - /// priority rules priority - #[prost(uint32, tag = "11")] - pub priority: u32, - /// description simple description rules - #[prost(string, tag = "12")] - pub description: ::prost::alloc::string::String, - /// extendInfo 用于承载一些额外信息 - /// case 1: 升级到 v2 版本时,记录对应到 v1 版本的 id 信息 - #[prost(map = "string, string", tag = "20")] - pub extend_info: ::std::collections::HashMap< - ::prost::alloc::string::String, - ::prost::alloc::string::String, - >, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MetadataFailover { - /// failover_range metadata route bottom type - #[prost(enumeration = "metadata_failover::FailoverRange", tag = "1")] - pub failover_range: i32, - /// only use to failover_range == OTHER_KEYS - #[prost(map = "string, string", tag = "2")] - pub labels: ::std::collections::HashMap< - ::prost::alloc::string::String, - ::prost::alloc::string::String, - >, + pub mtime: ::core::option::Option<::prost::alloc::string::String>, } -/// Nested message and enum types in `MetadataFailover`. -pub mod metadata_failover { +/// Nested message and enum types in `Client`. +pub mod client { #[derive( Clone, Copy, @@ -554,152 +404,139 @@ pub mod metadata_failover { ::prost::Enumeration )] #[repr(i32)] - pub enum FailoverRange { - /// ALL return all instances - All = 0, - /// OTHERS retuen without thie labels instances - Others = 1, - /// OTHER_KEYS return other instances which match keys - OtherKeys = 2, + pub enum ClientType { + Unknown = 0, + Sdk = 1, + Agent = 2, } - impl FailoverRange { + impl ClientType { /// String value of the enum field names used in the ProtoBuf definition. /// /// The values are not transformed in any way and thus are considered stable /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - FailoverRange::All => "ALL", - FailoverRange::Others => "OTHERS", - FailoverRange::OtherKeys => "OTHER_KEYS", + ClientType::Unknown => "UNKNOWN", + ClientType::Sdk => "SDK", + ClientType::Agent => "AGENT", } } /// Creates an enum from field names used in the ProtoBuf definition. pub fn from_str_name(value: &str) -> ::core::option::Option { match value { - "ALL" => Some(Self::All), - "OTHERS" => Some(Self::Others), - "OTHER_KEYS" => Some(Self::OtherKeys), + "UNKNOWN" => Some(Self::Unknown), + "SDK" => Some(Self::Sdk), + "AGENT" => Some(Self::Agent), _ => None, } } } } -/// MetadataRoutingConfig metadata routing configuration #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MetadataRoutingConfig { - /// service +pub struct StatInfo { + #[prost(message, optional, tag = "1")] + pub target: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "2")] + pub port: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub path: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "4")] + pub protocol: ::core::option::Option<::prost::alloc::string::String>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ServiceContract { + /// 契约ID #[prost(string, tag = "1")] - pub service: ::prost::alloc::string::String, - /// namespace + pub id: ::prost::alloc::string::String, + /// 契约名称 + /// deprecated, use type field #[prost(string, tag = "2")] - pub namespace: ::prost::alloc::string::String, - #[prost(map = "string, string", tag = "3")] - pub labels: ::std::collections::HashMap< - ::prost::alloc::string::String, - ::prost::alloc::string::String, - >, - /// When metadata not found, it will fall back to the - #[prost(message, optional, tag = "4")] - pub failover: ::core::option::Option, -} -/// RuleRoutingConfig routing configuration -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RuleRoutingConfig { - /// source source info - /// deprecated: only for compatible to the old version server - #[prost(message, repeated, tag = "1")] - pub sources: ::prost::alloc::vec::Vec, - /// destination destinations info - /// deprecated: only for compatible to the old version server - #[prost(message, repeated, tag = "2")] - pub destinations: ::prost::alloc::vec::Vec, - /// rule route chain - #[prost(message, repeated, tag = "3")] - pub rules: ::prost::alloc::vec::Vec, -} -/// SubRuleRouting sub routing configuration -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SubRuleRouting { - /// sub routing rule name - #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, - /// source source info - #[prost(message, repeated, tag = "2")] - pub sources: ::prost::alloc::vec::Vec, - /// destination destinations info - #[prost(message, repeated, tag = "3")] - pub destinations: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SourceService { - /// Main tuning service and namespace - #[prost(string, tag = "1")] - pub service: ::prost::alloc::string::String, - #[prost(string, tag = "2")] + /// 所属命名空间 + #[prost(string, tag = "3")] pub namespace: ::prost::alloc::string::String, - /// Master Control Service Example Tag or Request Label - /// Value supports regular matching - #[prost(message, repeated, tag = "3")] - pub arguments: ::prost::alloc::vec::Vec, + /// 所属服务名称 + #[prost(string, tag = "4")] + pub service: ::prost::alloc::string::String, + /// 协议,http/grpc/dubbo/thrift + #[prost(string, tag = "5")] + pub protocol: ::prost::alloc::string::String, + /// 契约版本 + #[prost(string, tag = "6")] + pub version: ::prost::alloc::string::String, + /// 信息摘要 + #[prost(string, tag = "7")] + pub revision: ::prost::alloc::string::String, + /// 额外描述 + #[prost(string, tag = "8")] + pub content: ::prost::alloc::string::String, + /// 接口描述信息 + #[prost(message, repeated, tag = "9")] + pub interfaces: ::prost::alloc::vec::Vec, + /// 创建时间 + #[prost(string, tag = "10")] + pub ctime: ::prost::alloc::string::String, + /// 更新时间 + #[prost(string, tag = "11")] + pub mtime: ::prost::alloc::string::String, + /// 接口状态,Offline/Online + #[prost(string, tag = "12")] + pub status: ::prost::alloc::string::String, + /// 类型 + #[prost(string, tag = "14")] + pub r#type: ::prost::alloc::string::String, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DestinationGroup { - /// Templated service and namespace +pub struct InterfaceDescriptor { + /// 接口ID #[prost(string, tag = "1")] - pub service: ::prost::alloc::string::String, + pub id: ::prost::alloc::string::String, + /// 方法名称,对应 http method/ dubbo interface func/grpc service func #[prost(string, tag = "2")] - pub namespace: ::prost::alloc::string::String, - /// Templated service example label - /// Value supports regular matching - #[prost(map = "string, message", tag = "3")] - pub labels: ::std::collections::HashMap<::prost::alloc::string::String, MatchString>, - /// According to the service name and service instance Metadata Filter the - /// qualified service instance subset Service instance subset can set priority - /// and weight Priority: integer, range [0, 9], the highest priority is 0 - /// Weight: Integer - /// Press priority routing, if there is high priority, low priority will not - /// use If there is a subset of the same priority, then assign by weight - /// Priority and weight can be not set / set up one / set two - /// If the section is set priority, some are not set, it is considered that the - /// priority is not set. If the part is set, some is not set, it is considered - /// that the weight is not set to 0 If you have no weight, you think the weight - /// is the same - #[prost(uint32, tag = "4")] - pub priority: u32, - #[prost(uint32, tag = "5")] - pub weight: u32, - /// Forward requests to proxy service + pub method: ::prost::alloc::string::String, + /// 接口名称,http path/dubbo interface/grpc service + #[prost(string, tag = "3")] + pub path: ::prost::alloc::string::String, + /// 接口描述信息 + #[prost(string, tag = "4")] + pub content: ::prost::alloc::string::String, + /// 创建来源 + #[prost(enumeration = "interface_descriptor::Source", tag = "5")] + pub source: i32, + /// 接口信息摘要 #[prost(string, tag = "6")] - pub transfer: ::prost::alloc::string::String, - /// Whether to isolate the SET, after isolation, no traffic will be allocated - #[prost(bool, tag = "7")] - pub isolate: bool, - /// name desition name + pub revision: ::prost::alloc::string::String, + /// 创建时间 + #[prost(string, tag = "7")] + pub ctime: ::prost::alloc::string::String, + /// 更新时间 #[prost(string, tag = "8")] + pub mtime: ::prost::alloc::string::String, + /// 接口名称描述信息 + /// deprecated, use type field + #[prost(string, tag = "9")] pub name: ::prost::alloc::string::String, -} -/// SourceMatch -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SourceMatch { - #[prost(enumeration = "source_match::Type", tag = "1")] - pub r#type: i32, - /// header key or query key - #[prost(string, tag = "2")] - pub key: ::prost::alloc::string::String, - /// header value or query value - #[prost(message, optional, tag = "3")] - pub value: ::core::option::Option, -} -/// Nested message and enum types in `SourceMatch`. -pub mod source_match { - /// label type for gateway request + /// 所属命名空间 + #[prost(string, tag = "10")] + pub namespace: ::prost::alloc::string::String, + /// 所属服务名称 + #[prost(string, tag = "11")] + pub service: ::prost::alloc::string::String, + /// 协议,http/grpc/dubbo/thrift + #[prost(string, tag = "12")] + pub protocol: ::prost::alloc::string::String, + /// 契约版本 + #[prost(string, tag = "13")] + pub version: ::prost::alloc::string::String, + /// 类型 + #[prost(string, tag = "14")] + pub r#type: ::prost::alloc::string::String, +} +/// Nested message and enum types in `InterfaceDescriptor`. +pub mod interface_descriptor { #[derive( Clone, Copy, @@ -712,176 +549,327 @@ pub mod source_match { ::prost::Enumeration )] #[repr(i32)] - pub enum Type { - /// custom arguments - Custom = 0, - /// method, match the http post/get/put/delete or grpc method - Method = 1, - /// header, match the http header, dubbo attachment, grpc header - Header = 2, - /// query, match the http query, dubbo argument - Query = 3, - /// caller host ip - CallerIp = 4, - /// path, math the http url - Path = 5, - /// cookie match http cookie - Cookie = 6, + pub enum Source { + Unknown = 0, + Manual = 1, + Client = 2, } - impl Type { + impl Source { /// String value of the enum field names used in the ProtoBuf definition. /// /// The values are not transformed in any way and thus are considered stable /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Type::Custom => "CUSTOM", - Type::Method => "METHOD", - Type::Header => "HEADER", - Type::Query => "QUERY", - Type::CallerIp => "CALLER_IP", - Type::Path => "PATH", - Type::Cookie => "COOKIE", + Source::Unknown => "UNKNOWN", + Source::Manual => "Manual", + Source::Client => "Client", } } /// Creates an enum from field names used in the ProtoBuf definition. pub fn from_str_name(value: &str) -> ::core::option::Option { match value { - "CUSTOM" => Some(Self::Custom), - "METHOD" => Some(Self::Method), - "HEADER" => Some(Self::Header), - "QUERY" => Some(Self::Query), - "CALLER_IP" => Some(Self::CallerIp), - "PATH" => Some(Self::Path), - "COOKIE" => Some(Self::Cookie), + "UNKNOWN" => Some(Self::Unknown), + "Manual" => Some(Self::Manual), + "Client" => Some(Self::Client), _ => None, } } } } -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum RoutingPolicy { - /// Route by rule rule => RuleRoutingConfig - RulePolicy = 0, - /// Route by destination metadata ==> MetadataRoutingConfig - MetadataPolicy = 1, +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DiscoverFilter { + #[prost(bool, tag = "1")] + pub only_healthy_instance: bool, } -impl RoutingPolicy { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - RoutingPolicy::RulePolicy => "RulePolicy", - RoutingPolicy::MetadataPolicy => "MetadataPolicy", - } +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DiscoverRequest { + #[prost(enumeration = "discover_request::DiscoverRequestType", tag = "1")] + pub r#type: i32, + #[prost(message, optional, tag = "2")] + pub service: ::core::option::Option, + #[prost(message, optional, tag = "30")] + pub filter: ::core::option::Option, +} +/// Nested message and enum types in `DiscoverRequest`. +pub mod discover_request { + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum DiscoverRequestType { + Unknown = 0, + Instance = 1, + Cluster = 2, + Routing = 3, + RateLimit = 4, + CircuitBreaker = 5, + Services = 6, + Namespaces = 12, + FaultDetector = 13, + Lane = 100, + /// 自定义路由规则 + CustomRouteRule = 101, + /// 就近路由规则 + NearbyRouteRule = 102, } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "RulePolicy" => Some(Self::RulePolicy), - "MetadataPolicy" => Some(Self::MetadataPolicy), - _ => None, + impl DiscoverRequestType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + DiscoverRequestType::Unknown => "UNKNOWN", + DiscoverRequestType::Instance => "INSTANCE", + DiscoverRequestType::Cluster => "CLUSTER", + DiscoverRequestType::Routing => "ROUTING", + DiscoverRequestType::RateLimit => "RATE_LIMIT", + DiscoverRequestType::CircuitBreaker => "CIRCUIT_BREAKER", + DiscoverRequestType::Services => "SERVICES", + DiscoverRequestType::Namespaces => "NAMESPACES", + DiscoverRequestType::FaultDetector => "FAULT_DETECTOR", + DiscoverRequestType::Lane => "LANE", + DiscoverRequestType::CustomRouteRule => "CUSTOM_ROUTE_RULE", + DiscoverRequestType::NearbyRouteRule => "NEARBY_ROUTE_RULE", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "UNKNOWN" => Some(Self::Unknown), + "INSTANCE" => Some(Self::Instance), + "CLUSTER" => Some(Self::Cluster), + "ROUTING" => Some(Self::Routing), + "RATE_LIMIT" => Some(Self::RateLimit), + "CIRCUIT_BREAKER" => Some(Self::CircuitBreaker), + "SERVICES" => Some(Self::Services), + "NAMESPACES" => Some(Self::Namespaces), + "FAULT_DETECTOR" => Some(Self::FaultDetector), + "LANE" => Some(Self::Lane), + "CUSTOM_ROUTE_RULE" => Some(Self::CustomRouteRule), + "NEARBY_ROUTE_RULE" => Some(Self::NearbyRouteRule), + _ => None, + } } } } -/// 同一服务下限流规则集合 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct RateLimit { - /// 限流规则集合 - #[prost(message, repeated, tag = "1")] - pub rules: ::prost::alloc::vec::Vec, - /// 限流规则汇总的revision信息 +pub struct Namespace { + #[prost(message, optional, tag = "1")] + pub name: ::core::option::Option<::prost::alloc::string::String>, #[prost(message, optional, tag = "2")] - pub revision: ::core::option::Option<::prost::alloc::string::String>, -} -/// 单个限流规则信息 + pub comment: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "3")] + pub owners: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "4")] + pub token: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "5")] + pub ctime: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "6")] + pub mtime: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "7")] + pub total_service_count: ::core::option::Option, + #[prost(message, optional, tag = "8")] + pub total_health_instance_count: ::core::option::Option, + #[prost(message, optional, tag = "9")] + pub total_instance_count: ::core::option::Option, + #[prost(message, repeated, tag = "10")] + pub user_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(message, repeated, tag = "11")] + pub group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(message, repeated, tag = "13")] + pub remove_user_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(message, repeated, tag = "14")] + pub remove_group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(message, optional, tag = "12")] + pub id: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "15")] + pub editable: ::core::option::Option, + #[prost(message, repeated, tag = "16")] + pub service_export_to: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// 规则所属服务以及命名空间 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct Rule { - /// 限流规则唯一标识 +pub struct Routing { #[prost(message, optional, tag = "1")] - pub id: ::core::option::Option<::prost::alloc::string::String>, - /// 限流规则所属服务名 - #[prost(message, optional, tag = "2")] pub service: ::core::option::Option<::prost::alloc::string::String>, - /// 限流规则所属命名空间 - #[prost(message, optional, tag = "3")] + #[prost(message, optional, tag = "2")] pub namespace: ::core::option::Option<::prost::alloc::string::String>, - /// 可选,SUBSET标识 - #[prost(map = "string, message", tag = "4")] - pub subset: ::std::collections::HashMap<::prost::alloc::string::String, MatchString>, - /// 限流规则优先级,0值最高 + /// 每个服务可以配置多条入站或者出站规则 + /// 对于每个请求,从上到下依次匹配,若命中则终止 + #[prost(message, repeated, tag = "3")] + pub inbounds: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "4")] + pub outbounds: ::prost::alloc::vec::Vec, #[prost(message, optional, tag = "5")] - pub priority: ::core::option::Option, - #[prost(enumeration = "rule::Resource", tag = "6")] - pub resource: i32, - #[prost(enumeration = "rule::Type", tag = "7")] - pub r#type: i32, - /// 业务标签集合,通过KV进行匹配,全部匹配才使用该规则 - #[prost(map = "string, message", tag = "8")] - pub labels: ::std::collections::HashMap<::prost::alloc::string::String, MatchString>, - /// 限流阈值 - /// 可以有多个粒度的配置(比如同时针对秒级,分钟级,天级),匹配一个则进行限流 - /// 全局限流模式下,该值为服务配额总量;单机限流模式下,该值为单个节点能处理的配额量 - #[prost(message, repeated, tag = "9")] - pub amounts: ::prost::alloc::vec::Vec, - /// 限流动作,对应着客户端的插件名字 - #[prost(message, optional, tag = "10")] - pub action: ::core::option::Option<::prost::alloc::string::String>, - /// 是否停用该限流规则,默认启用 - #[prost(message, optional, tag = "11")] - pub disable: ::core::option::Option, - /// 限流上报方式,同时支持按固定周期上报,以及达到配额百分比后上报 - #[prost(message, optional, tag = "12")] - pub report: ::core::option::Option, - /// 限流规则创建时间 - #[prost(message, optional, tag = "13")] pub ctime: ::core::option::Option<::prost::alloc::string::String>, - /// 限流规则修改时间 - #[prost(message, optional, tag = "14")] + #[prost(message, optional, tag = "6")] pub mtime: ::core::option::Option<::prost::alloc::string::String>, - /// 限流规则revision信息 - #[prost(message, optional, tag = "15")] + #[prost(message, optional, tag = "7")] pub revision: ::core::option::Option<::prost::alloc::string::String>, - /// 服务的TOKEN信息,仅用于控制台,discover接口不下发 - #[prost(message, optional, tag = "16")] + #[prost(message, optional, tag = "8")] pub service_token: ::core::option::Option<::prost::alloc::string::String>, - /// 配额调整算法 - #[prost(message, optional, tag = "17")] - pub adjuster: ::core::option::Option, - /// 通配符是否合并计算,默认分开计数 - #[prost(message, optional, tag = "18")] - pub regex_combine: ::core::option::Option, - #[prost(enumeration = "rule::AmountMode", tag = "19")] - pub amount_mode: i32, - #[prost(enumeration = "rule::FailoverType", tag = "20")] - pub failover: i32, - /// 分布式限流服务集群 - #[prost(message, optional, tag = "21")] - pub cluster: ::core::option::Option, - /// 被调接口名 - #[prost(message, optional, tag = "22")] - pub method: ::core::option::Option, - /// 被调的参数过滤条件,满足过滤条件才进入限流规则 - #[prost(message, repeated, tag = "23")] - pub arguments: ::prost::alloc::vec::Vec, - /// 限流规则名 - #[prost(message, optional, tag = "24")] + /// route rules for current service + #[prost(message, repeated, tag = "21")] + pub rules: ::prost::alloc::vec::Vec, +} +/// deprecated: only for compatible to the old version server +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Route { + /// 如果匹配Source规则,按照Destination路由 + /// 多个Source之间的关系为或 + #[prost(message, repeated, tag = "1")] + pub sources: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "2")] + pub destinations: ::prost::alloc::vec::Vec, + /// extendInfo 用于承载一些额外信息 + /// case 1: 升级到 v2 版本时,记录对应到 v2 版本的 id 信息 + #[prost(map = "string, string", tag = "3")] + pub extend_info: ::std::collections::HashMap< + ::prost::alloc::string::String, + ::prost::alloc::string::String, + >, +} +/// deprecated: only for compatible to the old version server +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Source { + /// 主调方服务以及命名空间 + #[prost(message, optional, tag = "1")] + pub service: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "2")] + pub namespace: ::core::option::Option<::prost::alloc::string::String>, + /// 主调方服务实例标签或者请求标签 + /// value支持正则匹配 + #[prost(map = "string, message", tag = "3")] + pub metadata: ::std::collections::HashMap< + ::prost::alloc::string::String, + MatchString, + >, +} +/// deprecated: only for compatible to the old version server +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Destination { + /// 被调方服务以及命名空间 + #[prost(message, optional, tag = "1")] + pub service: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "2")] + pub namespace: ::core::option::Option<::prost::alloc::string::String>, + /// 被调方服务实例标签 + /// value支持正则匹配 + #[prost(map = "string, message", tag = "3")] + pub metadata: ::std::collections::HashMap< + ::prost::alloc::string::String, + MatchString, + >, + /// 根据服务名和服务实例metadata筛选符合条件的服务实例子集 + /// 服务实例子集可以设置优先级和权重 + /// 优先级:整型,范围\[0, 9\],最高优先级为0 + /// 权重:整型 + /// 先按优先级路由,如果存在高优先级,不会使用低优先级 + /// 如果存在优先级相同的子集,再按权重分配 + /// 优先级和权重可以都不设置/设置一个/设置两个 + /// 如果部分设置优先级,部分没有设置,认为没有设置的优先级最低 + /// 如果部分设置权重,部分没有设置,认为没有设置的权重为0 + /// 如果全部没有设置权重,认为权重相同 + #[prost(message, optional, tag = "4")] + pub priority: ::core::option::Option, + #[prost(message, optional, tag = "5")] + pub weight: ::core::option::Option, + /// 将请求转发到代理服务 + #[prost(message, optional, tag = "6")] + pub transfer: ::core::option::Option<::prost::alloc::string::String>, + /// 是否对该set执行隔离,隔离后,不会再分配流量 + #[prost(message, optional, tag = "7")] + pub isolate: ::core::option::Option, + /// 实例分组名 + #[prost(message, optional, tag = "8")] pub name: ::core::option::Option<::prost::alloc::string::String>, - /// 限流规则启用时间 - #[prost(message, optional, tag = "25")] - pub etime: ::core::option::Option<::prost::alloc::string::String>, - /// 最大排队时长,单位秒 - #[prost(message, optional, tag = "26")] - pub max_queue_delay: ::core::option::Option, } -/// Nested message and enum types in `Rule`. -pub mod rule { - /// 限流资源 +/// configuration root for route +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RouteRule { + #[prost(string, tag = "1")] + pub id: ::prost::alloc::string::String, + /// route rule name + #[prost(string, tag = "2")] + pub name: ::prost::alloc::string::String, + /// namespace namingspace of routing rules + #[prost(string, tag = "3")] + pub namespace: ::prost::alloc::string::String, + /// Enable this router + #[prost(bool, tag = "4")] + pub enable: bool, + /// Router type + #[prost(enumeration = "RoutingPolicy", tag = "5")] + pub routing_policy: i32, + /// Routing configuration for router + #[prost(message, optional, tag = "6")] + pub routing_config: ::core::option::Option<::prost_types::Any>, + /// revision routing version + #[prost(string, tag = "7")] + pub revision: ::prost::alloc::string::String, + /// ctime create time of the rules + #[prost(string, tag = "8")] + pub ctime: ::prost::alloc::string::String, + /// mtime modify time of the rules + #[prost(string, tag = "9")] + pub mtime: ::prost::alloc::string::String, + /// etime enable time of the rules + #[prost(string, tag = "10")] + pub etime: ::prost::alloc::string::String, + /// priority rules priority + #[prost(uint32, tag = "11")] + pub priority: u32, + /// description simple description rules + #[prost(string, tag = "12")] + pub description: ::prost::alloc::string::String, + /// extendInfo 用于承载一些额外信息 + /// case 1: 升级到 v2 版本时,记录对应到 v1 版本的 id 信息 + /// deprecated_filed only for compatible to the old version server + #[prost(map = "string, string", tag = "20")] + pub extend_info: ::std::collections::HashMap< + ::prost::alloc::string::String, + ::prost::alloc::string::String, + >, + /// 路由规则标签数据 + #[prost(map = "string, string", tag = "50")] + pub metadata: ::std::collections::HashMap< + ::prost::alloc::string::String, + ::prost::alloc::string::String, + >, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MetadataFailover { + /// failover_range metadata route bottom type + #[prost(enumeration = "metadata_failover::FailoverRange", tag = "1")] + pub failover_range: i32, + /// only use to failover_range == OTHER_KEYS + #[prost(map = "string, string", tag = "2")] + pub labels: ::std::collections::HashMap< + ::prost::alloc::string::String, + ::prost::alloc::string::String, + >, +} +/// Nested message and enum types in `MetadataFailover`. +pub mod metadata_failover { #[derive( Clone, Copy, @@ -894,110 +882,78 @@ pub mod rule { ::prost::Enumeration )] #[repr(i32)] - pub enum Resource { - /// 针对QPS进行限流 - Qps = 0, - /// 针对并发数进行限流 - Concurrency = 1, - } - impl Resource { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Resource::Qps => "QPS", - Resource::Concurrency => "CONCURRENCY", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "QPS" => Some(Self::Qps), - "CONCURRENCY" => Some(Self::Concurrency), - _ => None, - } - } - } - /// 限流类型 - /// global全局限流(默认)或者local单机限流 - #[derive( - Clone, - Copy, - Debug, - PartialEq, - Eq, - Hash, - PartialOrd, - Ord, - ::prost::Enumeration - )] - #[repr(i32)] - pub enum Type { - Global = 0, - Local = 1, - } - impl Type { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Type::Global => "GLOBAL", - Type::Local => "LOCAL", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "GLOBAL" => Some(Self::Global), - "LOCAL" => Some(Self::Local), - _ => None, - } - } - } - /// 限流阈值模 - #[derive( - Clone, - Copy, - Debug, - PartialEq, - Eq, - Hash, - PartialOrd, - Ord, - ::prost::Enumeration - )] - #[repr(i32)] - pub enum AmountMode { - /// 总体阈值 - GlobalTotal = 0, - /// 单机均摊阈值 - ShareEqually = 1, + pub enum FailoverRange { + /// ALL return all instances + All = 0, + /// OTHERS retuen without thie labels instances + Others = 1, + /// OTHER_KEYS return other instances which match keys + OtherKeys = 2, } - impl AmountMode { + impl FailoverRange { /// String value of the enum field names used in the ProtoBuf definition. /// /// The values are not transformed in any way and thus are considered stable /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - AmountMode::GlobalTotal => "GLOBAL_TOTAL", - AmountMode::ShareEqually => "SHARE_EQUALLY", + FailoverRange::All => "ALL", + FailoverRange::Others => "OTHERS", + FailoverRange::OtherKeys => "OTHER_KEYS", } } /// Creates an enum from field names used in the ProtoBuf definition. pub fn from_str_name(value: &str) -> ::core::option::Option { match value { - "GLOBAL_TOTAL" => Some(Self::GlobalTotal), - "SHARE_EQUALLY" => Some(Self::ShareEqually), + "ALL" => Some(Self::All), + "OTHERS" => Some(Self::Others), + "OTHER_KEYS" => Some(Self::OtherKeys), _ => None, } } } - /// 与限流集群连接失败时降级模式 +} +/// MetadataRoutingConfig metadata routing configuration +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MetadataRoutingConfig { + /// service + #[prost(string, tag = "1")] + pub service: ::prost::alloc::string::String, + /// namespace + #[prost(string, tag = "2")] + pub namespace: ::prost::alloc::string::String, + #[prost(map = "string, string", tag = "3")] + pub labels: ::std::collections::HashMap< + ::prost::alloc::string::String, + ::prost::alloc::string::String, + >, + /// When metadata not found, it will fall back to the + #[prost(message, optional, tag = "4")] + pub failover: ::core::option::Option, +} +/// NearbyRoutingConfig routing configuration +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct NearbyRoutingConfig { + /// 被调服务名,支持*,代表全部服务 + #[prost(string, tag = "1")] + pub service: ::prost::alloc::string::String, + /// 被调命名空间 + #[prost(string, tag = "2")] + pub namespace: ::prost::alloc::string::String, + /// 默认就近级别 + #[prost(enumeration = "nearby_routing_config::LocationLevel", tag = "3")] + pub match_level: i32, + /// 最大就近级别 + #[prost(enumeration = "nearby_routing_config::LocationLevel", tag = "4")] + pub max_match_level: i32, + /// 是否强制就近 + #[prost(bool, tag = "5")] + pub strict_nearby: bool, +} +/// Nested message and enum types in `NearbyRoutingConfig`. +pub mod nearby_routing_config { #[derive( Clone, Copy, @@ -1010,37 +966,132 @@ pub mod rule { ::prost::Enumeration )] #[repr(i32)] - pub enum FailoverType { - /// 降级成本地阈值 - FailoverLocal = 0, - /// 降级成直接通过 - FailoverPass = 1, + pub enum LocationLevel { + /// 未知就近级别,等同于未定义级别 + Unknown = 0, + /// 机房就近级别 + Campus = 1, + /// 可用区就近级别 + Zone = 2, + /// 地域就近级别 + Region = 3, + /// 全局就近级别 + All = 4, } - impl FailoverType { + impl LocationLevel { /// String value of the enum field names used in the ProtoBuf definition. /// /// The values are not transformed in any way and thus are considered stable /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - FailoverType::FailoverLocal => "FAILOVER_LOCAL", - FailoverType::FailoverPass => "FAILOVER_PASS", + LocationLevel::Unknown => "UNKNOWN", + LocationLevel::Campus => "CAMPUS", + LocationLevel::Zone => "ZONE", + LocationLevel::Region => "REGION", + LocationLevel::All => "ALL", } } /// Creates an enum from field names used in the ProtoBuf definition. pub fn from_str_name(value: &str) -> ::core::option::Option { match value { - "FAILOVER_LOCAL" => Some(Self::FailoverLocal), - "FAILOVER_PASS" => Some(Self::FailoverPass), + "UNKNOWN" => Some(Self::Unknown), + "CAMPUS" => Some(Self::Campus), + "ZONE" => Some(Self::Zone), + "REGION" => Some(Self::Region), + "ALL" => Some(Self::All), _ => None, } } } } +/// RuleRoutingConfig routing configuration #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MatchArgument { - #[prost(enumeration = "match_argument::Type", tag = "1")] +pub struct RuleRoutingConfig { + /// source source info + /// deprecated_filed only for compatible to the old version server + #[deprecated] + #[prost(message, repeated, tag = "1")] + pub sources: ::prost::alloc::vec::Vec, + /// destination destinations info + /// deprecated_filed only for compatible to the old version server + #[deprecated] + #[prost(message, repeated, tag = "2")] + pub destinations: ::prost::alloc::vec::Vec, + /// rule route chain + #[prost(message, repeated, tag = "3")] + pub rules: ::prost::alloc::vec::Vec, +} +/// SubRuleRouting sub routing configuration +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SubRuleRouting { + /// sub routing rule name + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + /// source source info + #[prost(message, repeated, tag = "2")] + pub sources: ::prost::alloc::vec::Vec, + /// destination destinations info + #[prost(message, repeated, tag = "3")] + pub destinations: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SourceService { + /// Main tuning service and namespace + #[prost(string, tag = "1")] + pub service: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub namespace: ::prost::alloc::string::String, + /// Master Control Service Example Tag or Request Label + /// Value supports regular matching + #[prost(message, repeated, tag = "3")] + pub arguments: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DestinationGroup { + /// Templated service and namespace + #[prost(string, tag = "1")] + pub service: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub namespace: ::prost::alloc::string::String, + /// Templated service example label + /// Value supports regular matching + #[prost(map = "string, message", tag = "3")] + pub labels: ::std::collections::HashMap<::prost::alloc::string::String, MatchString>, + /// According to the service name and service instance Metadata Filter the + /// qualified service instance subset Service instance subset can set priority + /// and weight Priority: integer, range \[0, 9\], the highest priority is 0 + /// Weight: Integer + /// Press priority routing, if there is high priority, low priority will not + /// use If there is a subset of the same priority, then assign by weight + /// Priority and weight can be not set / set up one / set two + /// If the section is set priority, some are not set, it is considered that the + /// priority is not set. If the part is set, some is not set, it is considered + /// that the weight is not set to 0 If you have no weight, you think the weight + /// is the same + #[prost(uint32, tag = "4")] + pub priority: u32, + #[prost(uint32, tag = "5")] + pub weight: u32, + /// Forward requests to proxy service + #[prost(string, tag = "6")] + pub transfer: ::prost::alloc::string::String, + /// Whether to isolate the SET, after isolation, no traffic will be allocated + #[prost(bool, tag = "7")] + pub isolate: bool, + /// name desition name + #[prost(string, tag = "8")] + pub name: ::prost::alloc::string::String, +} +/// SourceMatch +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SourceMatch { + #[prost(enumeration = "source_match::Type", tag = "1")] pub r#type: i32, /// header key or query key #[prost(string, tag = "2")] @@ -1049,8 +1100,8 @@ pub struct MatchArgument { #[prost(message, optional, tag = "3")] pub value: ::core::option::Option, } -/// Nested message and enum types in `MatchArgument`. -pub mod match_argument { +/// Nested message and enum types in `SourceMatch`. +pub mod source_match { /// label type for gateway request #[derive( Clone, @@ -1073,10 +1124,14 @@ pub mod match_argument { Header = 2, /// query, match the http query, dubbo argument Query = 3, - /// caller service - CallerService = 4, /// caller host ip - CallerIp = 5, + CallerIp = 4, + /// path, math the http url + Path = 5, + /// cookie match http cookie + Cookie = 6, + /// indicate the caller instance metadata + CallerMetadata = 7, } impl Type { /// String value of the enum field names used in the ProtoBuf definition. @@ -1089,8 +1144,10 @@ pub mod match_argument { Type::Method => "METHOD", Type::Header => "HEADER", Type::Query => "QUERY", - Type::CallerService => "CALLER_SERVICE", Type::CallerIp => "CALLER_IP", + Type::Path => "PATH", + Type::Cookie => "COOKIE", + Type::CallerMetadata => "CALLER_METADATA", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -1100,287 +1157,144 @@ pub mod match_argument { "METHOD" => Some(Self::Method), "HEADER" => Some(Self::Header), "QUERY" => Some(Self::Query), - "CALLER_SERVICE" => Some(Self::CallerService), "CALLER_IP" => Some(Self::CallerIp), + "PATH" => Some(Self::Path), + "COOKIE" => Some(Self::Cookie), + "CALLER_METADATA" => Some(Self::CallerMetadata), _ => None, } } } } -/// 分布式限流服务集群 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RateLimitCluster { - #[prost(message, optional, tag = "1")] - pub service: ::core::option::Option<::prost::alloc::string::String>, - /// 限流规则所属命名空间 - #[prost(message, optional, tag = "2")] - pub namespace: ::core::option::Option<::prost::alloc::string::String>, +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum RoutingPolicy { + /// Route by rule rule => RuleRoutingConfig + RulePolicy = 0, + /// Route by destination metadata ==> MetadataRoutingConfig + MetadataPolicy = 1, } -/// 限流配额 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Amount { - /// 时间周期内的最大配额数 - #[prost(message, optional, tag = "1")] - pub max_amount: ::core::option::Option, - /// 配额生效的时间周期,必须大于等于1s - #[prost(message, optional, tag = "2")] - pub valid_duration: ::core::option::Option<::prost_types::Duration>, - /// 请求统计精度 - #[prost(message, optional, tag = "3")] - pub precision: ::core::option::Option, - /// 可选,起始限流阈值,爬坡起始值 - #[prost(message, optional, tag = "4")] - pub start_amount: ::core::option::Option, - /// 可选,最小限流阈值,降低时最小值 - #[prost(message, optional, tag = "5")] - pub min_amount: ::core::option::Option, -} -/// 限流上报方式 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Report { - /// 配额固定上报周期,单位毫秒 - #[prost(message, optional, tag = "1")] - pub interval: ::core::option::Option<::prost_types::Duration>, - /// 使用了百分之多少配额后启动一次实时上报,值范围(0,100] - #[prost(message, optional, tag = "2")] - pub amount_percent: ::core::option::Option, -} -/// 配额调整算法 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AmountAdjuster { - #[prost(message, optional, tag = "1")] - pub climb: ::core::option::Option, +impl RoutingPolicy { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + RoutingPolicy::RulePolicy => "RulePolicy", + RoutingPolicy::MetadataPolicy => "MetadataPolicy", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "RulePolicy" => Some(Self::RulePolicy), + "MetadataPolicy" => Some(Self::MetadataPolicy), + _ => None, + } + } } -/// 限流调整算法Climb相关配置 +/// 同一服务下限流规则集合 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ClimbConfig { - /// 是否开启 - #[prost(message, optional, tag = "1")] - pub enable: ::core::option::Option, - /// 限流数据统计配置 +pub struct RateLimit { + /// 限流规则集合 + #[prost(message, repeated, tag = "1")] + pub rules: ::prost::alloc::vec::Vec, + /// 限流规则汇总的revision信息 #[prost(message, optional, tag = "2")] - pub metric: ::core::option::Option, - /// 触发调整策略 - #[prost(message, optional, tag = "3")] - pub policy: ::core::option::Option, - /// 限流调整相关参数 - #[prost(message, optional, tag = "4")] - pub throttling: ::core::option::Option, -} -/// Nested message and enum types in `ClimbConfig`. -pub mod climb_config { - /// 限流数据统计配置 - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct MetricConfig { - /// 限流数据度量周期,默认60s - #[prost(message, optional, tag = "1")] - pub window: ::core::option::Option<::prost_types::Duration>, - /// 数据统计精度,决定数据度量的最小周期,度量滑窗的步长=window/precision - #[prost(message, optional, tag = "2")] - pub precision: ::core::option::Option, - /// 上报周期,默认20s - #[prost(message, optional, tag = "3")] - pub report_interval: ::core::option::Option<::prost_types::Duration>, - } - /// 触发调整的策略 - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct TriggerPolicy { - /// 按错误率阈值调整 - #[prost(message, optional, tag = "1")] - pub error_rate: ::core::option::Option, - /// 慢调用进行触发调整 - #[prost(message, optional, tag = "2")] - pub slow_rate: ::core::option::Option, - } - /// Nested message and enum types in `TriggerPolicy`. - pub mod trigger_policy { - /// 错误率触发调整配置 - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct ErrorRate { - /// 是否开启 - #[prost(message, optional, tag = "1")] - pub enable: ::core::option::Option, - /// 触发限流调整的最小的请求数 - #[prost(message, optional, tag = "2")] - pub request_volume_threshold: ::core::option::Option, - /// 触发限流的错误率配置 - #[prost(message, optional, tag = "3")] - pub error_rate: ::core::option::Option, - /// 针对部分错误码,使用额外的错误率统计,可设置多组特殊规则 - #[prost(message, repeated, tag = "4")] - pub specials: ::prost::alloc::vec::Vec, - } - /// Nested message and enum types in `ErrorRate`. - pub mod error_rate { - /// 特殊错误码触发调整配置 - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct SpecialConfig { - /// 自定义错误类型 - #[prost(message, optional, tag = "1")] - pub r#type: ::core::option::Option<::prost::alloc::string::String>, - /// 特定规则针对的错误码 - #[prost(message, repeated, tag = "2")] - pub error_codes: ::prost::alloc::vec::Vec, - /// 特定规则错误率 - #[prost(message, optional, tag = "3")] - pub error_rate: ::core::option::Option, - } - } - /// 慢调用触发调整配置 - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct SlowRate { - /// 是否开启 - #[prost(message, optional, tag = "1")] - pub enable: ::core::option::Option, - /// 最大响应时间,超过该响应时间属于慢调用 - #[prost(message, optional, tag = "2")] - pub max_rt: ::core::option::Option<::prost_types::Duration>, - /// 慢请求率阈值,达到该阈值进行限流 - #[prost(message, optional, tag = "3")] - pub slow_rate: ::core::option::Option, - } - } - /// 爬坡调整相关参数 - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct ClimbThrottling { - /// 冷水位以下区间的下调百分比 - #[prost(message, optional, tag = "1")] - pub cold_below_tune_down_rate: ::core::option::Option, - /// 冷水位以下区间的上调百分比 - #[prost(message, optional, tag = "2")] - pub cold_below_tune_up_rate: ::core::option::Option, - /// 冷水位以上区间的下调百分比 - #[prost(message, optional, tag = "3")] - pub cold_above_tune_down_rate: ::core::option::Option, - /// 冷水位以上区间的上调百分比 - #[prost(message, optional, tag = "4")] - pub cold_above_tune_up_rate: ::core::option::Option, - /// 冷水位以上,超过该百分的请求被限流后进行阈值上调 - #[prost(message, optional, tag = "5")] - pub limit_threshold_to_tune_up: ::core::option::Option, - /// 阈值调整规则的决策间隔 - #[prost(message, optional, tag = "6")] - pub judge_duration: ::core::option::Option<::prost_types::Duration>, - /// 阈值上调周期数,连续N个决策间隔都为上调,才执行上调 - #[prost(message, optional, tag = "7")] - pub tune_up_period: ::core::option::Option, - /// 阈值下调周期数,连续N个决策间隔都为下调,才执行下调 - #[prost(message, optional, tag = "8")] - pub tune_down_period: ::core::option::Option, - } + pub revision: ::core::option::Option<::prost::alloc::string::String>, } -/// 单个熔断规则定义 +/// 单个限流规则信息 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CircuitBreaker { - /// deprecated +pub struct Rule { + /// 限流规则唯一标识 #[prost(message, optional, tag = "1")] pub id: ::core::option::Option<::prost::alloc::string::String>, - /// 规则版本 - /// deprecated + /// 限流规则所属服务名 #[prost(message, optional, tag = "2")] - pub version: ::core::option::Option<::prost::alloc::string::String>, - /// 规则名 - /// deprecated + pub service: ::core::option::Option<::prost::alloc::string::String>, + /// 限流规则所属命名空间 #[prost(message, optional, tag = "3")] - pub name: ::core::option::Option<::prost::alloc::string::String>, - /// 规则命名空间 - /// deprecated - #[prost(message, optional, tag = "4")] pub namespace: ::core::option::Option<::prost::alloc::string::String>, - /// 规则所属服务 + /// 可选,SUBSET标识 + #[prost(map = "string, message", tag = "4")] + pub subset: ::std::collections::HashMap<::prost::alloc::string::String, MatchString>, + /// 限流规则优先级,0值最高 #[prost(message, optional, tag = "5")] - pub service: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "6")] - pub service_namespace: ::core::option::Option<::prost::alloc::string::String>, - /// 熔断规则可以分为被调规则和主调规则 - /// 被调规则针对所有的指定主调生效,假如不指定则对所有的主调生效 - /// 主调规则为当前主调方的规则,假如不指定则针对所有被调生效 - /// deprecated - #[prost(message, repeated, tag = "7")] - pub inbounds: ::prost::alloc::vec::Vec, - /// deprecated - #[prost(message, repeated, tag = "8")] - pub outbounds: ::prost::alloc::vec::Vec, - /// deprecated - #[prost(message, optional, tag = "9")] - pub token: ::core::option::Option<::prost::alloc::string::String>, - /// deprecated + pub priority: ::core::option::Option, + #[prost(enumeration = "rule::Resource", tag = "6")] + pub resource: i32, + #[prost(enumeration = "rule::Type", tag = "7")] + pub r#type: i32, + /// 业务标签集合,通过KV进行匹配,全部匹配才使用该规则 + #[prost(map = "string, message", tag = "8")] + pub labels: ::std::collections::HashMap<::prost::alloc::string::String, MatchString>, + /// 限流阈值 + /// 可以有多个粒度的配置(比如同时针对秒级,分钟级,天级),匹配一个则进行限流 + /// 全局限流模式下,该值为服务配额总量;单机限流模式下,该值为单个节点能处理的配额量 + #[prost(message, repeated, tag = "9")] + pub amounts: ::prost::alloc::vec::Vec, + /// 限流动作,对应着客户端的插件名字 #[prost(message, optional, tag = "10")] - pub owners: ::core::option::Option<::prost::alloc::string::String>, - /// 业务 - /// deprecated + pub action: ::core::option::Option<::prost::alloc::string::String>, + /// 是否停用该限流规则,默认启用 #[prost(message, optional, tag = "11")] - pub business: ::core::option::Option<::prost::alloc::string::String>, - /// 部门 - /// deprecated + pub disable: ::core::option::Option, + /// 限流上报方式,同时支持按固定周期上报,以及达到配额百分比后上报 #[prost(message, optional, tag = "12")] - pub department: ::core::option::Option<::prost::alloc::string::String>, - /// 规则描述 - /// deprecated + pub report: ::core::option::Option, + /// 限流规则创建时间 #[prost(message, optional, tag = "13")] - pub comment: ::core::option::Option<::prost::alloc::string::String>, - /// deprecated - #[prost(message, optional, tag = "14")] pub ctime: ::core::option::Option<::prost::alloc::string::String>, - /// deprecated - #[prost(message, optional, tag = "15")] - pub mtime: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "16")] + /// 限流规则修改时间 + #[prost(message, optional, tag = "14")] + pub mtime: ::core::option::Option<::prost::alloc::string::String>, + /// 限流规则revision信息 + #[prost(message, optional, tag = "15")] pub revision: ::core::option::Option<::prost::alloc::string::String>, - /// circuitbreaker rules for current service - #[prost(message, repeated, tag = "21")] - pub rules: ::prost::alloc::vec::Vec, -} -/// 主调匹配规则 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SourceMatcher { - /// 主调命名空间以及服务名,可以为*,代表全匹配 - #[prost(message, optional, tag = "1")] - pub service: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "2")] - pub namespace: ::core::option::Option<::prost::alloc::string::String>, - /// 可选,主调业务标签,用于匹配是否使用该熔断规则,可放置用户的接口信息等 - #[prost(map = "string, message", tag = "3")] - pub labels: ::std::collections::HashMap<::prost::alloc::string::String, MatchString>, -} -/// 熔断恢复配置 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RecoverConfig { - /// 触发熔断后到半开状态之间的等待间隔 - #[prost(message, optional, tag = "1")] - pub sleep_window: ::core::option::Option<::prost_types::Duration>, - /// 半开后,最多重试多少次恢复 - #[prost(message, optional, tag = "2")] - pub max_retry_after_half_open: ::core::option::Option, - /// 半开后放量的最大百分比 - #[prost(message, repeated, tag = "3")] - pub request_rate_after_half_open: ::prost::alloc::vec::Vec, - /// 熔断器半开到关闭所必须的最少成功率,默认100% - #[prost(message, optional, tag = "4")] - pub success_rate_to_close: ::core::option::Option, - /// 半开后最大放量数(用户不配置最大百分比时默认使用该配置) - #[prost(message, optional, tag = "5")] - pub request_count_after_half_open: ::core::option::Option, - #[prost(enumeration = "recover_config::OutlierDetectWhen", tag = "6")] - pub outlier_detect_when: i32, + /// 服务的TOKEN信息,仅用于控制台,discover接口不下发 + #[prost(message, optional, tag = "16")] + pub service_token: ::core::option::Option<::prost::alloc::string::String>, + /// 配额调整算法 + #[prost(message, optional, tag = "17")] + pub adjuster: ::core::option::Option, + /// 通配符是否合并计算,默认分开计数 + #[prost(message, optional, tag = "18")] + pub regex_combine: ::core::option::Option, + #[prost(enumeration = "rule::AmountMode", tag = "19")] + pub amount_mode: i32, + #[prost(enumeration = "rule::FailoverType", tag = "20")] + pub failover: i32, + /// 分布式限流服务集群 + #[prost(message, optional, tag = "21")] + pub cluster: ::core::option::Option, + /// 被调接口名 + #[prost(message, optional, tag = "22")] + pub method: ::core::option::Option, + /// 被调的参数过滤条件,满足过滤条件才进入限流规则 + #[prost(message, repeated, tag = "23")] + pub arguments: ::prost::alloc::vec::Vec, + /// 限流规则名 + #[prost(message, optional, tag = "24")] + pub name: ::core::option::Option<::prost::alloc::string::String>, + /// 限流规则启用时间 + #[prost(message, optional, tag = "25")] + pub etime: ::core::option::Option<::prost::alloc::string::String>, + /// 最大排队时长,单位秒 + #[prost(message, optional, tag = "26")] + pub max_queue_delay: ::core::option::Option, + /// 限流规则标签数据 + #[prost(map = "string, string", tag = "50")] + pub metadata: ::std::collections::HashMap< + ::prost::alloc::string::String, + ::prost::alloc::string::String, + >, } -/// Nested message and enum types in `RecoverConfig`. -pub mod recover_config { - /// 主动探测配置 +/// Nested message and enum types in `Rule`. +pub mod rule { + /// 限流资源 #[derive( Clone, Copy, @@ -1393,173 +1307,34 @@ pub mod recover_config { ::prost::Enumeration )] #[repr(i32)] - pub enum OutlierDetectWhen { - /// 不开启监控探测 - Never = 0, - /// 只有在熔断恢复时才开启健康探测 - OnRecover = 1, - /// 一直开启健康探测 - Always = 2, + pub enum Resource { + /// 针对QPS进行限流 + Qps = 0, + /// 针对并发数进行限流 + Concurrency = 1, } - impl OutlierDetectWhen { + impl Resource { /// String value of the enum field names used in the ProtoBuf definition. /// /// The values are not transformed in any way and thus are considered stable /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - OutlierDetectWhen::Never => "NEVER", - OutlierDetectWhen::OnRecover => "ON_RECOVER", - OutlierDetectWhen::Always => "ALWAYS", + Resource::Qps => "QPS", + Resource::Concurrency => "CONCURRENCY", } } /// Creates an enum from field names used in the ProtoBuf definition. pub fn from_str_name(value: &str) -> ::core::option::Option { match value { - "NEVER" => Some(Self::Never), - "ON_RECOVER" => Some(Self::OnRecover), - "ALWAYS" => Some(Self::Always), + "QPS" => Some(Self::Qps), + "CONCURRENCY" => Some(Self::Concurrency), _ => None, } } } -} -/// 熔断策略 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CbPolicy { - #[prost(message, optional, tag = "1")] - pub error_rate: ::core::option::Option, - #[prost(message, optional, tag = "2")] - pub slow_rate: ::core::option::Option, - /// 熔断的决策周期,多久触发一次熔断决策 - #[prost(message, optional, tag = "3")] - pub judge_duration: ::core::option::Option<::prost_types::Duration>, - /// 最大熔断比例,超过多少比例后不会继续熔断 - #[prost(message, optional, tag = "4")] - pub max_ejection_percent: ::core::option::Option, - #[prost(message, optional, tag = "5")] - pub consecutive: ::core::option::Option, -} -/// Nested message and enum types in `CbPolicy`. -pub mod cb_policy { - /// 错误率熔断配置 - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct ErrRateConfig { - /// 是否启用错误率配置 - #[prost(message, optional, tag = "1")] - pub enable: ::core::option::Option, - /// 触发错误率熔断的最低请求阈值 - #[prost(message, optional, tag = "2")] - pub request_volume_threshold: ::core::option::Option, - /// 可选。触发保持状态的错误率阈值,假如不配置,则默认不会进入Preserved状态 - #[prost(message, optional, tag = "3")] - pub error_rate_to_preserved: ::core::option::Option, - /// 触发熔断的错误率阈值 - #[prost(message, optional, tag = "4")] - pub error_rate_to_open: ::core::option::Option, - #[prost(message, repeated, tag = "5")] - pub specials: ::prost::alloc::vec::Vec, - } - /// Nested message and enum types in `ErrRateConfig`. - pub mod err_rate_config { - /// 错误码相关特定配置 - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct SpecialConfig { - /// 熔断关心的错误类型,用户可以自己定义 - #[prost(message, optional, tag = "1")] - pub r#type: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, repeated, tag = "2")] - pub error_codes: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "3")] - pub error_rate_to_preserved: ::core::option::Option, - #[prost(message, optional, tag = "4")] - pub error_rate_to_open: ::core::option::Option, - } - } - /// 慢调用率熔断策略配置 - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct SlowRateConfig { - /// 是否启用慢调用率配置 - #[prost(message, optional, tag = "1")] - pub enable: ::core::option::Option, - /// 最大响应时间,超过该时间属于慢调用请求 - #[prost(message, optional, tag = "2")] - pub max_rt: ::core::option::Option<::prost_types::Duration>, - /// 可选。触发保持状态的超时率阈值,假如不配置,则默认不会进入Preserved状态 - #[prost(message, optional, tag = "3")] - pub slow_rate_to_preserved: ::core::option::Option, - /// 触发熔断的超时率阈值 - #[prost(message, optional, tag = "4")] - pub slow_rate_to_open: ::core::option::Option, - } - /// 连续错误数熔断配置 - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct ConsecutiveErrConfig { - /// 是否启用连续错误数配置 - #[prost(message, optional, tag = "1")] - pub enable: ::core::option::Option, - /// 连续错误数阈值,进入Preserved状态 - #[prost(message, optional, tag = "2")] - pub consecutive_error_to_preserved: ::core::option::Option, - /// 连续错误数阈值,进入Open状态 - #[prost(message, optional, tag = "3")] - pub consecutive_error_to_open: ::core::option::Option, - } -} -/// 目标set的规则 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DestinationSet { - /// 被调命名空间以及服务名,可以为*,代表全匹配 - #[prost(message, optional, tag = "1")] - pub service: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "2")] - pub namespace: ::core::option::Option<::prost::alloc::string::String>, - /// 可选,SUBSET标识 - #[prost(map = "string, message", tag = "3")] - pub metadata: ::std::collections::HashMap< - ::prost::alloc::string::String, - MatchString, - >, - #[prost(enumeration = "destination_set::Resource", tag = "4")] - pub resource: i32, - #[prost(enumeration = "destination_set::Type", tag = "5")] - pub r#type: i32, - #[prost(enumeration = "destination_set::Scope", tag = "6")] - pub scope: i32, - /// 熔断数据度量周期 - /// 所有的阈值指标按此周期进行统计 - #[prost(message, optional, tag = "7")] - pub metric_window: ::core::option::Option<::prost_types::Duration>, - /// 熔断数据统计精度,决定数据度量的最小周期 - /// 度量滑窗的步长=window/precision - #[prost(message, optional, tag = "8")] - pub metric_precision: ::core::option::Option, - /// 熔断数据上报周期,对分布式熔断有效 - #[prost(message, optional, tag = "9")] - pub update_interval: ::core::option::Option<::prost_types::Duration>, - /// 触发熔断后恢复配置 - #[prost(message, optional, tag = "10")] - pub recover: ::core::option::Option, - /// 熔断策略 - #[prost(message, optional, tag = "11")] - pub policy: ::core::option::Option, - /// 被调的接口信息,指定哪些接口会使用该规则 - #[prost(message, optional, tag = "12")] - pub method: ::core::option::Option, - /// 返回码,指定哪些返回码会使用该规则 - #[prost(message, repeated, tag = "13")] - pub error_codes: ::prost::alloc::vec::Vec, -} -/// Nested message and enum types in `DestinationSet`. -pub mod destination_set { - /// 需要进行熔断的资源 - /// 支持SUBSET(子集群),以及INSTANCE(单个实例),默认为SUBSET + /// 限流类型 + /// global全局限流(默认)或者local单机限流 #[derive( Clone, Copy, @@ -1572,49 +1347,9 @@ pub mod destination_set { ::prost::Enumeration )] #[repr(i32)] - pub enum Resource { - /// 针对实例分组进行熔断 - Subset = 0, - /// 针对实例进行熔断 - Instance = 1, - } - impl Resource { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Resource::Subset => "SUBSET", - Resource::Instance => "INSTANCE", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "SUBSET" => Some(Self::Subset), - "INSTANCE" => Some(Self::Instance), - _ => None, - } - } - } - /// 熔断决策类型,支持GLOBAL(分布式决策)以及LOCAL(本地决策),默认GLOBAL - /// 当指定为GLOBAL时,则会定期上报统计数据并根据汇总数据进行熔断决策 - #[derive( - Clone, - Copy, - Debug, - PartialEq, - Eq, - Hash, - PartialOrd, - Ord, - ::prost::Enumeration - )] - #[repr(i32)] - pub enum Type { - Global = 0, - Local = 1, + pub enum Type { + Global = 0, + Local = 1, } impl Type { /// String value of the enum field names used in the ProtoBuf definition. @@ -1636,7 +1371,7 @@ pub mod destination_set { } } } - /// 熔断范围,是否扩散针对相同服务下所有接口进行熔断 + /// 限流阈值模 #[derive( Clone, Copy, @@ -1649,139 +1384,33 @@ pub mod destination_set { ::prost::Enumeration )] #[repr(i32)] - pub enum Scope { - /// 触发熔断条件,扩散熔断所有接口 - All = 0, - /// 触发熔断条件,只熔断当前接口 - Current = 1, + pub enum AmountMode { + /// 总体阈值 + GlobalTotal = 0, + /// 单机均摊阈值 + ShareEqually = 1, } - impl Scope { + impl AmountMode { /// String value of the enum field names used in the ProtoBuf definition. /// /// The values are not transformed in any way and thus are considered stable /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Scope::All => "ALL", - Scope::Current => "CURRENT", + AmountMode::GlobalTotal => "GLOBAL_TOTAL", + AmountMode::ShareEqually => "SHARE_EQUALLY", } } /// Creates an enum from field names used in the ProtoBuf definition. pub fn from_str_name(value: &str) -> ::core::option::Option { match value { - "ALL" => Some(Self::All), - "CURRENT" => Some(Self::Current), + "GLOBAL_TOTAL" => Some(Self::GlobalTotal), + "SHARE_EQUALLY" => Some(Self::ShareEqually), _ => None, } } } -} -/// 具体熔断规则 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CbRule { - /// 如果匹配Source规则,按照Destination进行熔断 - /// 多个Source之间的关系为或 - #[prost(message, repeated, tag = "1")] - pub sources: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "2")] - pub destinations: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RuleMatcher { - #[prost(message, optional, tag = "1")] - pub source: ::core::option::Option, - #[prost(message, optional, tag = "2")] - pub destination: ::core::option::Option, -} -/// Nested message and enum types in `RuleMatcher`. -pub mod rule_matcher { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct SourceService { - #[prost(string, tag = "1")] - pub service: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub namespace: ::prost::alloc::string::String, - } - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct DestinationService { - #[prost(string, tag = "1")] - pub service: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub namespace: ::prost::alloc::string::String, - #[prost(message, optional, tag = "3")] - pub method: ::core::option::Option, - } -} -/// new specific rule for circuitbreaker config -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CircuitBreakerRule { - #[prost(string, tag = "1")] - pub id: ::prost::alloc::string::String, - /// rule name - #[prost(string, tag = "2")] - pub name: ::prost::alloc::string::String, - /// namespace of rule - #[prost(string, tag = "3")] - pub namespace: ::prost::alloc::string::String, - /// enable this router - #[prost(bool, tag = "4")] - pub enable: bool, - /// revision routing version - #[prost(string, tag = "5")] - pub revision: ::prost::alloc::string::String, - /// ctime create time of the rules - #[prost(string, tag = "6")] - pub ctime: ::prost::alloc::string::String, - /// mtime modify time of the rules - #[prost(string, tag = "7")] - pub mtime: ::prost::alloc::string::String, - /// etime enable time of the rules - #[prost(string, tag = "8")] - pub etime: ::prost::alloc::string::String, - /// description simple description rules - #[prost(string, tag = "9")] - pub description: ::prost::alloc::string::String, - /// the circuitbreaking level - #[prost(enumeration = "Level", tag = "21")] - pub level: i32, - /// match condition for this rule - #[prost(message, optional, tag = "22")] - pub rule_matcher: ::core::option::Option, - /// error conditions to judge an invocation as an error - #[prost(message, repeated, tag = "23")] - pub error_conditions: ::prost::alloc::vec::Vec, - /// trigger condition to trigger circuitbreaking - #[prost(message, repeated, tag = "24")] - pub trigger_condition: ::prost::alloc::vec::Vec, - /// the maximum % of an upstream cluster that can be ejected - #[prost(uint32, tag = "25")] - pub max_ejection_percent: u32, - /// recover condition to make resource open to close - #[prost(message, optional, tag = "26")] - pub recover_condition: ::core::option::Option, - /// fault detection enable config - #[prost(message, optional, tag = "27")] - pub fault_detect_config: ::core::option::Option, - /// fall back configuration - #[prost(message, optional, tag = "28")] - pub fallback_config: ::core::option::Option, -} -/// the condition to judge an input invocation as an error -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ErrorCondition { - #[prost(enumeration = "error_condition::InputType", tag = "1")] - pub input_type: i32, - #[prost(message, optional, tag = "2")] - pub condition: ::core::option::Option, -} -/// Nested message and enum types in `ErrorCondition`. -pub mod error_condition { + /// 与限流集群连接失败时降级模式 #[derive( Clone, Copy, @@ -1794,51 +1423,48 @@ pub mod error_condition { ::prost::Enumeration )] #[repr(i32)] - pub enum InputType { - Unknown = 0, - RetCode = 1, - Delay = 2, + pub enum FailoverType { + /// 降级成本地阈值 + FailoverLocal = 0, + /// 降级成直接通过 + FailoverPass = 1, } - impl InputType { + impl FailoverType { /// String value of the enum field names used in the ProtoBuf definition. /// /// The values are not transformed in any way and thus are considered stable /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - InputType::Unknown => "UNKNOWN", - InputType::RetCode => "RET_CODE", - InputType::Delay => "DELAY", + FailoverType::FailoverLocal => "FAILOVER_LOCAL", + FailoverType::FailoverPass => "FAILOVER_PASS", } } /// Creates an enum from field names used in the ProtoBuf definition. pub fn from_str_name(value: &str) -> ::core::option::Option { match value { - "UNKNOWN" => Some(Self::Unknown), - "RET_CODE" => Some(Self::RetCode), - "DELAY" => Some(Self::Delay), + "FAILOVER_LOCAL" => Some(Self::FailoverLocal), + "FAILOVER_PASS" => Some(Self::FailoverPass), _ => None, } } } } -/// the error condition to trigger circuitbreaking #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct TriggerCondition { - #[prost(enumeration = "trigger_condition::TriggerType", tag = "1")] - pub trigger_type: i32, - #[prost(uint32, tag = "2")] - pub error_count: u32, - #[prost(uint32, tag = "3")] - pub error_percent: u32, - #[prost(uint32, tag = "4")] - pub interval: u32, - #[prost(uint32, tag = "5")] - pub minimum_request: u32, +pub struct MatchArgument { + #[prost(enumeration = "match_argument::Type", tag = "1")] + pub r#type: i32, + /// header key or query key + #[prost(string, tag = "2")] + pub key: ::prost::alloc::string::String, + /// header value or query value + #[prost(message, optional, tag = "3")] + pub value: ::core::option::Option, } -/// Nested message and enum types in `TriggerCondition`. -pub mod trigger_condition { +/// Nested message and enum types in `MatchArgument`. +pub mod match_argument { + /// label type for gateway request #[derive( Clone, Copy, @@ -1851,283 +1477,323 @@ pub mod trigger_condition { ::prost::Enumeration )] #[repr(i32)] - pub enum TriggerType { - Unknown = 0, - ErrorRate = 1, - ConsecutiveError = 2, + pub enum Type { + /// custom arguments + Custom = 0, + /// method, match the http post/get/put/delete or grpc method + Method = 1, + /// header, match the http header, dubbo attachment, grpc header + Header = 2, + /// query, match the http query, dubbo argument + Query = 3, + /// caller service + CallerService = 4, + /// caller host ip + CallerIp = 5, } - impl TriggerType { + impl Type { /// String value of the enum field names used in the ProtoBuf definition. /// /// The values are not transformed in any way and thus are considered stable /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - TriggerType::Unknown => "UNKNOWN", - TriggerType::ErrorRate => "ERROR_RATE", - TriggerType::ConsecutiveError => "CONSECUTIVE_ERROR", + Type::Custom => "CUSTOM", + Type::Method => "METHOD", + Type::Header => "HEADER", + Type::Query => "QUERY", + Type::CallerService => "CALLER_SERVICE", + Type::CallerIp => "CALLER_IP", } } /// Creates an enum from field names used in the ProtoBuf definition. pub fn from_str_name(value: &str) -> ::core::option::Option { match value { - "UNKNOWN" => Some(Self::Unknown), - "ERROR_RATE" => Some(Self::ErrorRate), - "CONSECUTIVE_ERROR" => Some(Self::ConsecutiveError), + "CUSTOM" => Some(Self::Custom), + "METHOD" => Some(Self::Method), + "HEADER" => Some(Self::Header), + "QUERY" => Some(Self::Query), + "CALLER_SERVICE" => Some(Self::CallerService), + "CALLER_IP" => Some(Self::CallerIp), _ => None, } } } } +/// 分布式限流服务集群 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct RecoverCondition { - /// seconds from open to half-open - #[prost(uint32, tag = "1")] - pub sleep_window: u32, - /// consecutive success request to recover - #[prost(uint32, tag = "2")] - pub consecutive_success: u32, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct FaultDetectConfig { - #[prost(bool, tag = "1")] - pub enable: bool, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct FallbackConfig { - #[prost(bool, tag = "1")] - pub enable: bool, +pub struct RateLimitCluster { + #[prost(message, optional, tag = "1")] + pub service: ::core::option::Option<::prost::alloc::string::String>, + /// 限流规则所属命名空间 #[prost(message, optional, tag = "2")] - pub response: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct FallbackResponse { - #[prost(int32, tag = "1")] - pub code: i32, - #[prost(message, repeated, tag = "2")] - pub headers: ::prost::alloc::vec::Vec, - #[prost(string, tag = "3")] - pub body: ::prost::alloc::string::String, -} -/// Nested message and enum types in `FallbackResponse`. -pub mod fallback_response { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct MessageHeader { - #[prost(string, tag = "1")] - pub key: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub value: ::prost::alloc::string::String, - } -} -/// circuitbreaking level -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum Level { - Unknown = 0, - /// service level circuitbreaking - Service = 1, - /// method level circuitbreaking - Method = 2, - /// group level circuitbreaking - Group = 3, - /// instance level circuitbreaking - Instance = 4, -} -impl Level { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Level::Unknown => "UNKNOWN", - Level::Service => "SERVICE", - Level::Method => "METHOD", - Level::Group => "GROUP", - Level::Instance => "INSTANCE", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "UNKNOWN" => Some(Self::Unknown), - "SERVICE" => Some(Self::Service), - "METHOD" => Some(Self::Method), - "GROUP" => Some(Self::Group), - "INSTANCE" => Some(Self::Instance), - _ => None, - } - } + pub namespace: ::core::option::Option<::prost::alloc::string::String>, } +/// 限流配额 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct Client { +pub struct Amount { + /// 时间周期内的最大配额数 #[prost(message, optional, tag = "1")] - pub host: ::core::option::Option<::prost::alloc::string::String>, - #[prost(enumeration = "client::ClientType", tag = "2")] - pub r#type: i32, + pub max_amount: ::core::option::Option, + /// 配额生效的时间周期,必须大于等于1s + #[prost(message, optional, tag = "2")] + pub valid_duration: ::core::option::Option<::prost_types::Duration>, + /// 请求统计精度 #[prost(message, optional, tag = "3")] - pub version: ::core::option::Option<::prost::alloc::string::String>, + pub precision: ::core::option::Option, + /// 可选,起始限流阈值,爬坡起始值 #[prost(message, optional, tag = "4")] - pub location: ::core::option::Option, + pub start_amount: ::core::option::Option, + /// 可选,最小限流阈值,降低时最小值 #[prost(message, optional, tag = "5")] - pub id: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, repeated, tag = "6")] - pub stat: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "7")] - pub ctime: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "8")] - pub mtime: ::core::option::Option<::prost::alloc::string::String>, -} -/// Nested message and enum types in `Client`. -pub mod client { - #[derive( - Clone, - Copy, - Debug, - PartialEq, - Eq, - Hash, - PartialOrd, - Ord, - ::prost::Enumeration - )] - #[repr(i32)] - pub enum ClientType { - Unknown = 0, - Sdk = 1, - Agent = 2, - } - impl ClientType { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - ClientType::Unknown => "UNKNOWN", - ClientType::Sdk => "SDK", - ClientType::Agent => "AGENT", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "UNKNOWN" => Some(Self::Unknown), - "SDK" => Some(Self::Sdk), - "AGENT" => Some(Self::Agent), - _ => None, - } - } - } + pub min_amount: ::core::option::Option, } +/// 限流上报方式 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct StatInfo { +pub struct Report { + /// 配额固定上报周期,单位毫秒 #[prost(message, optional, tag = "1")] - pub target: ::core::option::Option<::prost::alloc::string::String>, + pub interval: ::core::option::Option<::prost_types::Duration>, + /// 使用了百分之多少配额后启动一次实时上报,值范围(0,100] #[prost(message, optional, tag = "2")] - pub port: ::core::option::Option, - #[prost(message, optional, tag = "3")] - pub path: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "4")] - pub protocol: ::core::option::Option<::prost::alloc::string::String>, + pub amount_percent: ::core::option::Option, } +/// 配额调整算法 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ConfigRelease { +pub struct AmountAdjuster { #[prost(message, optional, tag = "1")] - pub service: ::core::option::Option, - #[prost(message, optional, tag = "2")] - pub ctime: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "3")] - pub mtime: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "4")] - pub circuit_breaker: ::core::option::Option, + pub climb: ::core::option::Option, } +/// 限流调整算法Climb相关配置 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ConfigWithService { - #[prost(message, repeated, tag = "1")] - pub services: ::prost::alloc::vec::Vec, +pub struct ClimbConfig { + /// 是否开启 + #[prost(message, optional, tag = "1")] + pub enable: ::core::option::Option, + /// 限流数据统计配置 #[prost(message, optional, tag = "2")] - pub circuit_breaker: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct FaultDetector { - /// fault detect rules for current service - #[prost(message, repeated, tag = "1")] - pub rules: ::prost::alloc::vec::Vec, - /// total revision for the fault detect rules - #[prost(string, tag = "2")] - pub revision: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct FaultDetectRule { - #[prost(string, tag = "1")] - pub id: ::prost::alloc::string::String, - /// rule name - #[prost(string, tag = "2")] - pub name: ::prost::alloc::string::String, - /// namespace of rule - #[prost(string, tag = "3")] - pub namespace: ::prost::alloc::string::String, - /// revision routing version - #[prost(string, tag = "4")] - pub revision: ::prost::alloc::string::String, - /// ctime create time of the rules - #[prost(string, tag = "5")] - pub ctime: ::prost::alloc::string::String, - /// mtime modify time of the rules - #[prost(string, tag = "6")] - pub mtime: ::prost::alloc::string::String, - /// description simple description rules - #[prost(string, tag = "7")] - pub description: ::prost::alloc::string::String, - /// detect target - #[prost(message, optional, tag = "21")] - pub target_service: ::core::option::Option, - /// detect interval - #[prost(uint32, tag = "22")] - pub interval: u32, - /// detect timeout - #[prost(uint32, tag = "23")] - pub timeout: u32, - /// detect port - #[prost(uint32, tag = "24")] - pub port: u32, - #[prost(enumeration = "fault_detect_rule::Protocol", tag = "25")] - pub protocol: i32, - /// http detect config - #[prost(message, optional, tag = "26")] - pub http_config: ::core::option::Option, - /// tcp detect config - #[prost(message, optional, tag = "27")] - pub tcp_config: ::core::option::Option, - /// udp detect config - #[prost(message, optional, tag = "28")] - pub udp_config: ::core::option::Option, + pub metric: ::core::option::Option, + /// 触发调整策略 + #[prost(message, optional, tag = "3")] + pub policy: ::core::option::Option, + /// 限流调整相关参数 + #[prost(message, optional, tag = "4")] + pub throttling: ::core::option::Option, } -/// Nested message and enum types in `FaultDetectRule`. -pub mod fault_detect_rule { +/// Nested message and enum types in `ClimbConfig`. +pub mod climb_config { + /// 限流数据统计配置 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] - pub struct DestinationService { - #[prost(string, tag = "1")] - pub service: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub namespace: ::prost::alloc::string::String, + pub struct MetricConfig { + /// 限流数据度量周期,默认60s + #[prost(message, optional, tag = "1")] + pub window: ::core::option::Option<::prost_types::Duration>, + /// 数据统计精度,决定数据度量的最小周期,度量滑窗的步长=window/precision + #[prost(message, optional, tag = "2")] + pub precision: ::core::option::Option, + /// 上报周期,默认20s #[prost(message, optional, tag = "3")] - pub method: ::core::option::Option, + pub report_interval: ::core::option::Option<::prost_types::Duration>, } - /// detect protocol + /// 触发调整的策略 + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct TriggerPolicy { + /// 按错误率阈值调整 + #[prost(message, optional, tag = "1")] + pub error_rate: ::core::option::Option, + /// 慢调用进行触发调整 + #[prost(message, optional, tag = "2")] + pub slow_rate: ::core::option::Option, + } + /// Nested message and enum types in `TriggerPolicy`. + pub mod trigger_policy { + /// 错误率触发调整配置 + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct ErrorRate { + /// 是否开启 + #[prost(message, optional, tag = "1")] + pub enable: ::core::option::Option, + /// 触发限流调整的最小的请求数 + #[prost(message, optional, tag = "2")] + pub request_volume_threshold: ::core::option::Option, + /// 触发限流的错误率配置 + #[prost(message, optional, tag = "3")] + pub error_rate: ::core::option::Option, + /// 针对部分错误码,使用额外的错误率统计,可设置多组特殊规则 + #[prost(message, repeated, tag = "4")] + pub specials: ::prost::alloc::vec::Vec, + } + /// Nested message and enum types in `ErrorRate`. + pub mod error_rate { + /// 特殊错误码触发调整配置 + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct SpecialConfig { + /// 自定义错误类型 + #[prost(message, optional, tag = "1")] + pub r#type: ::core::option::Option<::prost::alloc::string::String>, + /// 特定规则针对的错误码 + #[prost(message, repeated, tag = "2")] + pub error_codes: ::prost::alloc::vec::Vec, + /// 特定规则错误率 + #[prost(message, optional, tag = "3")] + pub error_rate: ::core::option::Option, + } + } + /// 慢调用触发调整配置 + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct SlowRate { + /// 是否开启 + #[prost(message, optional, tag = "1")] + pub enable: ::core::option::Option, + /// 最大响应时间,超过该响应时间属于慢调用 + #[prost(message, optional, tag = "2")] + pub max_rt: ::core::option::Option<::prost_types::Duration>, + /// 慢请求率阈值,达到该阈值进行限流 + #[prost(message, optional, tag = "3")] + pub slow_rate: ::core::option::Option, + } + } + /// 爬坡调整相关参数 + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct ClimbThrottling { + /// 冷水位以下区间的下调百分比 + #[prost(message, optional, tag = "1")] + pub cold_below_tune_down_rate: ::core::option::Option, + /// 冷水位以下区间的上调百分比 + #[prost(message, optional, tag = "2")] + pub cold_below_tune_up_rate: ::core::option::Option, + /// 冷水位以上区间的下调百分比 + #[prost(message, optional, tag = "3")] + pub cold_above_tune_down_rate: ::core::option::Option, + /// 冷水位以上区间的上调百分比 + #[prost(message, optional, tag = "4")] + pub cold_above_tune_up_rate: ::core::option::Option, + /// 冷水位以上,超过该百分的请求被限流后进行阈值上调 + #[prost(message, optional, tag = "5")] + pub limit_threshold_to_tune_up: ::core::option::Option, + /// 阈值调整规则的决策间隔 + #[prost(message, optional, tag = "6")] + pub judge_duration: ::core::option::Option<::prost_types::Duration>, + /// 阈值上调周期数,连续N个决策间隔都为上调,才执行上调 + #[prost(message, optional, tag = "7")] + pub tune_up_period: ::core::option::Option, + /// 阈值下调周期数,连续N个决策间隔都为下调,才执行下调 + #[prost(message, optional, tag = "8")] + pub tune_down_period: ::core::option::Option, + } +} +/// 单个熔断规则定义 +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct CircuitBreaker { + /// deprecated + #[prost(message, optional, tag = "1")] + pub id: ::core::option::Option<::prost::alloc::string::String>, + /// 规则版本 + /// deprecated + #[prost(message, optional, tag = "2")] + pub version: ::core::option::Option<::prost::alloc::string::String>, + /// 规则名 + /// deprecated + #[prost(message, optional, tag = "3")] + pub name: ::core::option::Option<::prost::alloc::string::String>, + /// 规则命名空间 + /// deprecated + #[prost(message, optional, tag = "4")] + pub namespace: ::core::option::Option<::prost::alloc::string::String>, + /// 规则所属服务 + #[prost(message, optional, tag = "5")] + pub service: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "6")] + pub service_namespace: ::core::option::Option<::prost::alloc::string::String>, + /// 熔断规则可以分为被调规则和主调规则 + /// 被调规则针对所有的指定主调生效,假如不指定则对所有的主调生效 + /// 主调规则为当前主调方的规则,假如不指定则针对所有被调生效 + /// deprecated + #[prost(message, repeated, tag = "7")] + pub inbounds: ::prost::alloc::vec::Vec, + /// deprecated + #[prost(message, repeated, tag = "8")] + pub outbounds: ::prost::alloc::vec::Vec, + /// deprecated + #[prost(message, optional, tag = "9")] + pub token: ::core::option::Option<::prost::alloc::string::String>, + /// deprecated + #[prost(message, optional, tag = "10")] + pub owners: ::core::option::Option<::prost::alloc::string::String>, + /// 业务 + /// deprecated + #[prost(message, optional, tag = "11")] + pub business: ::core::option::Option<::prost::alloc::string::String>, + /// 部门 + /// deprecated + #[prost(message, optional, tag = "12")] + pub department: ::core::option::Option<::prost::alloc::string::String>, + /// 规则描述 + /// deprecated + #[prost(message, optional, tag = "13")] + pub comment: ::core::option::Option<::prost::alloc::string::String>, + /// deprecated + #[prost(message, optional, tag = "14")] + pub ctime: ::core::option::Option<::prost::alloc::string::String>, + /// deprecated + #[prost(message, optional, tag = "15")] + pub mtime: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "16")] + pub revision: ::core::option::Option<::prost::alloc::string::String>, + /// circuitbreaker rules for current service + #[prost(message, repeated, tag = "21")] + pub rules: ::prost::alloc::vec::Vec, +} +/// 主调匹配规则 +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SourceMatcher { + /// 主调命名空间以及服务名,可以为*,代表全匹配 + #[prost(message, optional, tag = "1")] + pub service: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "2")] + pub namespace: ::core::option::Option<::prost::alloc::string::String>, + /// 可选,主调业务标签,用于匹配是否使用该熔断规则,可放置用户的接口信息等 + #[prost(map = "string, message", tag = "3")] + pub labels: ::std::collections::HashMap<::prost::alloc::string::String, MatchString>, +} +/// 熔断恢复配置 +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RecoverConfig { + /// 触发熔断后到半开状态之间的等待间隔 + #[prost(message, optional, tag = "1")] + pub sleep_window: ::core::option::Option<::prost_types::Duration>, + /// 半开后,最多重试多少次恢复 + #[prost(message, optional, tag = "2")] + pub max_retry_after_half_open: ::core::option::Option, + /// 半开后放量的最大百分比 + #[prost(message, repeated, tag = "3")] + pub request_rate_after_half_open: ::prost::alloc::vec::Vec, + /// 熔断器半开到关闭所必须的最少成功率,默认100% + #[prost(message, optional, tag = "4")] + pub success_rate_to_close: ::core::option::Option, + /// 半开后最大放量数(用户不配置最大百分比时默认使用该配置) + #[prost(message, optional, tag = "5")] + pub request_count_after_half_open: ::core::option::Option, + #[prost(enumeration = "recover_config::OutlierDetectWhen", tag = "6")] + pub outlier_detect_when: i32, +} +/// Nested message and enum types in `RecoverConfig`. +pub mod recover_config { + /// 主动探测配置 #[derive( Clone, Copy, @@ -2140,461 +1806,468 @@ pub mod fault_detect_rule { ::prost::Enumeration )] #[repr(i32)] - pub enum Protocol { - Unknown = 0, - Http = 1, - Tcp = 2, - Udp = 3, + pub enum OutlierDetectWhen { + /// 不开启监控探测 + Never = 0, + /// 只有在熔断恢复时才开启健康探测 + OnRecover = 1, + /// 一直开启健康探测 + Always = 2, } - impl Protocol { + impl OutlierDetectWhen { /// String value of the enum field names used in the ProtoBuf definition. /// /// The values are not transformed in any way and thus are considered stable /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Protocol::Unknown => "UNKNOWN", - Protocol::Http => "HTTP", - Protocol::Tcp => "TCP", - Protocol::Udp => "UDP", + OutlierDetectWhen::Never => "NEVER", + OutlierDetectWhen::OnRecover => "ON_RECOVER", + OutlierDetectWhen::Always => "ALWAYS", } } /// Creates an enum from field names used in the ProtoBuf definition. pub fn from_str_name(value: &str) -> ::core::option::Option { match value { - "UNKNOWN" => Some(Self::Unknown), - "HTTP" => Some(Self::Http), - "TCP" => Some(Self::Tcp), - "UDP" => Some(Self::Udp), + "NEVER" => Some(Self::Never), + "ON_RECOVER" => Some(Self::OnRecover), + "ALWAYS" => Some(Self::Always), _ => None, } } } } +/// 熔断策略 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct HttpProtocolConfig { - #[prost(string, tag = "1")] - pub method: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub url: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "3")] - pub headers: ::prost::alloc::vec::Vec, - #[prost(string, tag = "4")] - pub body: ::prost::alloc::string::String, -} -/// Nested message and enum types in `HttpProtocolConfig`. -pub mod http_protocol_config { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct MessageHeader { - #[prost(string, tag = "1")] - pub key: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub value: ::prost::alloc::string::String, - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TcpProtocolConfig { - #[prost(string, tag = "1")] - pub send: ::prost::alloc::string::String, - #[prost(string, repeated, tag = "2")] - pub receive: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UdpProtocolConfig { - #[prost(string, tag = "1")] - pub send: ::prost::alloc::string::String, - #[prost(string, repeated, tag = "2")] - pub receive: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct LoginRequest { - #[prost(message, optional, tag = "1")] - pub owner: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "2")] - pub name: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "3")] - pub password: ::core::option::Option<::prost::alloc::string::String>, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct LoginResponse { +pub struct CbPolicy { #[prost(message, optional, tag = "1")] - pub user_id: ::core::option::Option<::prost::alloc::string::String>, + pub error_rate: ::core::option::Option, #[prost(message, optional, tag = "2")] - pub name: ::core::option::Option<::prost::alloc::string::String>, + pub slow_rate: ::core::option::Option, + /// 熔断的决策周期,多久触发一次熔断决策 #[prost(message, optional, tag = "3")] - pub role: ::core::option::Option<::prost::alloc::string::String>, + pub judge_duration: ::core::option::Option<::prost_types::Duration>, + /// 最大熔断比例,超过多少比例后不会继续熔断 #[prost(message, optional, tag = "4")] - pub owner_id: ::core::option::Option<::prost::alloc::string::String>, + pub max_ejection_percent: ::core::option::Option, #[prost(message, optional, tag = "5")] - pub token: ::core::option::Option<::prost::alloc::string::String>, + pub consecutive: ::core::option::Option, +} +/// Nested message and enum types in `CbPolicy`. +pub mod cb_policy { + /// 错误率熔断配置 + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct ErrRateConfig { + /// 是否启用错误率配置 + #[prost(message, optional, tag = "1")] + pub enable: ::core::option::Option, + /// 触发错误率熔断的最低请求阈值 + #[prost(message, optional, tag = "2")] + pub request_volume_threshold: ::core::option::Option, + /// 可选。触发保持状态的错误率阈值,假如不配置,则默认不会进入Preserved状态 + #[prost(message, optional, tag = "3")] + pub error_rate_to_preserved: ::core::option::Option, + /// 触发熔断的错误率阈值 + #[prost(message, optional, tag = "4")] + pub error_rate_to_open: ::core::option::Option, + #[prost(message, repeated, tag = "5")] + pub specials: ::prost::alloc::vec::Vec, + } + /// Nested message and enum types in `ErrRateConfig`. + pub mod err_rate_config { + /// 错误码相关特定配置 + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct SpecialConfig { + /// 熔断关心的错误类型,用户可以自己定义 + #[prost(message, optional, tag = "1")] + pub r#type: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, repeated, tag = "2")] + pub error_codes: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "3")] + pub error_rate_to_preserved: ::core::option::Option, + #[prost(message, optional, tag = "4")] + pub error_rate_to_open: ::core::option::Option, + } + } + /// 慢调用率熔断策略配置 + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct SlowRateConfig { + /// 是否启用慢调用率配置 + #[prost(message, optional, tag = "1")] + pub enable: ::core::option::Option, + /// 最大响应时间,超过该时间属于慢调用请求 + #[prost(message, optional, tag = "2")] + pub max_rt: ::core::option::Option<::prost_types::Duration>, + /// 可选。触发保持状态的超时率阈值,假如不配置,则默认不会进入Preserved状态 + #[prost(message, optional, tag = "3")] + pub slow_rate_to_preserved: ::core::option::Option, + /// 触发熔断的超时率阈值 + #[prost(message, optional, tag = "4")] + pub slow_rate_to_open: ::core::option::Option, + } + /// 连续错误数熔断配置 + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct ConsecutiveErrConfig { + /// 是否启用连续错误数配置 + #[prost(message, optional, tag = "1")] + pub enable: ::core::option::Option, + /// 连续错误数阈值,进入Preserved状态 + #[prost(message, optional, tag = "2")] + pub consecutive_error_to_preserved: ::core::option::Option, + /// 连续错误数阈值,进入Open状态 + #[prost(message, optional, tag = "3")] + pub consecutive_error_to_open: ::core::option::Option, + } } +/// 目标set的规则 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct User { +pub struct DestinationSet { + /// 被调命名空间以及服务名,可以为*,代表全匹配 #[prost(message, optional, tag = "1")] - pub id: ::core::option::Option<::prost::alloc::string::String>, + pub service: ::core::option::Option<::prost::alloc::string::String>, #[prost(message, optional, tag = "2")] - pub name: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "3")] - pub password: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "4")] - pub owner: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "5")] - pub source: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "6")] - pub auth_token: ::core::option::Option<::prost::alloc::string::String>, + pub namespace: ::core::option::Option<::prost::alloc::string::String>, + /// 可选,SUBSET标识 + #[prost(map = "string, message", tag = "3")] + pub metadata: ::std::collections::HashMap< + ::prost::alloc::string::String, + MatchString, + >, + #[prost(enumeration = "destination_set::Resource", tag = "4")] + pub resource: i32, + #[prost(enumeration = "destination_set::Type", tag = "5")] + pub r#type: i32, + #[prost(enumeration = "destination_set::Scope", tag = "6")] + pub scope: i32, + /// 熔断数据度量周期 + /// 所有的阈值指标按此周期进行统计 #[prost(message, optional, tag = "7")] - pub token_enable: ::core::option::Option, + pub metric_window: ::core::option::Option<::prost_types::Duration>, + /// 熔断数据统计精度,决定数据度量的最小周期 + /// 度量滑窗的步长=window/precision #[prost(message, optional, tag = "8")] - pub comment: ::core::option::Option<::prost::alloc::string::String>, + pub metric_precision: ::core::option::Option, + /// 熔断数据上报周期,对分布式熔断有效 #[prost(message, optional, tag = "9")] - pub ctime: ::core::option::Option<::prost::alloc::string::String>, + pub update_interval: ::core::option::Option<::prost_types::Duration>, + /// 触发熔断后恢复配置 #[prost(message, optional, tag = "10")] - pub mtime: ::core::option::Option<::prost::alloc::string::String>, + pub recover: ::core::option::Option, + /// 熔断策略 #[prost(message, optional, tag = "11")] - pub user_type: ::core::option::Option<::prost::alloc::string::String>, + pub policy: ::core::option::Option, + /// 被调的接口信息,指定哪些接口会使用该规则 #[prost(message, optional, tag = "12")] - pub mobile: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "13")] - pub email: ::core::option::Option<::prost::alloc::string::String>, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ModifyUserPassword { - #[prost(message, optional, tag = "1")] - pub id: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "2")] - pub old_password: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "3")] - pub new_password: ::core::option::Option<::prost::alloc::string::String>, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UserGroupRelation { - #[prost(message, optional, tag = "1")] - pub group_id: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, repeated, tag = "2")] - pub users: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UserGroup { - #[prost(message, optional, tag = "1")] - pub id: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "2")] - pub name: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "3")] - pub owner: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "4")] - pub auth_token: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "5")] - pub token_enable: ::core::option::Option, - #[prost(message, optional, tag = "6")] - pub comment: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "7")] - pub ctime: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "8")] - pub mtime: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "9")] - pub relation: ::core::option::Option, - #[prost(message, optional, tag = "10")] - pub user_count: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ModifyUserGroup { - #[prost(message, optional, tag = "1")] - pub id: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "2")] - pub owner: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "3")] - pub name: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "4")] - pub auth_token: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "5")] - pub token_enable: ::core::option::Option, - #[prost(message, optional, tag = "6")] - pub comment: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "7")] - pub add_relations: ::core::option::Option, - #[prost(message, optional, tag = "8")] - pub remove_relations: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Principal { - #[prost(message, optional, tag = "1")] - pub id: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "2")] - pub name: ::core::option::Option<::prost::alloc::string::String>, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Principals { - #[prost(message, repeated, tag = "1")] - pub users: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "2")] - pub groups: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct StrategyResourceEntry { - #[prost(message, optional, tag = "1")] - pub id: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "2")] - pub namespace: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "3")] - pub name: ::core::option::Option<::prost::alloc::string::String>, + pub method: ::core::option::Option, + /// 返回码,指定哪些返回码会使用该规则 + #[prost(message, repeated, tag = "13")] + pub error_codes: ::prost::alloc::vec::Vec, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct StrategyResources { - #[prost(message, optional, tag = "1")] - pub strategy_id: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, repeated, tag = "2")] - pub namespaces: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "3")] - pub services: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "4")] - pub config_groups: ::prost::alloc::vec::Vec, +/// Nested message and enum types in `DestinationSet`. +pub mod destination_set { + /// 需要进行熔断的资源 + /// 支持SUBSET(子集群),以及INSTANCE(单个实例),默认为SUBSET + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum Resource { + /// 针对实例分组进行熔断 + Subset = 0, + /// 针对实例进行熔断 + Instance = 1, + } + impl Resource { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Resource::Subset => "SUBSET", + Resource::Instance => "INSTANCE", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "SUBSET" => Some(Self::Subset), + "INSTANCE" => Some(Self::Instance), + _ => None, + } + } + } + /// 熔断决策类型,支持GLOBAL(分布式决策)以及LOCAL(本地决策),默认GLOBAL + /// 当指定为GLOBAL时,则会定期上报统计数据并根据汇总数据进行熔断决策 + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum Type { + Global = 0, + Local = 1, + } + impl Type { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Type::Global => "GLOBAL", + Type::Local => "LOCAL", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "GLOBAL" => Some(Self::Global), + "LOCAL" => Some(Self::Local), + _ => None, + } + } + } + /// 熔断范围,是否扩散针对相同服务下所有接口进行熔断 + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum Scope { + /// 触发熔断条件,扩散熔断所有接口 + All = 0, + /// 触发熔断条件,只熔断当前接口 + Current = 1, + } + impl Scope { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Scope::All => "ALL", + Scope::Current => "CURRENT", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "ALL" => Some(Self::All), + "CURRENT" => Some(Self::Current), + _ => None, + } + } + } } +/// 具体熔断规则 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct AuthStrategy { - #[prost(message, optional, tag = "1")] - pub id: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "2")] - pub name: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "3")] - pub principals: ::core::option::Option, - #[prost(message, optional, tag = "4")] - pub resources: ::core::option::Option, - #[prost(enumeration = "AuthAction", tag = "5")] - pub action: i32, - #[prost(message, optional, tag = "6")] - pub comment: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "7")] - pub owner: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "8")] - pub ctime: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "9")] - pub mtime: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "10")] - pub auth_token: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "11")] - pub default_strategy: ::core::option::Option, +pub struct CbRule { + /// 如果匹配Source规则,按照Destination进行熔断 + /// 多个Source之间的关系为或 + #[prost(message, repeated, tag = "1")] + pub sources: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "2")] + pub destinations: ::prost::alloc::vec::Vec, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ModifyAuthStrategy { +pub struct RuleMatcher { #[prost(message, optional, tag = "1")] - pub id: ::core::option::Option<::prost::alloc::string::String>, + pub source: ::core::option::Option, #[prost(message, optional, tag = "2")] - pub name: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "3")] - pub add_principals: ::core::option::Option, - #[prost(message, optional, tag = "4")] - pub remove_principals: ::core::option::Option, - #[prost(message, optional, tag = "5")] - pub add_resources: ::core::option::Option, - #[prost(message, optional, tag = "6")] - pub remove_resources: ::core::option::Option, - #[prost(enumeration = "AuthAction", tag = "7")] - pub action: i32, - #[prost(message, optional, tag = "8")] - pub comment: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "9")] - pub owner: ::core::option::Option<::prost::alloc::string::String>, -} -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum AuthAction { - OnlyRead = 0, - ReadWrite = 1, -} -impl AuthAction { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - AuthAction::OnlyRead => "ONLY_READ", - AuthAction::ReadWrite => "READ_WRITE", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "ONLY_READ" => Some(Self::OnlyRead), - "READ_WRITE" => Some(Self::ReadWrite), - _ => None, - } - } -} -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum ResourceType { - Namespaces = 0, - Services = 1, - ConfigGroups = 2, + pub destination: ::core::option::Option, } -impl ResourceType { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - ResourceType::Namespaces => "Namespaces", - ResourceType::Services => "Services", - ResourceType::ConfigGroups => "ConfigGroups", - } +/// Nested message and enum types in `RuleMatcher`. +pub mod rule_matcher { + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct SourceService { + #[prost(string, tag = "1")] + pub service: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub namespace: ::prost::alloc::string::String, } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "Namespaces" => Some(Self::Namespaces), - "Services" => Some(Self::Services), - "ConfigGroups" => Some(Self::ConfigGroups), - _ => None, - } + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct DestinationService { + #[prost(string, tag = "1")] + pub service: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub namespace: ::prost::alloc::string::String, + /// deprecated_filed using api.path in blockConfig instead + #[deprecated] + #[prost(message, optional, tag = "3")] + pub method: ::core::option::Option, } } +/// new specific rule for circuitbreaker config #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct Response { - #[prost(message, optional, tag = "1")] - pub code: ::core::option::Option, - #[prost(message, optional, tag = "2")] - pub info: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "3")] - pub client: ::core::option::Option, - #[prost(message, optional, tag = "4")] - pub namespace: ::core::option::Option, - #[prost(message, optional, tag = "5")] - pub service: ::core::option::Option, - #[prost(message, optional, tag = "6")] - pub instance: ::core::option::Option, - #[prost(message, optional, tag = "7")] - pub routing: ::core::option::Option, - #[prost(message, optional, tag = "8")] - pub alias: ::core::option::Option, - #[prost(message, optional, tag = "9")] - pub rate_limit: ::core::option::Option, - #[prost(message, optional, tag = "10")] - pub circuit_breaker: ::core::option::Option, - #[prost(message, optional, tag = "11")] - pub config_release: ::core::option::Option, - #[prost(message, optional, tag = "19")] - pub user: ::core::option::Option, - #[prost(message, optional, tag = "20")] - pub user_group: ::core::option::Option, - #[prost(message, optional, tag = "21")] - pub auth_strategy: ::core::option::Option, +pub struct CircuitBreakerRule { + #[prost(string, tag = "1")] + pub id: ::prost::alloc::string::String, + /// rule name + #[prost(string, tag = "2")] + pub name: ::prost::alloc::string::String, + /// namespace of rule + #[prost(string, tag = "3")] + pub namespace: ::prost::alloc::string::String, + /// enable this router + #[prost(bool, tag = "4")] + pub enable: bool, + /// revision routing version + #[prost(string, tag = "5")] + pub revision: ::prost::alloc::string::String, + /// ctime create time of the rules + #[prost(string, tag = "6")] + pub ctime: ::prost::alloc::string::String, + /// mtime modify time of the rules + #[prost(string, tag = "7")] + pub mtime: ::prost::alloc::string::String, + /// etime enable time of the rules + #[prost(string, tag = "8")] + pub etime: ::prost::alloc::string::String, + /// description simple description rules + #[prost(string, tag = "9")] + pub description: ::prost::alloc::string::String, + /// the circuitbreaking level + #[prost(enumeration = "Level", tag = "21")] + pub level: i32, + /// match condition for this rule #[prost(message, optional, tag = "22")] - pub relation: ::core::option::Option, - #[prost(message, optional, tag = "23")] - pub login_response: ::core::option::Option, - #[prost(message, optional, tag = "24")] - pub modify_auth_strategy: ::core::option::Option, - #[prost(message, optional, tag = "25")] - pub modify_user_group: ::core::option::Option, + pub rule_matcher: ::core::option::Option, + /// deprecated_filed error conditions to judge an invocation as an error + #[deprecated] + #[prost(message, repeated, tag = "23")] + pub error_conditions: ::prost::alloc::vec::Vec, + /// deprecated_filed trigger condition to trigger circuitbreaking + #[deprecated] + #[prost(message, repeated, tag = "24")] + pub trigger_condition: ::prost::alloc::vec::Vec, + /// the maximum % of an upstream cluster that can be ejected + #[prost(uint32, tag = "25")] + pub max_ejection_percent: u32, + /// recover condition to make resource open to close #[prost(message, optional, tag = "26")] - pub resources: ::core::option::Option, + pub recover_condition: ::core::option::Option, + /// fault detection enable config #[prost(message, optional, tag = "27")] - pub option_switch: ::core::option::Option, + pub fault_detect_config: ::core::option::Option, + /// fall back configuration #[prost(message, optional, tag = "28")] - pub instance_labels: ::core::option::Option, - #[prost(message, optional, tag = "29")] - pub data: ::core::option::Option<::prost_types::Any>, + pub fallback_config: ::core::option::Option, + /// list for block configuration + #[prost(message, repeated, tag = "29")] + pub block_configs: ::prost::alloc::vec::Vec, + /// priority rules priority + #[prost(uint32, tag = "30")] + pub priority: u32, + /// 熔断规则标签数据 + #[prost(map = "string, string", tag = "50")] + pub metadata: ::std::collections::HashMap< + ::prost::alloc::string::String, + ::prost::alloc::string::String, + >, } +/// the condition to judge an input invocation as an error #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct BatchWriteResponse { - #[prost(message, optional, tag = "1")] - pub code: ::core::option::Option, +pub struct ErrorCondition { + #[prost(enumeration = "error_condition::InputType", tag = "1")] + pub input_type: i32, #[prost(message, optional, tag = "2")] - pub info: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "3")] - pub size: ::core::option::Option, - #[prost(message, repeated, tag = "4")] - pub responses: ::prost::alloc::vec::Vec, + pub condition: ::core::option::Option, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct BatchQueryResponse { - #[prost(message, optional, tag = "1")] - pub code: ::core::option::Option, - #[prost(message, optional, tag = "2")] - pub info: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "3")] - pub amount: ::core::option::Option, - #[prost(message, optional, tag = "4")] - pub size: ::core::option::Option, - #[prost(message, repeated, tag = "5")] - pub namespaces: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "6")] - pub services: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "7")] - pub instances: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "8")] - pub routings: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "9")] - pub aliases: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "10")] - pub rate_limits: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "11")] - pub config_with_services: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "18")] - pub users: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "19")] - pub user_groups: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "20")] - pub auth_strategies: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "21")] - pub clients: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "22")] - pub data: ::prost::alloc::vec::Vec<::prost_types::Any>, - #[prost(message, optional, tag = "23")] - pub summary: ::core::option::Option, +/// Nested message and enum types in `ErrorCondition`. +pub mod error_condition { + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum InputType { + Unknown = 0, + RetCode = 1, + Delay = 2, + } + impl InputType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + InputType::Unknown => "UNKNOWN", + InputType::RetCode => "RET_CODE", + InputType::Delay => "DELAY", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "UNKNOWN" => Some(Self::Unknown), + "RET_CODE" => Some(Self::RetCode), + "DELAY" => Some(Self::Delay), + _ => None, + } + } + } } +/// the error condition to trigger circuitbreaking #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DiscoverResponse { - #[prost(message, optional, tag = "1")] - pub code: ::core::option::Option, - #[prost(message, optional, tag = "2")] - pub info: ::core::option::Option<::prost::alloc::string::String>, - #[prost(enumeration = "discover_response::DiscoverResponseType", tag = "3")] - pub r#type: i32, - #[prost(message, optional, tag = "4")] - pub service: ::core::option::Option, - #[prost(message, repeated, tag = "5")] - pub instances: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "6")] - pub routing: ::core::option::Option, - #[prost(message, optional, tag = "7")] - pub rate_limit: ::core::option::Option, - #[prost(message, optional, tag = "8")] - pub circuit_breaker: ::core::option::Option, - #[prost(message, repeated, tag = "9")] - pub services: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "10")] - pub namespaces: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "11")] - pub fault_detector: ::core::option::Option, - #[prost(message, optional, tag = "21")] - pub alias_for: ::core::option::Option, +pub struct TriggerCondition { + #[prost(enumeration = "trigger_condition::TriggerType", tag = "1")] + pub trigger_type: i32, + #[prost(uint32, tag = "2")] + pub error_count: u32, + #[prost(uint32, tag = "3")] + pub error_percent: u32, + #[prost(uint32, tag = "4")] + pub interval: u32, + #[prost(uint32, tag = "5")] + pub minimum_request: u32, } -/// Nested message and enum types in `DiscoverResponse`. -pub mod discover_response { +/// Nested message and enum types in `TriggerCondition`. +pub mod trigger_condition { #[derive( Clone, Copy, @@ -2607,1090 +2280,4648 @@ pub mod discover_response { ::prost::Enumeration )] #[repr(i32)] - pub enum DiscoverResponseType { + pub enum TriggerType { Unknown = 0, - Instance = 1, - Cluster = 2, - Routing = 3, - RateLimit = 4, - CircuitBreaker = 5, - Services = 6, - Namespaces = 12, - FaultDetector = 13, + ErrorRate = 1, + ConsecutiveError = 2, } - impl DiscoverResponseType { + impl TriggerType { /// String value of the enum field names used in the ProtoBuf definition. /// /// The values are not transformed in any way and thus are considered stable /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - DiscoverResponseType::Unknown => "UNKNOWN", - DiscoverResponseType::Instance => "INSTANCE", - DiscoverResponseType::Cluster => "CLUSTER", - DiscoverResponseType::Routing => "ROUTING", - DiscoverResponseType::RateLimit => "RATE_LIMIT", - DiscoverResponseType::CircuitBreaker => "CIRCUIT_BREAKER", - DiscoverResponseType::Services => "SERVICES", - DiscoverResponseType::Namespaces => "NAMESPACES", - DiscoverResponseType::FaultDetector => "FAULT_DETECTOR", + TriggerType::Unknown => "UNKNOWN", + TriggerType::ErrorRate => "ERROR_RATE", + TriggerType::ConsecutiveError => "CONSECUTIVE_ERROR", } } /// Creates an enum from field names used in the ProtoBuf definition. pub fn from_str_name(value: &str) -> ::core::option::Option { match value { "UNKNOWN" => Some(Self::Unknown), - "INSTANCE" => Some(Self::Instance), - "CLUSTER" => Some(Self::Cluster), - "ROUTING" => Some(Self::Routing), - "RATE_LIMIT" => Some(Self::RateLimit), - "CIRCUIT_BREAKER" => Some(Self::CircuitBreaker), - "SERVICES" => Some(Self::Services), - "NAMESPACES" => Some(Self::Namespaces), - "FAULT_DETECTOR" => Some(Self::FaultDetector), + "ERROR_RATE" => Some(Self::ErrorRate), + "CONSECUTIVE_ERROR" => Some(Self::ConsecutiveError), _ => None, } } } } +/// circuitbreaking OPEN status recover #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct OptionSwitch { - #[prost(map = "string, string", tag = "1")] - pub options: ::std::collections::HashMap< - ::prost::alloc::string::String, - ::prost::alloc::string::String, - >, +pub struct RecoverCondition { + /// seconds from open to half-open + #[prost(uint32, tag = "1")] + pub sleep_window: u32, + /// consecutive success request to recover + #[prost(uint32, tag = "2")] + pub consecutive_success: u32, } +/// fault detect config within circuitbreaking #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct InstanceLabels { - #[prost(map = "string, message", tag = "1")] - pub labels: ::std::collections::HashMap<::prost::alloc::string::String, StringList>, +pub struct FaultDetectConfig { + #[prost(bool, tag = "1")] + pub enable: bool, +} +/// fallback config +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct FallbackConfig { + #[prost(bool, tag = "1")] + pub enable: bool, + #[prost(message, optional, tag = "2")] + pub response: ::core::option::Option, +} +/// fallback response +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct FallbackResponse { + #[prost(int32, tag = "1")] + pub code: i32, + #[prost(message, repeated, tag = "2")] + pub headers: ::prost::alloc::vec::Vec, + #[prost(string, tag = "3")] + pub body: ::prost::alloc::string::String, +} +/// Nested message and enum types in `FallbackResponse`. +pub mod fallback_response { + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct MessageHeader { + #[prost(string, tag = "1")] + pub key: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub value: ::prost::alloc::string::String, + } +} +/// blocking strategy +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct BlockConfig { + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + /// blocking target api + #[prost(message, optional, tag = "2")] + pub api: ::core::option::Option, + /// conditions to judge an invocation as an error + #[prost(message, repeated, tag = "3")] + pub error_conditions: ::prost::alloc::vec::Vec, + /// trigger condition to trigger circuitbreaking + #[prost(message, repeated, tag = "4")] + pub trigger_conditions: ::prost::alloc::vec::Vec, } +/// circuitbreaking level #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -pub enum Code { - /// base module status codes +pub enum Level { Unknown = 0, - ExecuteSuccess = 200000, - DataNoChange = 200001, - NoNeedUpdate = 200002, - BadRequest = 400000, - ParseException = 400001, - EmptyRequest = 400002, - BatchSizeOverLimit = 400003, - InvalidDiscoverResource = 400004, - InvalidRequestId = 400100, - InvalidUserName = 400101, - InvalidUserToken = 400102, - InvalidParameter = 400103, - EmptyQueryParameter = 400104, - InvalidQueryInsParameter = 400105, - InvalidNamespaceName = 400110, - InvalidNamespaceOwners = 400111, - InvalidNamespaceToken = 400112, - InvalidServiceName = 400120, - InvalidServiceOwners = 400121, - InvalidServiceToken = 400122, - InvalidServiceMetadata = 400123, - InvalidServicePorts = 400124, - InvalidServiceBusiness = 400125, - InvalidServiceDepartment = 400126, - InvalidServiceCmdb = 400127, - InvalidServiceComment = 400128, - InvalidServiceAliasComment = 400129, - InvalidInstanceId = 400130, - InvalidInstanceHost = 400131, - InvalidInstancePort = 400132, - InvalidServiceAlias = 400133, - InvalidNamespaceWithAlias = 400134, - InvalidServiceAliasOwners = 400135, - InvalidInstanceProtocol = 400136, - InvalidInstanceVersion = 400137, - InvalidInstanceLogicSet = 400138, - InvalidInstanceIsolate = 400139, - HealthCheckNotOpen = 400140, - HeartbeatOnDisabledIns = 400141, - HeartbeatExceedLimit = 400142, - HeartbeatTypeNotFound = 400143, - InvalidMetadata = 400150, - InvalidRateLimitId = 400151, - InvalidRateLimitLabels = 400152, - InvalidRateLimitAmounts = 400153, - InvalidRateLimitName = 400154, - InvalidCircuitBreakerId = 400160, - InvalidCircuitBreakerVersion = 400161, - InvalidCircuitBreakerName = 400162, - InvalidCircuitBreakerNamespace = 400163, - InvalidCircuitBreakerOwners = 400164, - InvalidCircuitBreakerToken = 400165, - InvalidCircuitBreakerBusiness = 400166, - InvalidCircuitBreakerDepartment = 400167, - InvalidCircuitBreakerComment = 400168, - CircuitBreakerRuleExisted = 400169, - InvalidRoutingId = 400700, - InvalidRoutingPolicy = 400701, - InvalidRoutingName = 400702, - InvalidRoutingPriority = 400703, - InvalidFaultDetectId = 400900, - InvalidFaultDetectName = 400901, - InvalidFaultDetectNamespace = 400902, - FaultDetectRuleExisted = 400903, - /// network relative codes - ServicesExistedMesh = 400170, - ResourcesExistedMesh = 400171, - InvalidMeshParameter = 400172, - /// platform relative codes - InvalidPlatformId = 400180, - InvalidPlatformName = 400181, - InvalidPlatformDomain = 400182, - InvalidPlatformQps = 400183, - InvalidPlatformToken = 400184, - InvalidPlatformOwner = 400185, - InvalidPlatformDepartment = 400186, - InvalidPlatformComment = 400187, - NotFoundPlatform = 400188, - /// flux relative codes - InvalidFluxRateLimitId = 400190, - InvalidFluxRateLimitQps = 400191, - InvalidFluxRateLimitSetKey = 400192, - ExistedResource = 400201, - NotFoundResource = 400202, - NamespaceExistedServices = 400203, - ServiceExistedInstances = 400204, - ServiceExistedRoutings = 400205, - ServiceExistedRateLimits = 400206, - ExistReleasedConfig = 400207, - SameInstanceRequest = 400208, - ServiceExistedCircuitBreakers = 400209, - ServiceExistedAlias = 400210, - NamespaceExistedMeshResources = 400211, - NamespaceExistedCircuitBreakers = 400212, - ServiceSubscribedByMeshes = 400213, - ServiceExistedFluxRateLimits = 400214, - NamespaceExistedConfigGroups = 400219, - NotFoundService = 400301, - NotFoundRouting = 400302, - NotFoundInstance = 400303, - NotFoundServiceAlias = 400304, - NotFoundNamespace = 400305, - NotFoundSourceService = 400306, - NotFoundRateLimit = 400307, - NotFoundCircuitBreaker = 400308, - NotFoundMasterConfig = 400309, - NotFoundTagConfig = 400310, - NotFoundTagConfigOrService = 400311, - ClientApiNotOpen = 400401, - NotAllowBusinessService = 400402, - NotAllowAliasUpdate = 400501, - NotAllowAliasCreateInstance = 400502, - NotAllowAliasCreateRouting = 400503, - NotAllowCreateAliasForAlias = 400504, - NotAllowAliasCreateRateLimit = 400505, - NotAllowAliasBindRule = 400506, - NotAllowDifferentNamespaceBindRule = 400507, - Unauthorized = 401000, - NotAllowedAccess = 401001, - CmdbNotFindHost = 404001, - DataConflict = 409000, - InstanceTooManyRequests = 429001, - IpRateLimit = 429002, - ApiRateLimit = 403003, - ExecuteException = 500000, - StoreLayerException = 500001, - CmdbPluginException = 500002, - ParseRoutingException = 500004, - ParseRateLimitException = 500005, - ParseCircuitBreakerException = 500006, - HeartbeatException = 500007, - InstanceRegisTimeout = 500008, - /// config center status codes - InvalidConfigFileGroupName = 400801, - InvalidConfigFileName = 400802, - InvalidConfigFileContentLength = 400803, - InvalidConfigFileFormat = 400804, - InvalidConfigFileTags = 400805, - InvalidWatchConfigFileFormat = 400806, - NotFoundResourceConfigFile = 400807, - InvalidConfigFileTemplateName = 400808, - EncryptConfigFileException = 400809, - DecryptConfigFileException = 400810, - /// auth codes - InvalidUserOwners = 400410, - InvalidUserId = 400411, - InvalidUserPassword = 400412, - InvalidUserMobile = 400413, - InvalidUserEmail = 400414, - InvalidUserGroupOwners = 400420, - InvalidUserGroupId = 400421, - InvalidAuthStrategyOwners = 400430, - InvalidAuthStrategyName = 400431, - InvalidAuthStrategyId = 400432, - InvalidPrincipalType = 400440, - UserExisted = 400215, - UserGroupExisted = 400216, - AuthStrategyRuleExisted = 400217, - SubAccountExisted = 400218, - NotFoundUser = 400312, - NotFoundOwnerUser = 400313, - NotFoundUserGroup = 400314, - NotFoundAuthStrategyRule = 400315, - NotAllowModifyDefaultStrategyPrincipal = 400508, - NotAllowModifyOwnerDefaultStrategy = 400509, - EmptyAutToken = 401002, - TokenDisabled = 401003, - TokenNotExisted = 401004, - AuthTokenForbidden = 403001, - OperationRoleForbidden = 403002, + /// service level circuitbreaking + Service = 1, + /// method level circuitbreaking + Method = 2, + /// group level circuitbreaking + Group = 3, + /// instance level circuitbreaking + Instance = 4, } -impl Code { +impl Level { /// String value of the enum field names used in the ProtoBuf definition. /// /// The values are not transformed in any way and thus are considered stable /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Code::Unknown => "Unknown", - Code::ExecuteSuccess => "ExecuteSuccess", - Code::DataNoChange => "DataNoChange", - Code::NoNeedUpdate => "NoNeedUpdate", - Code::BadRequest => "BadRequest", - Code::ParseException => "ParseException", - Code::EmptyRequest => "EmptyRequest", - Code::BatchSizeOverLimit => "BatchSizeOverLimit", - Code::InvalidDiscoverResource => "InvalidDiscoverResource", - Code::InvalidRequestId => "InvalidRequestID", - Code::InvalidUserName => "InvalidUserName", - Code::InvalidUserToken => "InvalidUserToken", - Code::InvalidParameter => "InvalidParameter", - Code::EmptyQueryParameter => "EmptyQueryParameter", - Code::InvalidQueryInsParameter => "InvalidQueryInsParameter", - Code::InvalidNamespaceName => "InvalidNamespaceName", - Code::InvalidNamespaceOwners => "InvalidNamespaceOwners", - Code::InvalidNamespaceToken => "InvalidNamespaceToken", - Code::InvalidServiceName => "InvalidServiceName", - Code::InvalidServiceOwners => "InvalidServiceOwners", - Code::InvalidServiceToken => "InvalidServiceToken", - Code::InvalidServiceMetadata => "InvalidServiceMetadata", - Code::InvalidServicePorts => "InvalidServicePorts", - Code::InvalidServiceBusiness => "InvalidServiceBusiness", - Code::InvalidServiceDepartment => "InvalidServiceDepartment", - Code::InvalidServiceCmdb => "InvalidServiceCMDB", - Code::InvalidServiceComment => "InvalidServiceComment", - Code::InvalidServiceAliasComment => "InvalidServiceAliasComment", - Code::InvalidInstanceId => "InvalidInstanceID", - Code::InvalidInstanceHost => "InvalidInstanceHost", - Code::InvalidInstancePort => "InvalidInstancePort", - Code::InvalidServiceAlias => "InvalidServiceAlias", - Code::InvalidNamespaceWithAlias => "InvalidNamespaceWithAlias", - Code::InvalidServiceAliasOwners => "InvalidServiceAliasOwners", - Code::InvalidInstanceProtocol => "InvalidInstanceProtocol", - Code::InvalidInstanceVersion => "InvalidInstanceVersion", - Code::InvalidInstanceLogicSet => "InvalidInstanceLogicSet", - Code::InvalidInstanceIsolate => "InvalidInstanceIsolate", - Code::HealthCheckNotOpen => "HealthCheckNotOpen", - Code::HeartbeatOnDisabledIns => "HeartbeatOnDisabledIns", - Code::HeartbeatExceedLimit => "HeartbeatExceedLimit", - Code::HeartbeatTypeNotFound => "HeartbeatTypeNotFound", - Code::InvalidMetadata => "InvalidMetadata", - Code::InvalidRateLimitId => "InvalidRateLimitID", - Code::InvalidRateLimitLabels => "InvalidRateLimitLabels", - Code::InvalidRateLimitAmounts => "InvalidRateLimitAmounts", - Code::InvalidRateLimitName => "InvalidRateLimitName", - Code::InvalidCircuitBreakerId => "InvalidCircuitBreakerID", - Code::InvalidCircuitBreakerVersion => "InvalidCircuitBreakerVersion", - Code::InvalidCircuitBreakerName => "InvalidCircuitBreakerName", - Code::InvalidCircuitBreakerNamespace => "InvalidCircuitBreakerNamespace", - Code::InvalidCircuitBreakerOwners => "InvalidCircuitBreakerOwners", - Code::InvalidCircuitBreakerToken => "InvalidCircuitBreakerToken", - Code::InvalidCircuitBreakerBusiness => "InvalidCircuitBreakerBusiness", - Code::InvalidCircuitBreakerDepartment => "InvalidCircuitBreakerDepartment", - Code::InvalidCircuitBreakerComment => "InvalidCircuitBreakerComment", - Code::CircuitBreakerRuleExisted => "CircuitBreakerRuleExisted", - Code::InvalidRoutingId => "InvalidRoutingID", - Code::InvalidRoutingPolicy => "InvalidRoutingPolicy", - Code::InvalidRoutingName => "InvalidRoutingName", - Code::InvalidRoutingPriority => "InvalidRoutingPriority", - Code::InvalidFaultDetectId => "InvalidFaultDetectID", - Code::InvalidFaultDetectName => "InvalidFaultDetectName", - Code::InvalidFaultDetectNamespace => "InvalidFaultDetectNamespace", - Code::FaultDetectRuleExisted => "FaultDetectRuleExisted", - Code::ServicesExistedMesh => "ServicesExistedMesh", - Code::ResourcesExistedMesh => "ResourcesExistedMesh", - Code::InvalidMeshParameter => "InvalidMeshParameter", - Code::InvalidPlatformId => "InvalidPlatformID", - Code::InvalidPlatformName => "InvalidPlatformName", - Code::InvalidPlatformDomain => "InvalidPlatformDomain", - Code::InvalidPlatformQps => "InvalidPlatformQPS", - Code::InvalidPlatformToken => "InvalidPlatformToken", - Code::InvalidPlatformOwner => "InvalidPlatformOwner", - Code::InvalidPlatformDepartment => "InvalidPlatformDepartment", - Code::InvalidPlatformComment => "InvalidPlatformComment", - Code::NotFoundPlatform => "NotFoundPlatform", - Code::InvalidFluxRateLimitId => "InvalidFluxRateLimitId", - Code::InvalidFluxRateLimitQps => "InvalidFluxRateLimitQps", - Code::InvalidFluxRateLimitSetKey => "InvalidFluxRateLimitSetKey", - Code::ExistedResource => "ExistedResource", - Code::NotFoundResource => "NotFoundResource", - Code::NamespaceExistedServices => "NamespaceExistedServices", - Code::ServiceExistedInstances => "ServiceExistedInstances", - Code::ServiceExistedRoutings => "ServiceExistedRoutings", - Code::ServiceExistedRateLimits => "ServiceExistedRateLimits", - Code::ExistReleasedConfig => "ExistReleasedConfig", - Code::SameInstanceRequest => "SameInstanceRequest", - Code::ServiceExistedCircuitBreakers => "ServiceExistedCircuitBreakers", - Code::ServiceExistedAlias => "ServiceExistedAlias", - Code::NamespaceExistedMeshResources => "NamespaceExistedMeshResources", - Code::NamespaceExistedCircuitBreakers => "NamespaceExistedCircuitBreakers", - Code::ServiceSubscribedByMeshes => "ServiceSubscribedByMeshes", - Code::ServiceExistedFluxRateLimits => "ServiceExistedFluxRateLimits", - Code::NamespaceExistedConfigGroups => "NamespaceExistedConfigGroups", - Code::NotFoundService => "NotFoundService", - Code::NotFoundRouting => "NotFoundRouting", - Code::NotFoundInstance => "NotFoundInstance", - Code::NotFoundServiceAlias => "NotFoundServiceAlias", - Code::NotFoundNamespace => "NotFoundNamespace", - Code::NotFoundSourceService => "NotFoundSourceService", - Code::NotFoundRateLimit => "NotFoundRateLimit", - Code::NotFoundCircuitBreaker => "NotFoundCircuitBreaker", - Code::NotFoundMasterConfig => "NotFoundMasterConfig", - Code::NotFoundTagConfig => "NotFoundTagConfig", - Code::NotFoundTagConfigOrService => "NotFoundTagConfigOrService", - Code::ClientApiNotOpen => "ClientAPINotOpen", - Code::NotAllowBusinessService => "NotAllowBusinessService", - Code::NotAllowAliasUpdate => "NotAllowAliasUpdate", - Code::NotAllowAliasCreateInstance => "NotAllowAliasCreateInstance", - Code::NotAllowAliasCreateRouting => "NotAllowAliasCreateRouting", - Code::NotAllowCreateAliasForAlias => "NotAllowCreateAliasForAlias", - Code::NotAllowAliasCreateRateLimit => "NotAllowAliasCreateRateLimit", - Code::NotAllowAliasBindRule => "NotAllowAliasBindRule", - Code::NotAllowDifferentNamespaceBindRule => { - "NotAllowDifferentNamespaceBindRule" - } - Code::Unauthorized => "Unauthorized", - Code::NotAllowedAccess => "NotAllowedAccess", - Code::CmdbNotFindHost => "CMDBNotFindHost", - Code::DataConflict => "DataConflict", - Code::InstanceTooManyRequests => "InstanceTooManyRequests", - Code::IpRateLimit => "IPRateLimit", - Code::ApiRateLimit => "APIRateLimit", - Code::ExecuteException => "ExecuteException", - Code::StoreLayerException => "StoreLayerException", - Code::CmdbPluginException => "CMDBPluginException", - Code::ParseRoutingException => "ParseRoutingException", - Code::ParseRateLimitException => "ParseRateLimitException", - Code::ParseCircuitBreakerException => "ParseCircuitBreakerException", - Code::HeartbeatException => "HeartbeatException", - Code::InstanceRegisTimeout => "InstanceRegisTimeout", - Code::InvalidConfigFileGroupName => "InvalidConfigFileGroupName", - Code::InvalidConfigFileName => "InvalidConfigFileName", - Code::InvalidConfigFileContentLength => "InvalidConfigFileContentLength", - Code::InvalidConfigFileFormat => "InvalidConfigFileFormat", - Code::InvalidConfigFileTags => "InvalidConfigFileTags", - Code::InvalidWatchConfigFileFormat => "InvalidWatchConfigFileFormat", - Code::NotFoundResourceConfigFile => "NotFoundResourceConfigFile", - Code::InvalidConfigFileTemplateName => "InvalidConfigFileTemplateName", - Code::EncryptConfigFileException => "EncryptConfigFileException", - Code::DecryptConfigFileException => "DecryptConfigFileException", - Code::InvalidUserOwners => "InvalidUserOwners", - Code::InvalidUserId => "InvalidUserID", - Code::InvalidUserPassword => "InvalidUserPassword", - Code::InvalidUserMobile => "InvalidUserMobile", - Code::InvalidUserEmail => "InvalidUserEmail", - Code::InvalidUserGroupOwners => "InvalidUserGroupOwners", - Code::InvalidUserGroupId => "InvalidUserGroupID", - Code::InvalidAuthStrategyOwners => "InvalidAuthStrategyOwners", - Code::InvalidAuthStrategyName => "InvalidAuthStrategyName", - Code::InvalidAuthStrategyId => "InvalidAuthStrategyID", - Code::InvalidPrincipalType => "InvalidPrincipalType", - Code::UserExisted => "UserExisted", - Code::UserGroupExisted => "UserGroupExisted", - Code::AuthStrategyRuleExisted => "AuthStrategyRuleExisted", - Code::SubAccountExisted => "SubAccountExisted", - Code::NotFoundUser => "NotFoundUser", - Code::NotFoundOwnerUser => "NotFoundOwnerUser", - Code::NotFoundUserGroup => "NotFoundUserGroup", - Code::NotFoundAuthStrategyRule => "NotFoundAuthStrategyRule", - Code::NotAllowModifyDefaultStrategyPrincipal => { - "NotAllowModifyDefaultStrategyPrincipal" - } - Code::NotAllowModifyOwnerDefaultStrategy => { - "NotAllowModifyOwnerDefaultStrategy" - } - Code::EmptyAutToken => "EmptyAutToken", - Code::TokenDisabled => "TokenDisabled", - Code::TokenNotExisted => "TokenNotExisted", - Code::AuthTokenForbidden => "AuthTokenForbidden", - Code::OperationRoleForbidden => "OperationRoleForbidden", + Level::Unknown => "UNKNOWN", + Level::Service => "SERVICE", + Level::Method => "METHOD", + Level::Group => "GROUP", + Level::Instance => "INSTANCE", } } /// Creates an enum from field names used in the ProtoBuf definition. pub fn from_str_name(value: &str) -> ::core::option::Option { match value { - "Unknown" => Some(Self::Unknown), - "ExecuteSuccess" => Some(Self::ExecuteSuccess), - "DataNoChange" => Some(Self::DataNoChange), - "NoNeedUpdate" => Some(Self::NoNeedUpdate), - "BadRequest" => Some(Self::BadRequest), - "ParseException" => Some(Self::ParseException), - "EmptyRequest" => Some(Self::EmptyRequest), - "BatchSizeOverLimit" => Some(Self::BatchSizeOverLimit), - "InvalidDiscoverResource" => Some(Self::InvalidDiscoverResource), - "InvalidRequestID" => Some(Self::InvalidRequestId), - "InvalidUserName" => Some(Self::InvalidUserName), - "InvalidUserToken" => Some(Self::InvalidUserToken), - "InvalidParameter" => Some(Self::InvalidParameter), - "EmptyQueryParameter" => Some(Self::EmptyQueryParameter), - "InvalidQueryInsParameter" => Some(Self::InvalidQueryInsParameter), - "InvalidNamespaceName" => Some(Self::InvalidNamespaceName), - "InvalidNamespaceOwners" => Some(Self::InvalidNamespaceOwners), - "InvalidNamespaceToken" => Some(Self::InvalidNamespaceToken), - "InvalidServiceName" => Some(Self::InvalidServiceName), - "InvalidServiceOwners" => Some(Self::InvalidServiceOwners), - "InvalidServiceToken" => Some(Self::InvalidServiceToken), - "InvalidServiceMetadata" => Some(Self::InvalidServiceMetadata), - "InvalidServicePorts" => Some(Self::InvalidServicePorts), - "InvalidServiceBusiness" => Some(Self::InvalidServiceBusiness), - "InvalidServiceDepartment" => Some(Self::InvalidServiceDepartment), - "InvalidServiceCMDB" => Some(Self::InvalidServiceCmdb), - "InvalidServiceComment" => Some(Self::InvalidServiceComment), - "InvalidServiceAliasComment" => Some(Self::InvalidServiceAliasComment), - "InvalidInstanceID" => Some(Self::InvalidInstanceId), - "InvalidInstanceHost" => Some(Self::InvalidInstanceHost), - "InvalidInstancePort" => Some(Self::InvalidInstancePort), - "InvalidServiceAlias" => Some(Self::InvalidServiceAlias), - "InvalidNamespaceWithAlias" => Some(Self::InvalidNamespaceWithAlias), - "InvalidServiceAliasOwners" => Some(Self::InvalidServiceAliasOwners), - "InvalidInstanceProtocol" => Some(Self::InvalidInstanceProtocol), - "InvalidInstanceVersion" => Some(Self::InvalidInstanceVersion), - "InvalidInstanceLogicSet" => Some(Self::InvalidInstanceLogicSet), - "InvalidInstanceIsolate" => Some(Self::InvalidInstanceIsolate), - "HealthCheckNotOpen" => Some(Self::HealthCheckNotOpen), - "HeartbeatOnDisabledIns" => Some(Self::HeartbeatOnDisabledIns), - "HeartbeatExceedLimit" => Some(Self::HeartbeatExceedLimit), - "HeartbeatTypeNotFound" => Some(Self::HeartbeatTypeNotFound), - "InvalidMetadata" => Some(Self::InvalidMetadata), - "InvalidRateLimitID" => Some(Self::InvalidRateLimitId), - "InvalidRateLimitLabels" => Some(Self::InvalidRateLimitLabels), - "InvalidRateLimitAmounts" => Some(Self::InvalidRateLimitAmounts), - "InvalidRateLimitName" => Some(Self::InvalidRateLimitName), - "InvalidCircuitBreakerID" => Some(Self::InvalidCircuitBreakerId), - "InvalidCircuitBreakerVersion" => Some(Self::InvalidCircuitBreakerVersion), - "InvalidCircuitBreakerName" => Some(Self::InvalidCircuitBreakerName), - "InvalidCircuitBreakerNamespace" => { - Some(Self::InvalidCircuitBreakerNamespace) - } - "InvalidCircuitBreakerOwners" => Some(Self::InvalidCircuitBreakerOwners), - "InvalidCircuitBreakerToken" => Some(Self::InvalidCircuitBreakerToken), - "InvalidCircuitBreakerBusiness" => Some(Self::InvalidCircuitBreakerBusiness), - "InvalidCircuitBreakerDepartment" => { - Some(Self::InvalidCircuitBreakerDepartment) - } - "InvalidCircuitBreakerComment" => Some(Self::InvalidCircuitBreakerComment), - "CircuitBreakerRuleExisted" => Some(Self::CircuitBreakerRuleExisted), - "InvalidRoutingID" => Some(Self::InvalidRoutingId), - "InvalidRoutingPolicy" => Some(Self::InvalidRoutingPolicy), - "InvalidRoutingName" => Some(Self::InvalidRoutingName), - "InvalidRoutingPriority" => Some(Self::InvalidRoutingPriority), - "InvalidFaultDetectID" => Some(Self::InvalidFaultDetectId), - "InvalidFaultDetectName" => Some(Self::InvalidFaultDetectName), - "InvalidFaultDetectNamespace" => Some(Self::InvalidFaultDetectNamespace), - "FaultDetectRuleExisted" => Some(Self::FaultDetectRuleExisted), - "ServicesExistedMesh" => Some(Self::ServicesExistedMesh), - "ResourcesExistedMesh" => Some(Self::ResourcesExistedMesh), - "InvalidMeshParameter" => Some(Self::InvalidMeshParameter), - "InvalidPlatformID" => Some(Self::InvalidPlatformId), - "InvalidPlatformName" => Some(Self::InvalidPlatformName), - "InvalidPlatformDomain" => Some(Self::InvalidPlatformDomain), - "InvalidPlatformQPS" => Some(Self::InvalidPlatformQps), - "InvalidPlatformToken" => Some(Self::InvalidPlatformToken), - "InvalidPlatformOwner" => Some(Self::InvalidPlatformOwner), - "InvalidPlatformDepartment" => Some(Self::InvalidPlatformDepartment), - "InvalidPlatformComment" => Some(Self::InvalidPlatformComment), - "NotFoundPlatform" => Some(Self::NotFoundPlatform), - "InvalidFluxRateLimitId" => Some(Self::InvalidFluxRateLimitId), - "InvalidFluxRateLimitQps" => Some(Self::InvalidFluxRateLimitQps), - "InvalidFluxRateLimitSetKey" => Some(Self::InvalidFluxRateLimitSetKey), - "ExistedResource" => Some(Self::ExistedResource), - "NotFoundResource" => Some(Self::NotFoundResource), - "NamespaceExistedServices" => Some(Self::NamespaceExistedServices), - "ServiceExistedInstances" => Some(Self::ServiceExistedInstances), - "ServiceExistedRoutings" => Some(Self::ServiceExistedRoutings), - "ServiceExistedRateLimits" => Some(Self::ServiceExistedRateLimits), - "ExistReleasedConfig" => Some(Self::ExistReleasedConfig), - "SameInstanceRequest" => Some(Self::SameInstanceRequest), - "ServiceExistedCircuitBreakers" => Some(Self::ServiceExistedCircuitBreakers), - "ServiceExistedAlias" => Some(Self::ServiceExistedAlias), - "NamespaceExistedMeshResources" => Some(Self::NamespaceExistedMeshResources), - "NamespaceExistedCircuitBreakers" => { - Some(Self::NamespaceExistedCircuitBreakers) - } - "ServiceSubscribedByMeshes" => Some(Self::ServiceSubscribedByMeshes), - "ServiceExistedFluxRateLimits" => Some(Self::ServiceExistedFluxRateLimits), - "NamespaceExistedConfigGroups" => Some(Self::NamespaceExistedConfigGroups), - "NotFoundService" => Some(Self::NotFoundService), - "NotFoundRouting" => Some(Self::NotFoundRouting), - "NotFoundInstance" => Some(Self::NotFoundInstance), - "NotFoundServiceAlias" => Some(Self::NotFoundServiceAlias), - "NotFoundNamespace" => Some(Self::NotFoundNamespace), - "NotFoundSourceService" => Some(Self::NotFoundSourceService), - "NotFoundRateLimit" => Some(Self::NotFoundRateLimit), - "NotFoundCircuitBreaker" => Some(Self::NotFoundCircuitBreaker), - "NotFoundMasterConfig" => Some(Self::NotFoundMasterConfig), - "NotFoundTagConfig" => Some(Self::NotFoundTagConfig), - "NotFoundTagConfigOrService" => Some(Self::NotFoundTagConfigOrService), - "ClientAPINotOpen" => Some(Self::ClientApiNotOpen), - "NotAllowBusinessService" => Some(Self::NotAllowBusinessService), - "NotAllowAliasUpdate" => Some(Self::NotAllowAliasUpdate), - "NotAllowAliasCreateInstance" => Some(Self::NotAllowAliasCreateInstance), - "NotAllowAliasCreateRouting" => Some(Self::NotAllowAliasCreateRouting), - "NotAllowCreateAliasForAlias" => Some(Self::NotAllowCreateAliasForAlias), - "NotAllowAliasCreateRateLimit" => Some(Self::NotAllowAliasCreateRateLimit), - "NotAllowAliasBindRule" => Some(Self::NotAllowAliasBindRule), - "NotAllowDifferentNamespaceBindRule" => { - Some(Self::NotAllowDifferentNamespaceBindRule) - } - "Unauthorized" => Some(Self::Unauthorized), - "NotAllowedAccess" => Some(Self::NotAllowedAccess), - "CMDBNotFindHost" => Some(Self::CmdbNotFindHost), - "DataConflict" => Some(Self::DataConflict), - "InstanceTooManyRequests" => Some(Self::InstanceTooManyRequests), - "IPRateLimit" => Some(Self::IpRateLimit), - "APIRateLimit" => Some(Self::ApiRateLimit), - "ExecuteException" => Some(Self::ExecuteException), - "StoreLayerException" => Some(Self::StoreLayerException), - "CMDBPluginException" => Some(Self::CmdbPluginException), - "ParseRoutingException" => Some(Self::ParseRoutingException), - "ParseRateLimitException" => Some(Self::ParseRateLimitException), - "ParseCircuitBreakerException" => Some(Self::ParseCircuitBreakerException), - "HeartbeatException" => Some(Self::HeartbeatException), - "InstanceRegisTimeout" => Some(Self::InstanceRegisTimeout), - "InvalidConfigFileGroupName" => Some(Self::InvalidConfigFileGroupName), - "InvalidConfigFileName" => Some(Self::InvalidConfigFileName), - "InvalidConfigFileContentLength" => { - Some(Self::InvalidConfigFileContentLength) - } - "InvalidConfigFileFormat" => Some(Self::InvalidConfigFileFormat), - "InvalidConfigFileTags" => Some(Self::InvalidConfigFileTags), - "InvalidWatchConfigFileFormat" => Some(Self::InvalidWatchConfigFileFormat), - "NotFoundResourceConfigFile" => Some(Self::NotFoundResourceConfigFile), - "InvalidConfigFileTemplateName" => Some(Self::InvalidConfigFileTemplateName), - "EncryptConfigFileException" => Some(Self::EncryptConfigFileException), - "DecryptConfigFileException" => Some(Self::DecryptConfigFileException), - "InvalidUserOwners" => Some(Self::InvalidUserOwners), - "InvalidUserID" => Some(Self::InvalidUserId), - "InvalidUserPassword" => Some(Self::InvalidUserPassword), - "InvalidUserMobile" => Some(Self::InvalidUserMobile), - "InvalidUserEmail" => Some(Self::InvalidUserEmail), - "InvalidUserGroupOwners" => Some(Self::InvalidUserGroupOwners), - "InvalidUserGroupID" => Some(Self::InvalidUserGroupId), - "InvalidAuthStrategyOwners" => Some(Self::InvalidAuthStrategyOwners), - "InvalidAuthStrategyName" => Some(Self::InvalidAuthStrategyName), - "InvalidAuthStrategyID" => Some(Self::InvalidAuthStrategyId), - "InvalidPrincipalType" => Some(Self::InvalidPrincipalType), - "UserExisted" => Some(Self::UserExisted), - "UserGroupExisted" => Some(Self::UserGroupExisted), - "AuthStrategyRuleExisted" => Some(Self::AuthStrategyRuleExisted), - "SubAccountExisted" => Some(Self::SubAccountExisted), - "NotFoundUser" => Some(Self::NotFoundUser), - "NotFoundOwnerUser" => Some(Self::NotFoundOwnerUser), - "NotFoundUserGroup" => Some(Self::NotFoundUserGroup), - "NotFoundAuthStrategyRule" => Some(Self::NotFoundAuthStrategyRule), - "NotAllowModifyDefaultStrategyPrincipal" => { - Some(Self::NotAllowModifyDefaultStrategyPrincipal) - } - "NotAllowModifyOwnerDefaultStrategy" => { - Some(Self::NotAllowModifyOwnerDefaultStrategy) - } - "EmptyAutToken" => Some(Self::EmptyAutToken), - "TokenDisabled" => Some(Self::TokenDisabled), - "TokenNotExisted" => Some(Self::TokenNotExisted), - "AuthTokenForbidden" => Some(Self::AuthTokenForbidden), - "OperationRoleForbidden" => Some(Self::OperationRoleForbidden), + "UNKNOWN" => Some(Self::Unknown), + "SERVICE" => Some(Self::Service), + "METHOD" => Some(Self::Method), + "GROUP" => Some(Self::Group), + "INSTANCE" => Some(Self::Instance), _ => None, } } } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ConfigFileGroup { - #[prost(message, optional, tag = "1")] - pub id: ::core::option::Option, - #[prost(message, optional, tag = "2")] - pub name: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "3")] - pub namespace: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "4")] - pub comment: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "5")] - pub create_time: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "6")] - pub create_by: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "7")] - pub modify_time: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "8")] - pub modify_by: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "9")] - pub file_count: ::core::option::Option, - #[prost(message, repeated, tag = "10")] - pub user_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(message, repeated, tag = "11")] - pub group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(message, repeated, tag = "13")] - pub remove_user_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(message, repeated, tag = "14")] - pub remove_group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(message, optional, tag = "15")] - pub editable: ::core::option::Option, - #[prost(message, optional, tag = "16")] - pub owner: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "17")] - pub business: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "18")] - pub department: ::core::option::Option<::prost::alloc::string::String>, - #[prost(map = "string, string", tag = "19")] - pub metadata: ::std::collections::HashMap< - ::prost::alloc::string::String, - ::prost::alloc::string::String, - >, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ConfigFile { +pub struct ConfigRelease { #[prost(message, optional, tag = "1")] - pub id: ::core::option::Option, + pub service: ::core::option::Option, #[prost(message, optional, tag = "2")] - pub name: ::core::option::Option<::prost::alloc::string::String>, + pub ctime: ::core::option::Option<::prost::alloc::string::String>, #[prost(message, optional, tag = "3")] - pub namespace: ::core::option::Option<::prost::alloc::string::String>, + pub mtime: ::core::option::Option<::prost::alloc::string::String>, #[prost(message, optional, tag = "4")] - pub group: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "5")] - pub content: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "6")] - pub format: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "7")] - pub comment: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "8")] - pub status: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, repeated, tag = "9")] - pub tags: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "10")] - pub create_time: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "11")] - pub create_by: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "12")] - pub modify_time: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "13")] - pub modify_by: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "14")] - pub release_time: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "15")] - pub release_by: ::core::option::Option<::prost::alloc::string::String>, - /// 是否为加密配置文件 - #[prost(message, optional, tag = "16")] - pub encrypted: ::core::option::Option, - /// 加密算法 - #[prost(message, optional, tag = "17")] - pub encrypt_algo: ::core::option::Option<::prost::alloc::string::String>, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ConfigFileTag { - #[prost(message, optional, tag = "1")] - pub key: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "2")] - pub value: ::core::option::Option<::prost::alloc::string::String>, + pub circuit_breaker: ::core::option::Option, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ConfigFileRelease { - #[prost(message, optional, tag = "1")] - pub id: ::core::option::Option, +pub struct ConfigWithService { + #[prost(message, repeated, tag = "1")] + pub services: ::prost::alloc::vec::Vec, #[prost(message, optional, tag = "2")] - pub name: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "3")] - pub namespace: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "4")] - pub group: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "5")] - pub file_name: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "6")] - pub content: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "7")] - pub comment: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "8")] - pub md5: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "9")] - pub version: ::core::option::Option, - #[prost(message, optional, tag = "10")] - pub create_time: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "11")] - pub create_by: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "12")] - pub modify_time: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "13")] - pub modify_by: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, repeated, tag = "14")] - pub tags: ::prost::alloc::vec::Vec, - /// 当前生效配置 - #[prost(message, optional, tag = "15")] - pub active: ::core::option::Option, + pub circuit_breaker: ::core::option::Option, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ConfigFileReleaseHistory { - #[prost(message, optional, tag = "1")] - pub id: ::core::option::Option, - #[prost(message, optional, tag = "2")] - pub name: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "3")] - pub namespace: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "4")] - pub group: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "5")] - pub file_name: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "6")] - pub content: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "7")] - pub format: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "8")] - pub comment: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "9")] - pub md5: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "10")] - pub r#type: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "11")] - pub status: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, repeated, tag = "12")] - pub tags: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "13")] - pub create_time: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "14")] - pub create_by: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "15")] - pub modify_time: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "16")] - pub modify_by: ::core::option::Option<::prost::alloc::string::String>, - /// 配置发布失败的原因 - #[prost(message, optional, tag = "17")] - pub reason: ::core::option::Option<::prost::alloc::string::String>, +pub struct FaultDetector { + /// fault detect rules for current service + #[prost(message, repeated, tag = "1")] + pub rules: ::prost::alloc::vec::Vec, + /// total revision for the fault detect rules + #[prost(string, tag = "2")] + pub revision: ::prost::alloc::string::String, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ConfigFileTemplate { +pub struct FaultDetectRule { + #[prost(string, tag = "1")] + pub id: ::prost::alloc::string::String, + /// rule name + #[prost(string, tag = "2")] + pub name: ::prost::alloc::string::String, + /// namespace of rule + #[prost(string, tag = "3")] + pub namespace: ::prost::alloc::string::String, + /// revision routing version + #[prost(string, tag = "4")] + pub revision: ::prost::alloc::string::String, + /// ctime create time of the rules + #[prost(string, tag = "5")] + pub ctime: ::prost::alloc::string::String, + /// mtime modify time of the rules + #[prost(string, tag = "6")] + pub mtime: ::prost::alloc::string::String, + /// description simple description rules + #[prost(string, tag = "7")] + pub description: ::prost::alloc::string::String, + /// detect target + #[prost(message, optional, tag = "21")] + pub target_service: ::core::option::Option, + /// detect interval + #[prost(uint32, tag = "22")] + pub interval: u32, + /// detect timeout + #[prost(uint32, tag = "23")] + pub timeout: u32, + /// detect port + #[prost(uint32, tag = "24")] + pub port: u32, + #[prost(enumeration = "fault_detect_rule::Protocol", tag = "25")] + pub protocol: i32, + /// http detect config + #[prost(message, optional, tag = "26")] + pub http_config: ::core::option::Option, + /// tcp detect config + #[prost(message, optional, tag = "27")] + pub tcp_config: ::core::option::Option, + /// udp detect config + #[prost(message, optional, tag = "28")] + pub udp_config: ::core::option::Option, + /// priority rules priority + #[prost(uint32, tag = "29")] + pub priority: u32, + /// 探测规则标签数据 + #[prost(map = "string, string", tag = "50")] + pub metadata: ::std::collections::HashMap< + ::prost::alloc::string::String, + ::prost::alloc::string::String, + >, +} +/// Nested message and enum types in `FaultDetectRule`. +pub mod fault_detect_rule { + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct DestinationService { + #[prost(string, tag = "1")] + pub service: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub namespace: ::prost::alloc::string::String, + /// deprecated_filed use api.path instead + #[deprecated] + #[prost(message, optional, tag = "3")] + pub method: ::core::option::Option, + #[prost(message, optional, tag = "4")] + pub api: ::core::option::Option, + } + /// detect protocol + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum Protocol { + Unknown = 0, + Http = 1, + Tcp = 2, + Udp = 3, + } + impl Protocol { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Protocol::Unknown => "UNKNOWN", + Protocol::Http => "HTTP", + Protocol::Tcp => "TCP", + Protocol::Udp => "UDP", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "UNKNOWN" => Some(Self::Unknown), + "HTTP" => Some(Self::Http), + "TCP" => Some(Self::Tcp), + "UDP" => Some(Self::Udp), + _ => None, + } + } + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct HttpProtocolConfig { + #[prost(string, tag = "1")] + pub method: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub url: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "3")] + pub headers: ::prost::alloc::vec::Vec, + #[prost(string, tag = "4")] + pub body: ::prost::alloc::string::String, +} +/// Nested message and enum types in `HttpProtocolConfig`. +pub mod http_protocol_config { + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct MessageHeader { + #[prost(string, tag = "1")] + pub key: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub value: ::prost::alloc::string::String, + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TcpProtocolConfig { + #[prost(string, tag = "1")] + pub send: ::prost::alloc::string::String, + #[prost(string, repeated, tag = "2")] + pub receive: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UdpProtocolConfig { + #[prost(string, tag = "1")] + pub send: ::prost::alloc::string::String, + #[prost(string, repeated, tag = "2")] + pub receive: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct LoginRequest { #[prost(message, optional, tag = "1")] - pub id: ::core::option::Option, + pub owner: ::core::option::Option<::prost::alloc::string::String>, #[prost(message, optional, tag = "2")] pub name: ::core::option::Option<::prost::alloc::string::String>, #[prost(message, optional, tag = "3")] - pub content: ::core::option::Option<::prost::alloc::string::String>, + pub password: ::core::option::Option<::prost::alloc::string::String>, + #[prost(map = "string, string", tag = "4")] + pub options: ::std::collections::HashMap< + ::prost::alloc::string::String, + ::prost::alloc::string::String, + >, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct LoginResponse { + #[prost(message, optional, tag = "1")] + pub user_id: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "2")] + pub name: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "3")] + pub role: ::core::option::Option<::prost::alloc::string::String>, #[prost(message, optional, tag = "4")] - pub format: ::core::option::Option<::prost::alloc::string::String>, + pub owner_id: ::core::option::Option<::prost::alloc::string::String>, #[prost(message, optional, tag = "5")] - pub comment: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "6")] - pub create_time: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "7")] - pub create_by: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "8")] - pub modify_time: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "9")] - pub modify_by: ::core::option::Option<::prost::alloc::string::String>, + pub token: ::core::option::Option<::prost::alloc::string::String>, + #[prost(map = "string, string", tag = "6")] + pub options: ::std::collections::HashMap< + ::prost::alloc::string::String, + ::prost::alloc::string::String, + >, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ClientConfigFileInfo { +pub struct User { #[prost(message, optional, tag = "1")] - pub namespace: ::core::option::Option<::prost::alloc::string::String>, + pub id: ::core::option::Option<::prost::alloc::string::String>, #[prost(message, optional, tag = "2")] - pub group: ::core::option::Option<::prost::alloc::string::String>, + pub name: ::core::option::Option<::prost::alloc::string::String>, #[prost(message, optional, tag = "3")] - pub file_name: ::core::option::Option<::prost::alloc::string::String>, + pub password: ::core::option::Option<::prost::alloc::string::String>, #[prost(message, optional, tag = "4")] - pub content: ::core::option::Option<::prost::alloc::string::String>, + pub owner: ::core::option::Option<::prost::alloc::string::String>, #[prost(message, optional, tag = "5")] - pub version: ::core::option::Option, + pub source: ::core::option::Option<::prost::alloc::string::String>, #[prost(message, optional, tag = "6")] - pub md5: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, repeated, tag = "7")] - pub tags: ::prost::alloc::vec::Vec, - /// 是否为加密配置文件 + pub auth_token: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "7")] + pub token_enable: ::core::option::Option, #[prost(message, optional, tag = "8")] - pub encrypted: ::core::option::Option, - /// 公钥,用于加密数据密钥 + pub comment: ::core::option::Option<::prost::alloc::string::String>, #[prost(message, optional, tag = "9")] - pub public_key: ::core::option::Option<::prost::alloc::string::String>, - /// 配置文件版本名称 + pub ctime: ::core::option::Option<::prost::alloc::string::String>, #[prost(message, optional, tag = "10")] - pub name: ::core::option::Option<::prost::alloc::string::String>, - /// 配置文件的发布时间 + pub mtime: ::core::option::Option<::prost::alloc::string::String>, #[prost(message, optional, tag = "11")] - pub release_time: ::core::option::Option<::prost::alloc::string::String>, + pub user_type: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "12")] + pub mobile: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "13")] + pub email: ::core::option::Option<::prost::alloc::string::String>, + #[prost(map = "string, string", tag = "14")] + pub metadata: ::std::collections::HashMap< + ::prost::alloc::string::String, + ::prost::alloc::string::String, + >, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ClientWatchConfigFileRequest { +pub struct ModifyUserPassword { #[prost(message, optional, tag = "1")] - pub client_ip: ::core::option::Option<::prost::alloc::string::String>, + pub id: ::core::option::Option<::prost::alloc::string::String>, #[prost(message, optional, tag = "2")] - pub service_name: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, repeated, tag = "3")] - pub watch_files: ::prost::alloc::vec::Vec, + pub old_password: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "3")] + pub new_password: ::core::option::Option<::prost::alloc::string::String>, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ConfigFileExportRequest { +pub struct UserGroupRelation { #[prost(message, optional, tag = "1")] - pub namespace: ::core::option::Option<::prost::alloc::string::String>, + pub group_id: ::core::option::Option<::prost::alloc::string::String>, #[prost(message, repeated, tag = "2")] - pub groups: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(message, repeated, tag = "3")] - pub names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ConfigSimpleResponse { - #[prost(message, optional, tag = "1")] - pub code: ::core::option::Option, - #[prost(message, optional, tag = "2")] - pub info: ::core::option::Option<::prost::alloc::string::String>, + pub users: ::prost::alloc::vec::Vec, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ConfigResponse { +pub struct UserGroup { #[prost(message, optional, tag = "1")] - pub code: ::core::option::Option, + pub id: ::core::option::Option<::prost::alloc::string::String>, #[prost(message, optional, tag = "2")] - pub info: ::core::option::Option<::prost::alloc::string::String>, + pub name: ::core::option::Option<::prost::alloc::string::String>, #[prost(message, optional, tag = "3")] - pub config_file_group: ::core::option::Option, + pub owner: ::core::option::Option<::prost::alloc::string::String>, #[prost(message, optional, tag = "4")] - pub config_file: ::core::option::Option, + pub auth_token: ::core::option::Option<::prost::alloc::string::String>, #[prost(message, optional, tag = "5")] - pub config_file_release: ::core::option::Option, + pub token_enable: ::core::option::Option, #[prost(message, optional, tag = "6")] - pub config_file_release_history: ::core::option::Option, + pub comment: ::core::option::Option<::prost::alloc::string::String>, #[prost(message, optional, tag = "7")] - pub config_file_template: ::core::option::Option, + pub ctime: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "8")] + pub mtime: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "9")] + pub relation: ::core::option::Option, + #[prost(message, optional, tag = "10")] + pub user_count: ::core::option::Option, + #[prost(message, optional, tag = "11")] + pub source: ::core::option::Option<::prost::alloc::string::String>, + #[prost(map = "string, string", tag = "12")] + pub metadata: ::std::collections::HashMap< + ::prost::alloc::string::String, + ::prost::alloc::string::String, + >, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ConfigBatchWriteResponse { +pub struct ModifyUserGroup { #[prost(message, optional, tag = "1")] - pub code: ::core::option::Option, + pub id: ::core::option::Option<::prost::alloc::string::String>, #[prost(message, optional, tag = "2")] - pub info: ::core::option::Option<::prost::alloc::string::String>, + pub owner: ::core::option::Option<::prost::alloc::string::String>, #[prost(message, optional, tag = "3")] - pub total: ::core::option::Option, - #[prost(message, repeated, tag = "4")] - pub responses: ::prost::alloc::vec::Vec, + pub name: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "4")] + pub auth_token: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "5")] + pub token_enable: ::core::option::Option, + #[prost(message, optional, tag = "6")] + pub comment: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "7")] + pub add_relations: ::core::option::Option, + #[prost(message, optional, tag = "8")] + pub remove_relations: ::core::option::Option, + #[prost(map = "string, string", tag = "9")] + pub metadata: ::std::collections::HashMap< + ::prost::alloc::string::String, + ::prost::alloc::string::String, + >, + #[prost(message, optional, tag = "10")] + pub source: ::core::option::Option<::prost::alloc::string::String>, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ConfigBatchQueryResponse { - #[prost(message, optional, tag = "1")] - pub code: ::core::option::Option, - #[prost(message, optional, tag = "2")] - pub info: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "3")] - pub total: ::core::option::Option, - #[prost(message, repeated, tag = "4")] - pub config_file_groups: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "5")] - pub config_files: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "6")] - pub config_file_releases: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "7")] - pub config_file_release_histories: ::prost::alloc::vec::Vec< - ConfigFileReleaseHistory, +pub struct Role { + #[prost(string, tag = "1")] + pub id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub name: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub owner: ::prost::alloc::string::String, + #[prost(string, tag = "5")] + pub source: ::prost::alloc::string::String, + #[prost(bool, tag = "6")] + pub default_role: bool, + #[prost(map = "string, string", tag = "7")] + pub metadata: ::std::collections::HashMap< + ::prost::alloc::string::String, + ::prost::alloc::string::String, >, - #[prost(message, repeated, tag = "8")] - pub config_file_templates: ::prost::alloc::vec::Vec, + #[prost(string, tag = "8")] + pub comment: ::prost::alloc::string::String, + #[prost(string, tag = "9")] + pub ctime: ::prost::alloc::string::String, + #[prost(string, tag = "10")] + pub mtime: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "20")] + pub users: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "21")] + pub user_groups: ::prost::alloc::vec::Vec, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ConfigClientResponse { +pub struct Principal { #[prost(message, optional, tag = "1")] - pub code: ::core::option::Option, + pub id: ::core::option::Option<::prost::alloc::string::String>, #[prost(message, optional, tag = "2")] - pub info: ::core::option::Option<::prost::alloc::string::String>, - #[prost(message, optional, tag = "3")] - pub config_file: ::core::option::Option, + pub name: ::core::option::Option<::prost::alloc::string::String>, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ConfigImportResponse { - #[prost(message, optional, tag = "1")] - pub code: ::core::option::Option, - #[prost(message, optional, tag = "2")] - pub info: ::core::option::Option<::prost::alloc::string::String>, +pub struct Principals { + #[prost(message, repeated, tag = "1")] + pub users: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "2")] + pub groups: ::prost::alloc::vec::Vec, #[prost(message, repeated, tag = "3")] - pub create_config_files: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "4")] - pub skip_config_files: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "5")] - pub overwrite_config_files: ::prost::alloc::vec::Vec, + pub roles: ::prost::alloc::vec::Vec, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ConfigExportResponse { +pub struct StrategyResourceEntry { #[prost(message, optional, tag = "1")] - pub code: ::core::option::Option, + pub id: ::core::option::Option<::prost::alloc::string::String>, #[prost(message, optional, tag = "2")] - pub info: ::core::option::Option<::prost::alloc::string::String>, + pub namespace: ::core::option::Option<::prost::alloc::string::String>, #[prost(message, optional, tag = "3")] - pub data: ::core::option::Option<::prost::alloc::vec::Vec>, + pub name: ::core::option::Option<::prost::alloc::string::String>, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ConfigEncryptAlgorithmResponse { +pub struct StrategyResources { #[prost(message, optional, tag = "1")] - pub code: ::core::option::Option, - #[prost(message, optional, tag = "2")] - pub info: ::core::option::Option<::prost::alloc::string::String>, + pub strategy_id: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, repeated, tag = "2")] + pub namespaces: ::prost::alloc::vec::Vec, #[prost(message, repeated, tag = "3")] - pub algorithms: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + pub services: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "4")] + pub config_groups: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "5")] + pub route_rules: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "6")] + pub ratelimit_rules: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "7")] + pub circuitbreaker_rules: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "8")] + pub faultdetect_rules: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "9")] + pub lane_rules: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "21")] + pub users: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "22")] + pub user_groups: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "23")] + pub roles: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "24")] + pub auth_policies: ::prost::alloc::vec::Vec, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ConfigClientListResponse { - #[prost(message, optional, tag = "1")] - pub code: ::core::option::Option, - #[prost(message, optional, tag = "2")] - pub info: ::core::option::Option<::prost::alloc::string::String>, +pub struct StrategyResourceLabel { + #[prost(string, tag = "1")] + pub key: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub value: ::prost::alloc::string::String, #[prost(string, tag = "3")] - pub namespace: ::prost::alloc::string::String, - #[prost(string, tag = "4")] - pub group: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "5")] - pub config_file_names: ::prost::alloc::vec::Vec, + pub compare_type: ::prost::alloc::string::String, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DiscoverRequest { - #[prost(enumeration = "discover_request::DiscoverRequestType", tag = "1")] - pub r#type: i32, +pub struct AuthStrategy { + #[prost(message, optional, tag = "1")] + pub id: ::core::option::Option<::prost::alloc::string::String>, #[prost(message, optional, tag = "2")] - pub service: ::core::option::Option, -} -/// Nested message and enum types in `DiscoverRequest`. -pub mod discover_request { - #[derive( - Clone, - Copy, - Debug, - PartialEq, - Eq, - Hash, - PartialOrd, - Ord, - ::prost::Enumeration - )] - #[repr(i32)] - pub enum DiscoverRequestType { - Unknown = 0, - Instance = 1, - Cluster = 2, - Routing = 3, - RateLimit = 4, - CircuitBreaker = 5, - Services = 6, - Namespaces = 12, - FaultDetector = 13, - } - impl DiscoverRequestType { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - DiscoverRequestType::Unknown => "UNKNOWN", - DiscoverRequestType::Instance => "INSTANCE", - DiscoverRequestType::Cluster => "CLUSTER", - DiscoverRequestType::Routing => "ROUTING", - DiscoverRequestType::RateLimit => "RATE_LIMIT", - DiscoverRequestType::CircuitBreaker => "CIRCUIT_BREAKER", - DiscoverRequestType::Services => "SERVICES", - DiscoverRequestType::Namespaces => "NAMESPACES", - DiscoverRequestType::FaultDetector => "FAULT_DETECTOR", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "UNKNOWN" => Some(Self::Unknown), - "INSTANCE" => Some(Self::Instance), - "CLUSTER" => Some(Self::Cluster), - "ROUTING" => Some(Self::Routing), - "RATE_LIMIT" => Some(Self::RateLimit), - "CIRCUIT_BREAKER" => Some(Self::CircuitBreaker), - "SERVICES" => Some(Self::Services), - "NAMESPACES" => Some(Self::Namespaces), - "FAULT_DETECTOR" => Some(Self::FaultDetector), - _ => None, - } - } - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct HeartbeatRecord { - #[prost(string, tag = "1")] - pub instance_id: ::prost::alloc::string::String, - #[prost(int64, tag = "6")] - pub last_heartbeat_sec: i64, - #[prost(bool, tag = "7")] - pub exist: bool, + pub name: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "3")] + pub principals: ::core::option::Option, + #[prost(message, optional, tag = "4")] + pub resources: ::core::option::Option, + #[prost(enumeration = "AuthAction", tag = "5")] + pub action: i32, + #[prost(message, optional, tag = "6")] + pub comment: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "7")] + pub owner: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "8")] + pub ctime: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "9")] + pub mtime: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "10")] + pub auth_token: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "11")] + pub default_strategy: ::core::option::Option, + #[prost(map = "string, string", tag = "12")] + pub metadata: ::std::collections::HashMap< + ::prost::alloc::string::String, + ::prost::alloc::string::String, + >, + #[prost(message, optional, tag = "13")] + pub source: ::core::option::Option<::prost::alloc::string::String>, + #[prost(string, repeated, tag = "14")] + pub functions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(message, repeated, tag = "15")] + pub resource_labels: ::prost::alloc::vec::Vec, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct InstanceHeartbeat { - #[prost(string, tag = "1")] - pub instance_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub service: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub namespace: ::prost::alloc::string::String, - #[prost(string, tag = "4")] - pub host: ::prost::alloc::string::String, - #[prost(uint32, tag = "5")] - pub port: u32, +pub struct ModifyAuthStrategy { + #[prost(message, optional, tag = "1")] + pub id: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "2")] + pub name: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "3")] + pub add_principals: ::core::option::Option, + #[prost(message, optional, tag = "4")] + pub remove_principals: ::core::option::Option, + #[prost(message, optional, tag = "5")] + pub add_resources: ::core::option::Option, + #[prost(message, optional, tag = "6")] + pub remove_resources: ::core::option::Option, + #[prost(enumeration = "AuthAction", tag = "7")] + pub action: i32, + #[prost(message, optional, tag = "8")] + pub comment: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "9")] + pub owner: ::core::option::Option<::prost::alloc::string::String>, + #[prost(map = "string, string", tag = "12")] + pub metadata: ::std::collections::HashMap< + ::prost::alloc::string::String, + ::prost::alloc::string::String, + >, + #[prost(message, optional, tag = "13")] + pub source: ::core::option::Option<::prost::alloc::string::String>, + #[prost(string, repeated, tag = "14")] + pub functions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(message, repeated, tag = "15")] + pub resource_labels: ::prost::alloc::vec::Vec, +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum AuthAction { + /// deprecated_filed 该字段从未使用过 + OnlyRead = 0, + /// deprecated_filed 使用 ALLOW 进行替代 + ReadWrite = 1, + Allow = 10, + Deny = 11, +} +impl AuthAction { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + AuthAction::OnlyRead => "ONLY_READ", + AuthAction::ReadWrite => "READ_WRITE", + AuthAction::Allow => "ALLOW", + AuthAction::Deny => "DENY", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "ONLY_READ" => Some(Self::OnlyRead), + "READ_WRITE" => Some(Self::ReadWrite), + "ALLOW" => Some(Self::Allow), + "DENY" => Some(Self::Deny), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum ResourceType { + Namespaces = 0, + Services = 1, + ConfigGroups = 2, + RouteRules = 3, + RateLimitRules = 4, + CircuitBreakerRules = 5, + FaultDetectRules = 6, + LaneRules = 7, + Users = 20, + UserGroups = 21, + Roles = 22, + PolicyRules = 23, } +impl ResourceType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + ResourceType::Namespaces => "Namespaces", + ResourceType::Services => "Services", + ResourceType::ConfigGroups => "ConfigGroups", + ResourceType::RouteRules => "RouteRules", + ResourceType::RateLimitRules => "RateLimitRules", + ResourceType::CircuitBreakerRules => "CircuitBreakerRules", + ResourceType::FaultDetectRules => "FaultDetectRules", + ResourceType::LaneRules => "LaneRules", + ResourceType::Users => "Users", + ResourceType::UserGroups => "UserGroups", + ResourceType::Roles => "Roles", + ResourceType::PolicyRules => "PolicyRules", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "Namespaces" => Some(Self::Namespaces), + "Services" => Some(Self::Services), + "ConfigGroups" => Some(Self::ConfigGroups), + "RouteRules" => Some(Self::RouteRules), + "RateLimitRules" => Some(Self::RateLimitRules), + "CircuitBreakerRules" => Some(Self::CircuitBreakerRules), + "FaultDetectRules" => Some(Self::FaultDetectRules), + "LaneRules" => Some(Self::LaneRules), + "Users" => Some(Self::Users), + "UserGroups" => Some(Self::UserGroups), + "Roles" => Some(Self::Roles), + "PolicyRules" => Some(Self::PolicyRules), + _ => None, + } + } +} +/// 流量入口 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct HeartbeatsRequest { - #[prost(message, repeated, tag = "1")] - pub heartbeats: ::prost::alloc::vec::Vec, +pub struct TrafficEntry { + /// 标记流量入口类型 + /// type == "polarismesh.cn/gateway/spring-cloud-gateway", 则 selector 为 + /// ServiceGatewaySelector type == "polarismesh.cn/service, 则 selector 为 + /// ServiceSelector + #[prost(string, tag = "1")] + pub r#type: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub selector: ::core::option::Option<::prost_types::Any>, } +/// 微服务网关入口定义 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct HeartbeatsResponse {} +pub struct ServiceGatewaySelector { + #[prost(string, tag = "1")] + pub namespace: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub service: ::prost::alloc::string::String, + /// 决定要不要部份 + #[prost(map = "string, message", tag = "3")] + pub labels: ::std::collections::HashMap<::prost::alloc::string::String, MatchString>, +} +/// 普通服务入口定义 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetHeartbeatsRequest { - #[prost(string, repeated, tag = "1")] - pub instance_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +pub struct ServiceSelector { + #[prost(string, tag = "1")] + pub namespace: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub service: ::prost::alloc::string::String, + /// 决定要不要部份 + #[prost(map = "string, message", tag = "3")] + pub labels: ::std::collections::HashMap<::prost::alloc::string::String, MatchString>, } +/// 泳道组实体定义 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetHeartbeatsResponse { - #[prost(message, repeated, tag = "1")] - pub records: ::prost::alloc::vec::Vec, +pub struct LaneGroup { + /// 泳道组 ID + #[prost(string, tag = "1")] + pub id: ::prost::alloc::string::String, + /// 泳道组名称 + #[prost(string, tag = "2")] + pub name: ::prost::alloc::string::String, + /// 泳道组内的流量入口信息 + #[prost(message, repeated, tag = "3")] + pub entries: ::prost::alloc::vec::Vec, + /// 在泳道组内的服务列表信息 + #[prost(message, repeated, tag = "4")] + pub destinations: ::prost::alloc::vec::Vec, + /// 泳道组描述信息 + #[prost(string, tag = "7")] + pub revision: ::prost::alloc::string::String, + /// 泳道组描述信息 + #[prost(string, tag = "8")] + pub description: ::prost::alloc::string::String, + /// 泳道组的创建时间 + #[prost(string, tag = "9")] + pub ctime: ::prost::alloc::string::String, + /// 泳道组的更新时间 + #[prost(string, tag = "10")] + pub mtime: ::prost::alloc::string::String, + /// 泳道组内的流量入口信息 + #[prost(message, repeated, tag = "11")] + pub rules: ::prost::alloc::vec::Vec, + /// 泳道组标签信息 + #[prost(map = "string, string", tag = "20")] + pub metadata: ::std::collections::HashMap< + ::prost::alloc::string::String, + ::prost::alloc::string::String, + >, } +/// TrafficMatchRule 流量匹配规则 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DelHeartbeatsRequest { - #[prost(string, repeated, tag = "1")] - pub instance_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +pub struct TrafficMatchRule { + /// 流量匹配规则,判断哪些流量需要进入泳道 + #[prost(message, repeated, tag = "4")] + pub arguments: ::prost::alloc::vec::Vec, + #[prost(enumeration = "traffic_match_rule::TrafficMatchMode", tag = "14")] + pub match_mode: i32, +} +/// Nested message and enum types in `TrafficMatchRule`. +pub mod traffic_match_rule { + /// 多个 SourceMatch 之间的判断关系 + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum TrafficMatchMode { + /// 与模式 + And = 0, + /// 或模式 + Or = 1, + } + impl TrafficMatchMode { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + TrafficMatchMode::And => "AND", + TrafficMatchMode::Or => "OR", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "AND" => Some(Self::And), + "OR" => Some(Self::Or), + _ => None, + } + } + } } +/// 泳道规则 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct DelHeartbeatsResponse { - #[prost(uint32, tag = "1")] - pub code: u32, +pub struct LaneRule { + #[prost(string, tag = "1")] + pub id: ::prost::alloc::string::String, #[prost(string, tag = "2")] - pub info: ::prost::alloc::string::String, + pub name: ::prost::alloc::string::String, + /// 所属泳道组的名称 + #[prost(string, tag = "3")] + pub group_name: ::prost::alloc::string::String, + /// 流量匹配规则 + #[prost(message, optional, tag = "4")] + pub traffic_match_rule: ::core::option::Option, + /// 保存这个泳道的默认实例标签 + #[prost(string, tag = "5")] + pub default_label_value: ::prost::alloc::string::String, + /// 泳道规则是否启用 + #[prost(bool, tag = "6")] + pub enable: bool, + #[prost(enumeration = "lane_rule::LaneMatchMode", tag = "7")] + pub match_mode: i32, + /// revision routing version + #[prost(string, tag = "8")] + pub revision: ::prost::alloc::string::String, + /// ctime create time of the rules + #[prost(string, tag = "9")] + pub ctime: ::prost::alloc::string::String, + /// mtime modify time of the rules + #[prost(string, tag = "10")] + pub mtime: ::prost::alloc::string::String, + /// etime enable time of the rules + #[prost(string, tag = "11")] + pub etime: ::prost::alloc::string::String, + /// priority rules priority + #[prost(uint32, tag = "12")] + pub priority: u32, + /// description simple description rules + #[prost(string, tag = "13")] + pub description: ::prost::alloc::string::String, +} +/// Nested message and enum types in `LaneRule`. +pub mod lane_rule { + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum LaneMatchMode { + /// 严格匹配模式 + Strict = 0, + /// 宽松匹配模式 + Permissive = 1, + } + impl LaneMatchMode { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + LaneMatchMode::Strict => "STRICT", + LaneMatchMode::Permissive => "PERMISSIVE", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "STRICT" => Some(Self::Strict), + "PERMISSIVE" => Some(Self::Permissive), + _ => None, + } + } + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Response { + #[prost(message, optional, tag = "1")] + pub code: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub info: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "3")] + pub client: ::core::option::Option, + #[prost(message, optional, tag = "4")] + pub namespace: ::core::option::Option, + #[prost(message, optional, tag = "5")] + pub service: ::core::option::Option, + #[prost(message, optional, tag = "6")] + pub instance: ::core::option::Option, + #[prost(message, optional, tag = "7")] + pub routing: ::core::option::Option, + #[prost(message, optional, tag = "8")] + pub alias: ::core::option::Option, + #[prost(message, optional, tag = "9")] + pub rate_limit: ::core::option::Option, + #[prost(message, optional, tag = "10")] + pub circuit_breaker: ::core::option::Option, + #[prost(message, optional, tag = "11")] + pub config_release: ::core::option::Option, + #[prost(message, optional, tag = "19")] + pub user: ::core::option::Option, + #[prost(message, optional, tag = "20")] + pub user_group: ::core::option::Option, + #[prost(message, optional, tag = "21")] + pub auth_strategy: ::core::option::Option, + #[prost(message, optional, tag = "22")] + pub relation: ::core::option::Option, + #[prost(message, optional, tag = "23")] + pub login_response: ::core::option::Option, + #[prost(message, optional, tag = "24")] + pub modify_auth_strategy: ::core::option::Option, + #[prost(message, optional, tag = "25")] + pub modify_user_group: ::core::option::Option, + #[prost(message, optional, tag = "26")] + pub resources: ::core::option::Option, + #[prost(message, optional, tag = "27")] + pub option_switch: ::core::option::Option, + #[prost(message, optional, tag = "28")] + pub instance_labels: ::core::option::Option, + #[prost(message, optional, tag = "29")] + pub data: ::core::option::Option<::prost_types::Any>, + #[prost(message, optional, tag = "30")] + pub service_contract: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct BatchWriteResponse { + #[prost(message, optional, tag = "1")] + pub code: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub info: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "3")] + pub size: ::core::option::Option, + #[prost(message, repeated, tag = "4")] + pub responses: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct BatchQueryResponse { + #[prost(message, optional, tag = "1")] + pub code: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub info: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "3")] + pub amount: ::core::option::Option, + #[prost(message, optional, tag = "4")] + pub size: ::core::option::Option, + #[prost(message, repeated, tag = "5")] + pub namespaces: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "6")] + pub services: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "7")] + pub instances: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "8")] + pub routings: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "9")] + pub aliases: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "10")] + pub rate_limits: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "11")] + pub config_with_services: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "18")] + pub users: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "19")] + pub user_groups: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "20")] + pub auth_strategies: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "21")] + pub clients: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "22")] + pub data: ::prost::alloc::vec::Vec<::prost_types::Any>, + #[prost(message, optional, tag = "23")] + pub summary: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DiscoverResponse { + #[prost(message, optional, tag = "1")] + pub code: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub info: ::core::option::Option<::prost::alloc::string::String>, + #[prost(enumeration = "discover_response::DiscoverResponseType", tag = "3")] + pub r#type: i32, + #[prost(message, optional, tag = "4")] + pub service: ::core::option::Option, + #[prost(message, repeated, tag = "5")] + pub instances: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "6")] + pub routing: ::core::option::Option, + #[prost(message, optional, tag = "7")] + pub rate_limit: ::core::option::Option, + #[prost(message, optional, tag = "8")] + pub circuit_breaker: ::core::option::Option, + #[prost(message, repeated, tag = "9")] + pub services: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "10")] + pub namespaces: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "11")] + pub fault_detector: ::core::option::Option, + #[prost(message, optional, tag = "21")] + pub alias_for: ::core::option::Option, + #[prost(message, repeated, tag = "22")] + pub lanes: ::prost::alloc::vec::Vec, + /// 自定义路由规则内容 + #[prost(message, repeated, tag = "23")] + pub custom_route_rules: ::prost::alloc::vec::Vec, + /// 就近路由规则内容 + #[prost(message, repeated, tag = "24")] + pub nearby_route_rules: ::prost::alloc::vec::Vec, +} +/// Nested message and enum types in `DiscoverResponse`. +pub mod discover_response { + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum DiscoverResponseType { + Unknown = 0, + Instance = 1, + Cluster = 2, + Routing = 3, + RateLimit = 4, + CircuitBreaker = 5, + Services = 6, + Namespaces = 12, + FaultDetector = 13, + Lane = 100, + /// 自定义路由规则 + CustomRouteRule = 101, + /// 就近路由规则 + NearbyRouteRule = 102, + } + impl DiscoverResponseType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + DiscoverResponseType::Unknown => "UNKNOWN", + DiscoverResponseType::Instance => "INSTANCE", + DiscoverResponseType::Cluster => "CLUSTER", + DiscoverResponseType::Routing => "ROUTING", + DiscoverResponseType::RateLimit => "RATE_LIMIT", + DiscoverResponseType::CircuitBreaker => "CIRCUIT_BREAKER", + DiscoverResponseType::Services => "SERVICES", + DiscoverResponseType::Namespaces => "NAMESPACES", + DiscoverResponseType::FaultDetector => "FAULT_DETECTOR", + DiscoverResponseType::Lane => "LANE", + DiscoverResponseType::CustomRouteRule => "CUSTOM_ROUTE_RULE", + DiscoverResponseType::NearbyRouteRule => "NEARBY_ROUTE_RULE", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "UNKNOWN" => Some(Self::Unknown), + "INSTANCE" => Some(Self::Instance), + "CLUSTER" => Some(Self::Cluster), + "ROUTING" => Some(Self::Routing), + "RATE_LIMIT" => Some(Self::RateLimit), + "CIRCUIT_BREAKER" => Some(Self::CircuitBreaker), + "SERVICES" => Some(Self::Services), + "NAMESPACES" => Some(Self::Namespaces), + "FAULT_DETECTOR" => Some(Self::FaultDetector), + "LANE" => Some(Self::Lane), + "CUSTOM_ROUTE_RULE" => Some(Self::CustomRouteRule), + "NEARBY_ROUTE_RULE" => Some(Self::NearbyRouteRule), + _ => None, + } + } + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct OptionSwitch { + #[prost(map = "string, string", tag = "1")] + pub options: ::std::collections::HashMap< + ::prost::alloc::string::String, + ::prost::alloc::string::String, + >, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct InstanceLabels { + #[prost(map = "string, message", tag = "1")] + pub labels: ::std::collections::HashMap<::prost::alloc::string::String, StringList>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct HeartbeatRecord { + #[prost(string, tag = "1")] + pub instance_id: ::prost::alloc::string::String, + #[prost(int64, tag = "6")] + pub last_heartbeat_sec: i64, + #[prost(bool, tag = "7")] + pub exist: bool, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct InstanceHeartbeat { + #[prost(string, tag = "1")] + pub instance_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub service: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub namespace: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub host: ::prost::alloc::string::String, + #[prost(uint32, tag = "5")] + pub port: u32, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct HeartbeatsRequest { + #[prost(message, repeated, tag = "1")] + pub heartbeats: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct HeartbeatsResponse {} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetHeartbeatsRequest { + #[prost(string, repeated, tag = "1")] + pub instance_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetHeartbeatsResponse { + #[prost(message, repeated, tag = "1")] + pub records: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DelHeartbeatsRequest { + #[prost(string, repeated, tag = "1")] + pub instance_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DelHeartbeatsResponse { + #[prost(uint32, tag = "1")] + pub code: u32, + #[prost(string, tag = "2")] + pub info: ::prost::alloc::string::String, +} +/// Generated client implementations. +pub mod polaris_grpc_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + use tonic::codegen::http::Uri; + #[derive(Debug, Clone)] + pub struct PolarisGrpcClient { + inner: tonic::client::Grpc, + } + impl PolarisGrpcClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl PolarisGrpcClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> PolarisGrpcClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + PolarisGrpcClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + /// 客户端上报 + pub async fn report_client( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/v1.PolarisGRPC/ReportClient", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("v1.PolarisGRPC", "ReportClient")); + self.inner.unary(req, path, codec).await + } + /// 被调方注册服务实例 + pub async fn register_instance( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/v1.PolarisGRPC/RegisterInstance", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("v1.PolarisGRPC", "RegisterInstance")); + self.inner.unary(req, path, codec).await + } + /// 被调方反注册服务实例 + pub async fn deregister_instance( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/v1.PolarisGRPC/DeregisterInstance", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("v1.PolarisGRPC", "DeregisterInstance")); + self.inner.unary(req, path, codec).await + } + /// 统一发现接口 + pub async fn discover( + &mut self, + request: impl tonic::IntoStreamingRequest, + ) -> std::result::Result< + tonic::Response>, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/v1.PolarisGRPC/Discover"); + let mut req = request.into_streaming_request(); + req.extensions_mut().insert(GrpcMethod::new("v1.PolarisGRPC", "Discover")); + self.inner.streaming(req, path, codec).await + } + /// 被调方上报心跳 + pub async fn heartbeat( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/v1.PolarisGRPC/Heartbeat"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new("v1.PolarisGRPC", "Heartbeat")); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated client implementations. +pub mod polaris_heartbeat_grpc_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + use tonic::codegen::http::Uri; + #[derive(Debug, Clone)] + pub struct PolarisHeartbeatGrpcClient { + inner: tonic::client::Grpc, + } + impl PolarisHeartbeatGrpcClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl PolarisHeartbeatGrpcClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> PolarisHeartbeatGrpcClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + PolarisHeartbeatGrpcClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + /// 被调方批量上报心跳 + pub async fn batch_heartbeat( + &mut self, + request: impl tonic::IntoStreamingRequest, + ) -> std::result::Result< + tonic::Response>, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/v1.PolarisHeartbeatGRPC/BatchHeartbeat", + ); + let mut req = request.into_streaming_request(); + req.extensions_mut() + .insert(GrpcMethod::new("v1.PolarisHeartbeatGRPC", "BatchHeartbeat")); + self.inner.streaming(req, path, codec).await + } + /// 批量获取心跳记录 + pub async fn batch_get_heartbeat( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/v1.PolarisHeartbeatGRPC/BatchGetHeartbeat", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("v1.PolarisHeartbeatGRPC", "BatchGetHeartbeat")); + self.inner.unary(req, path, codec).await + } + /// 批量删除心跳记录 + pub async fn batch_del_heartbeat( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/v1.PolarisHeartbeatGRPC/BatchDelHeartbeat", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("v1.PolarisHeartbeatGRPC", "BatchDelHeartbeat")); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated client implementations. +pub mod polaris_service_contract_grpc_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + use tonic::codegen::http::Uri; + #[derive(Debug, Clone)] + pub struct PolarisServiceContractGrpcClient { + inner: tonic::client::Grpc, + } + impl PolarisServiceContractGrpcClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl PolarisServiceContractGrpcClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> PolarisServiceContractGrpcClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + PolarisServiceContractGrpcClient::new( + InterceptedService::new(inner, interceptor), + ) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + /// 上报服务契约 + pub async fn report_service_contract( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/v1.PolarisServiceContractGRPC/ReportServiceContract", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "v1.PolarisServiceContractGRPC", + "ReportServiceContract", + ), + ); + self.inner.unary(req, path, codec).await + } + /// 查询服务契约 + pub async fn get_service_contract( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/v1.PolarisServiceContractGRPC/GetServiceContract", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "v1.PolarisServiceContractGRPC", + "GetServiceContract", + ), + ); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +pub mod polaris_grpc_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with PolarisGrpcServer. + #[async_trait] + pub trait PolarisGrpc: Send + Sync + 'static { + /// 客户端上报 + async fn report_client( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + /// 被调方注册服务实例 + async fn register_instance( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + /// 被调方反注册服务实例 + async fn deregister_instance( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + /// Server streaming response type for the Discover method. + type DiscoverStream: tonic::codegen::tokio_stream::Stream< + Item = std::result::Result, + > + + Send + + 'static; + /// 统一发现接口 + async fn discover( + &self, + request: tonic::Request>, + ) -> std::result::Result, tonic::Status>; + /// 被调方上报心跳 + async fn heartbeat( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + } + #[derive(Debug)] + pub struct PolarisGrpcServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl PolarisGrpcServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for PolarisGrpcServer + where + T: PolarisGrpc, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/v1.PolarisGRPC/ReportClient" => { + #[allow(non_camel_case_types)] + struct ReportClientSvc(pub Arc); + impl tonic::server::UnaryService + for ReportClientSvc { + type Response = super::Response; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::report_client(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ReportClientSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/v1.PolarisGRPC/RegisterInstance" => { + #[allow(non_camel_case_types)] + struct RegisterInstanceSvc(pub Arc); + impl tonic::server::UnaryService + for RegisterInstanceSvc { + type Response = super::Response; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::register_instance(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = RegisterInstanceSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/v1.PolarisGRPC/DeregisterInstance" => { + #[allow(non_camel_case_types)] + struct DeregisterInstanceSvc(pub Arc); + impl tonic::server::UnaryService + for DeregisterInstanceSvc { + type Response = super::Response; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::deregister_instance(&inner, request) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DeregisterInstanceSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/v1.PolarisGRPC/Discover" => { + #[allow(non_camel_case_types)] + struct DiscoverSvc(pub Arc); + impl< + T: PolarisGrpc, + > tonic::server::StreamingService + for DiscoverSvc { + type Response = super::DiscoverResponse; + type ResponseStream = T::DiscoverStream; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + tonic::Streaming, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::discover(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DiscoverSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.streaming(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/v1.PolarisGRPC/Heartbeat" => { + #[allow(non_camel_case_types)] + struct HeartbeatSvc(pub Arc); + impl tonic::server::UnaryService + for HeartbeatSvc { + type Response = super::Response; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::heartbeat(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = HeartbeatSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for PolarisGrpcServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for PolarisGrpcServer { + const NAME: &'static str = "v1.PolarisGRPC"; + } +} +/// Generated server implementations. +pub mod polaris_heartbeat_grpc_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with PolarisHeartbeatGrpcServer. + #[async_trait] + pub trait PolarisHeartbeatGrpc: Send + Sync + 'static { + /// Server streaming response type for the BatchHeartbeat method. + type BatchHeartbeatStream: tonic::codegen::tokio_stream::Stream< + Item = std::result::Result, + > + + Send + + 'static; + /// 被调方批量上报心跳 + async fn batch_heartbeat( + &self, + request: tonic::Request>, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// 批量获取心跳记录 + async fn batch_get_heartbeat( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// 批量删除心跳记录 + async fn batch_del_heartbeat( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + #[derive(Debug)] + pub struct PolarisHeartbeatGrpcServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl PolarisHeartbeatGrpcServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> + for PolarisHeartbeatGrpcServer + where + T: PolarisHeartbeatGrpc, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/v1.PolarisHeartbeatGRPC/BatchHeartbeat" => { + #[allow(non_camel_case_types)] + struct BatchHeartbeatSvc(pub Arc); + impl< + T: PolarisHeartbeatGrpc, + > tonic::server::StreamingService + for BatchHeartbeatSvc { + type Response = super::HeartbeatsResponse; + type ResponseStream = T::BatchHeartbeatStream; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + tonic::Streaming, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::batch_heartbeat( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = BatchHeartbeatSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.streaming(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/v1.PolarisHeartbeatGRPC/BatchGetHeartbeat" => { + #[allow(non_camel_case_types)] + struct BatchGetHeartbeatSvc(pub Arc); + impl< + T: PolarisHeartbeatGrpc, + > tonic::server::UnaryService + for BatchGetHeartbeatSvc { + type Response = super::GetHeartbeatsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::batch_get_heartbeat( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = BatchGetHeartbeatSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/v1.PolarisHeartbeatGRPC/BatchDelHeartbeat" => { + #[allow(non_camel_case_types)] + struct BatchDelHeartbeatSvc(pub Arc); + impl< + T: PolarisHeartbeatGrpc, + > tonic::server::UnaryService + for BatchDelHeartbeatSvc { + type Response = super::DelHeartbeatsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::batch_del_heartbeat( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = BatchDelHeartbeatSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for PolarisHeartbeatGrpcServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService + for PolarisHeartbeatGrpcServer { + const NAME: &'static str = "v1.PolarisHeartbeatGRPC"; + } +} +/// Generated server implementations. +pub mod polaris_service_contract_grpc_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with PolarisServiceContractGrpcServer. + #[async_trait] + pub trait PolarisServiceContractGrpc: Send + Sync + 'static { + /// 上报服务契约 + async fn report_service_contract( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + /// 查询服务契约 + async fn get_service_contract( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + } + #[derive(Debug)] + pub struct PolarisServiceContractGrpcServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl PolarisServiceContractGrpcServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> + for PolarisServiceContractGrpcServer + where + T: PolarisServiceContractGrpc, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/v1.PolarisServiceContractGRPC/ReportServiceContract" => { + #[allow(non_camel_case_types)] + struct ReportServiceContractSvc( + pub Arc, + ); + impl< + T: PolarisServiceContractGrpc, + > tonic::server::UnaryService + for ReportServiceContractSvc { + type Response = super::Response; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::report_service_contract( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ReportServiceContractSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/v1.PolarisServiceContractGRPC/GetServiceContract" => { + #[allow(non_camel_case_types)] + struct GetServiceContractSvc( + pub Arc, + ); + impl< + T: PolarisServiceContractGrpc, + > tonic::server::UnaryService + for GetServiceContractSvc { + type Response = super::Response; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::get_service_contract( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetServiceContractSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for PolarisServiceContractGrpcServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService + for PolarisServiceContractGrpcServer { + const NAME: &'static str = "v1.PolarisServiceContractGRPC"; + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ConfigFileGroup { + #[prost(message, optional, tag = "1")] + pub id: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub name: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "3")] + pub namespace: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "4")] + pub comment: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "5")] + pub create_time: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "6")] + pub create_by: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "7")] + pub modify_time: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "8")] + pub modify_by: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "9")] + pub file_count: ::core::option::Option, + #[prost(message, repeated, tag = "10")] + pub user_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(message, repeated, tag = "11")] + pub group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(message, repeated, tag = "13")] + pub remove_user_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(message, repeated, tag = "14")] + pub remove_group_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(message, optional, tag = "15")] + pub editable: ::core::option::Option, + #[prost(message, optional, tag = "16")] + pub owner: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "17")] + pub business: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "18")] + pub department: ::core::option::Option<::prost::alloc::string::String>, + #[prost(map = "string, string", tag = "19")] + pub metadata: ::std::collections::HashMap< + ::prost::alloc::string::String, + ::prost::alloc::string::String, + >, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ConfigFile { + #[prost(message, optional, tag = "1")] + pub id: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub name: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "3")] + pub namespace: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "4")] + pub group: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "5")] + pub content: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "6")] + pub format: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "7")] + pub comment: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "8")] + pub status: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, repeated, tag = "9")] + pub tags: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "10")] + pub create_time: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "11")] + pub create_by: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "12")] + pub modify_time: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "13")] + pub modify_by: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "14")] + pub release_time: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "15")] + pub release_by: ::core::option::Option<::prost::alloc::string::String>, + /// 是否为加密配置文件 + #[prost(message, optional, tag = "16")] + pub encrypted: ::core::option::Option, + /// 加密算法 + #[prost(message, optional, tag = "17")] + pub encrypt_algo: ::core::option::Option<::prost::alloc::string::String>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ConfigFileTag { + #[prost(message, optional, tag = "1")] + pub key: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "2")] + pub value: ::core::option::Option<::prost::alloc::string::String>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ConfigFileRelease { + #[prost(message, optional, tag = "1")] + pub id: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub name: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "3")] + pub namespace: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "4")] + pub group: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "5")] + pub file_name: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "6")] + pub content: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "7")] + pub comment: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "8")] + pub md5: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "9")] + pub version: ::core::option::Option, + #[prost(message, optional, tag = "10")] + pub create_time: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "11")] + pub create_by: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "12")] + pub modify_time: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "13")] + pub modify_by: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, repeated, tag = "14")] + pub tags: ::prost::alloc::vec::Vec, + /// 当前生效配置 + #[prost(message, optional, tag = "15")] + pub active: ::core::option::Option, + #[prost(message, optional, tag = "16")] + pub format: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "17")] + pub release_description: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "18")] + pub release_type: ::core::option::Option<::prost::alloc::string::String>, + /// 配置灰度发布时需要匹配的客户端标签信息 + #[prost(message, repeated, tag = "19")] + pub beta_labels: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ConfigFileReleaseHistory { + #[prost(message, optional, tag = "1")] + pub id: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub name: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "3")] + pub namespace: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "4")] + pub group: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "5")] + pub file_name: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "6")] + pub content: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "7")] + pub format: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "8")] + pub comment: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "9")] + pub md5: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "10")] + pub r#type: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "11")] + pub status: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, repeated, tag = "12")] + pub tags: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "13")] + pub create_time: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "14")] + pub create_by: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "15")] + pub modify_time: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "16")] + pub modify_by: ::core::option::Option<::prost::alloc::string::String>, + /// 配置发布失败的原因 + #[prost(message, optional, tag = "17")] + pub reason: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "18")] + pub release_description: ::core::option::Option<::prost::alloc::string::String>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ConfigFileTemplate { + #[prost(message, optional, tag = "1")] + pub id: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub name: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "3")] + pub content: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "4")] + pub format: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "5")] + pub comment: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "6")] + pub create_time: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "7")] + pub create_by: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "8")] + pub modify_time: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "9")] + pub modify_by: ::core::option::Option<::prost::alloc::string::String>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ClientConfigFileInfo { + #[prost(message, optional, tag = "1")] + pub namespace: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "2")] + pub group: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "3")] + pub file_name: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "4")] + pub content: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "5")] + pub version: ::core::option::Option, + #[prost(message, optional, tag = "6")] + pub md5: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, repeated, tag = "7")] + pub tags: ::prost::alloc::vec::Vec, + /// 是否为加密配置文件 + #[prost(message, optional, tag = "8")] + pub encrypted: ::core::option::Option, + /// 公钥,用于加密数据密钥 + #[prost(message, optional, tag = "9")] + pub public_key: ::core::option::Option<::prost::alloc::string::String>, + /// 配置文件版本名称 + #[prost(message, optional, tag = "10")] + pub name: ::core::option::Option<::prost::alloc::string::String>, + /// 配置文件的发布时间 + #[prost(message, optional, tag = "11")] + pub release_time: ::core::option::Option<::prost::alloc::string::String>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ClientWatchConfigFileRequest { + #[prost(message, optional, tag = "1")] + pub client_ip: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "2")] + pub service_name: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, repeated, tag = "3")] + pub watch_files: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ConfigFileExportRequest { + #[prost(message, optional, tag = "1")] + pub namespace: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, repeated, tag = "2")] + pub groups: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(message, repeated, tag = "3")] + pub names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ConfigFilePublishInfo { + #[prost(message, optional, tag = "1")] + pub release_name: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "2")] + pub namespace: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "3")] + pub group: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "4")] + pub file_name: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "5")] + pub content: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "6")] + pub comment: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "7")] + pub format: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "8")] + pub release_description: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "11")] + pub create_by: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "13")] + pub modify_by: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, repeated, tag = "14")] + pub tags: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "15")] + pub md5: ::core::option::Option<::prost::alloc::string::String>, + /// 是否为加密配置文件 + #[prost(message, optional, tag = "16")] + pub encrypted: ::core::option::Option, + /// 加密算法 + #[prost(message, optional, tag = "17")] + pub encrypt_algo: ::core::option::Option<::prost::alloc::string::String>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ConfigFileGroupRequest { + #[prost(message, optional, tag = "1")] + pub revision: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "2")] + pub config_file_group: ::core::option::Option, + /// 配置标签 + #[prost(map = "string, string", tag = "12")] + pub client_labels: ::std::collections::HashMap< + ::prost::alloc::string::String, + ::prost::alloc::string::String, + >, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ConfigDiscoverRequest { + #[prost( + enumeration = "config_discover_request::ConfigDiscoverRequestType", + tag = "1" + )] + pub r#type: i32, + #[prost(message, optional, tag = "2")] + pub config_file: ::core::option::Option, + #[prost(string, tag = "3")] + pub revision: ::prost::alloc::string::String, +} +/// Nested message and enum types in `ConfigDiscoverRequest`. +pub mod config_discover_request { + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum ConfigDiscoverRequestType { + Unknown = 0, + ConfigFile = 1, + ConfigFileNames = 2, + ConfigFileGroups = 3, + } + impl ConfigDiscoverRequestType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + ConfigDiscoverRequestType::Unknown => "UNKNOWN", + ConfigDiscoverRequestType::ConfigFile => "CONFIG_FILE", + ConfigDiscoverRequestType::ConfigFileNames => "CONFIG_FILE_Names", + ConfigDiscoverRequestType::ConfigFileGroups => "CONFIG_FILE_GROUPS", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "UNKNOWN" => Some(Self::Unknown), + "CONFIG_FILE" => Some(Self::ConfigFile), + "CONFIG_FILE_Names" => Some(Self::ConfigFileNames), + "CONFIG_FILE_GROUPS" => Some(Self::ConfigFileGroups), + _ => None, + } + } + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ConfigDiscoverResponse { + #[prost(uint32, tag = "1")] + pub code: u32, + #[prost(string, tag = "2")] + pub info: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub revision: ::prost::alloc::string::String, + #[prost( + enumeration = "config_discover_response::ConfigDiscoverResponseType", + tag = "4" + )] + pub r#type: i32, + #[prost(message, optional, tag = "5")] + pub config_file: ::core::option::Option, + #[prost(message, repeated, tag = "6")] + pub config_file_names: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "7")] + pub config_file_groups: ::prost::alloc::vec::Vec, +} +/// Nested message and enum types in `ConfigDiscoverResponse`. +pub mod config_discover_response { + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum ConfigDiscoverResponseType { + Unknown = 0, + ConfigFile = 1, + ConfigFileNames = 2, + ConfigFileGroups = 3, + } + impl ConfigDiscoverResponseType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + ConfigDiscoverResponseType::Unknown => "UNKNOWN", + ConfigDiscoverResponseType::ConfigFile => "CONFIG_FILE", + ConfigDiscoverResponseType::ConfigFileNames => "CONFIG_FILE_Names", + ConfigDiscoverResponseType::ConfigFileGroups => "CONFIG_FILE_GROUPS", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "UNKNOWN" => Some(Self::Unknown), + "CONFIG_FILE" => Some(Self::ConfigFile), + "CONFIG_FILE_Names" => Some(Self::ConfigFileNames), + "CONFIG_FILE_GROUPS" => Some(Self::ConfigFileGroups), + _ => None, + } + } + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ConfigSimpleResponse { + #[prost(message, optional, tag = "1")] + pub code: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub info: ::core::option::Option<::prost::alloc::string::String>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ConfigResponse { + #[prost(message, optional, tag = "1")] + pub code: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub info: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "3")] + pub config_file_group: ::core::option::Option, + #[prost(message, optional, tag = "4")] + pub config_file: ::core::option::Option, + #[prost(message, optional, tag = "5")] + pub config_file_release: ::core::option::Option, + #[prost(message, optional, tag = "6")] + pub config_file_release_history: ::core::option::Option, + #[prost(message, optional, tag = "7")] + pub config_file_template: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ConfigBatchWriteResponse { + #[prost(message, optional, tag = "1")] + pub code: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub info: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "3")] + pub total: ::core::option::Option, + #[prost(message, repeated, tag = "4")] + pub responses: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ConfigBatchQueryResponse { + #[prost(message, optional, tag = "1")] + pub code: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub info: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "3")] + pub total: ::core::option::Option, + #[prost(message, repeated, tag = "4")] + pub config_file_groups: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "5")] + pub config_files: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "6")] + pub config_file_releases: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "7")] + pub config_file_release_histories: ::prost::alloc::vec::Vec< + ConfigFileReleaseHistory, + >, + #[prost(message, repeated, tag = "8")] + pub config_file_templates: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ConfigClientResponse { + #[prost(message, optional, tag = "1")] + pub code: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub info: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "3")] + pub config_file: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ConfigImportResponse { + #[prost(message, optional, tag = "1")] + pub code: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub info: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, repeated, tag = "3")] + pub create_config_files: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "4")] + pub skip_config_files: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "5")] + pub overwrite_config_files: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ConfigExportResponse { + #[prost(message, optional, tag = "1")] + pub code: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub info: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "3")] + pub data: ::core::option::Option<::prost::alloc::vec::Vec>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ConfigEncryptAlgorithmResponse { + #[prost(message, optional, tag = "1")] + pub code: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub info: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, repeated, tag = "3")] + pub algorithms: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ConfigClientListResponse { + #[prost(message, optional, tag = "1")] + pub code: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub info: ::core::option::Option<::prost::alloc::string::String>, + #[prost(message, optional, tag = "3")] + pub revision: ::core::option::Option<::prost::alloc::string::String>, + #[prost(string, tag = "4")] + pub namespace: ::prost::alloc::string::String, + #[prost(string, tag = "5")] + pub group: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "6")] + pub config_file_infos: ::prost::alloc::vec::Vec, +} +/// Generated client implementations. +pub mod polaris_config_grpc_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + use tonic::codegen::http::Uri; + #[derive(Debug, Clone)] + pub struct PolarisConfigGrpcClient { + inner: tonic::client::Grpc, + } + impl PolarisConfigGrpcClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl PolarisConfigGrpcClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> PolarisConfigGrpcClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + PolarisConfigGrpcClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + /// 拉取配置 + pub async fn get_config_file( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/v1.PolarisConfigGRPC/GetConfigFile", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("v1.PolarisConfigGRPC", "GetConfigFile")); + self.inner.unary(req, path, codec).await + } + /// 创建配置 + pub async fn create_config_file( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/v1.PolarisConfigGRPC/CreateConfigFile", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("v1.PolarisConfigGRPC", "CreateConfigFile")); + self.inner.unary(req, path, codec).await + } + /// 更新配置 + pub async fn update_config_file( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/v1.PolarisConfigGRPC/UpdateConfigFile", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("v1.PolarisConfigGRPC", "UpdateConfigFile")); + self.inner.unary(req, path, codec).await + } + /// 发布配置 + pub async fn publish_config_file( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/v1.PolarisConfigGRPC/PublishConfigFile", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("v1.PolarisConfigGRPC", "PublishConfigFile")); + self.inner.unary(req, path, codec).await + } + /// 发布配置 + pub async fn upsert_and_publish_config_file( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/v1.PolarisConfigGRPC/UpsertAndPublishConfigFile", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("v1.PolarisConfigGRPC", "UpsertAndPublishConfigFile"), + ); + self.inner.unary(req, path, codec).await + } + /// 订阅配置变更 + pub async fn watch_config_files( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/v1.PolarisConfigGRPC/WatchConfigFiles", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("v1.PolarisConfigGRPC", "WatchConfigFiles")); + self.inner.unary(req, path, codec).await + } + /// 拉取指定配置分组下的配置文件列表 + pub async fn get_config_file_metadata_list( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/v1.PolarisConfigGRPC/GetConfigFileMetadataList", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("v1.PolarisConfigGRPC", "GetConfigFileMetadataList"), + ); + self.inner.unary(req, path, codec).await + } + /// 统一发现接口 + pub async fn discover( + &mut self, + request: impl tonic::IntoStreamingRequest< + Message = super::ConfigDiscoverRequest, + >, + ) -> std::result::Result< + tonic::Response>, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/v1.PolarisConfigGRPC/Discover", + ); + let mut req = request.into_streaming_request(); + req.extensions_mut() + .insert(GrpcMethod::new("v1.PolarisConfigGRPC", "Discover")); + self.inner.streaming(req, path, codec).await + } + } +} +/// Generated server implementations. +pub mod polaris_config_grpc_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with PolarisConfigGrpcServer. + #[async_trait] + pub trait PolarisConfigGrpc: Send + Sync + 'static { + /// 拉取配置 + async fn get_config_file( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// 创建配置 + async fn create_config_file( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// 更新配置 + async fn update_config_file( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// 发布配置 + async fn publish_config_file( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// 发布配置 + async fn upsert_and_publish_config_file( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// 订阅配置变更 + async fn watch_config_files( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// 拉取指定配置分组下的配置文件列表 + async fn get_config_file_metadata_list( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// Server streaming response type for the Discover method. + type DiscoverStream: tonic::codegen::tokio_stream::Stream< + Item = std::result::Result, + > + + Send + + 'static; + /// 统一发现接口 + async fn discover( + &self, + request: tonic::Request>, + ) -> std::result::Result, tonic::Status>; + } + #[derive(Debug)] + pub struct PolarisConfigGrpcServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl PolarisConfigGrpcServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for PolarisConfigGrpcServer + where + T: PolarisConfigGrpc, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/v1.PolarisConfigGRPC/GetConfigFile" => { + #[allow(non_camel_case_types)] + struct GetConfigFileSvc(pub Arc); + impl< + T: PolarisConfigGrpc, + > tonic::server::UnaryService + for GetConfigFileSvc { + type Response = super::ConfigClientResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::get_config_file(&inner, request) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetConfigFileSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/v1.PolarisConfigGRPC/CreateConfigFile" => { + #[allow(non_camel_case_types)] + struct CreateConfigFileSvc(pub Arc); + impl< + T: PolarisConfigGrpc, + > tonic::server::UnaryService + for CreateConfigFileSvc { + type Response = super::ConfigClientResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::create_config_file( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CreateConfigFileSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/v1.PolarisConfigGRPC/UpdateConfigFile" => { + #[allow(non_camel_case_types)] + struct UpdateConfigFileSvc(pub Arc); + impl< + T: PolarisConfigGrpc, + > tonic::server::UnaryService + for UpdateConfigFileSvc { + type Response = super::ConfigClientResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::update_config_file( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateConfigFileSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/v1.PolarisConfigGRPC/PublishConfigFile" => { + #[allow(non_camel_case_types)] + struct PublishConfigFileSvc(pub Arc); + impl< + T: PolarisConfigGrpc, + > tonic::server::UnaryService + for PublishConfigFileSvc { + type Response = super::ConfigClientResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::publish_config_file( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = PublishConfigFileSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/v1.PolarisConfigGRPC/UpsertAndPublishConfigFile" => { + #[allow(non_camel_case_types)] + struct UpsertAndPublishConfigFileSvc( + pub Arc, + ); + impl< + T: PolarisConfigGrpc, + > tonic::server::UnaryService + for UpsertAndPublishConfigFileSvc { + type Response = super::ConfigClientResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::upsert_and_publish_config_file( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpsertAndPublishConfigFileSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/v1.PolarisConfigGRPC/WatchConfigFiles" => { + #[allow(non_camel_case_types)] + struct WatchConfigFilesSvc(pub Arc); + impl< + T: PolarisConfigGrpc, + > tonic::server::UnaryService + for WatchConfigFilesSvc { + type Response = super::ConfigClientResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::watch_config_files( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = WatchConfigFilesSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/v1.PolarisConfigGRPC/GetConfigFileMetadataList" => { + #[allow(non_camel_case_types)] + struct GetConfigFileMetadataListSvc( + pub Arc, + ); + impl< + T: PolarisConfigGrpc, + > tonic::server::UnaryService + for GetConfigFileMetadataListSvc { + type Response = super::ConfigClientListResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::get_config_file_metadata_list( + &inner, + request, + ) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetConfigFileMetadataListSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/v1.PolarisConfigGRPC/Discover" => { + #[allow(non_camel_case_types)] + struct DiscoverSvc(pub Arc); + impl< + T: PolarisConfigGrpc, + > tonic::server::StreamingService + for DiscoverSvc { + type Response = super::ConfigDiscoverResponse; + type ResponseStream = T::DiscoverStream; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + tonic::Streaming, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::discover(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DiscoverSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.streaming(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for PolarisConfigGrpcServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService + for PolarisConfigGrpcServer { + const NAME: &'static str = "v1.PolarisConfigGRPC"; + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum Code { + /// base module status codes + Unknown = 0, + ExecuteSuccess = 200000, + DataNoChange = 200001, + NoNeedUpdate = 200002, + BadRequest = 400000, + ParseException = 400001, + EmptyRequest = 400002, + BatchSizeOverLimit = 400003, + InvalidDiscoverResource = 400004, + InvalidRequestId = 400100, + InvalidUserName = 400101, + InvalidUserToken = 400102, + InvalidParameter = 400103, + EmptyQueryParameter = 400104, + InvalidQueryInsParameter = 400105, + InvalidNamespaceName = 400110, + InvalidNamespaceOwners = 400111, + InvalidNamespaceToken = 400112, + InvalidServiceName = 400120, + InvalidServiceOwners = 400121, + InvalidServiceToken = 400122, + InvalidServiceMetadata = 400123, + InvalidServicePorts = 400124, + InvalidServiceBusiness = 400125, + InvalidServiceDepartment = 400126, + InvalidServiceCmdb = 400127, + InvalidServiceComment = 400128, + InvalidServiceAliasComment = 400129, + InvalidInstanceId = 400130, + InvalidInstanceHost = 400131, + InvalidInstancePort = 400132, + InvalidServiceAlias = 400133, + InvalidNamespaceWithAlias = 400134, + InvalidServiceAliasOwners = 400135, + InvalidInstanceProtocol = 400136, + InvalidInstanceVersion = 400137, + InvalidInstanceLogicSet = 400138, + InvalidInstanceIsolate = 400139, + HealthCheckNotOpen = 400140, + HeartbeatOnDisabledIns = 400141, + HeartbeatExceedLimit = 400142, + HeartbeatTypeNotFound = 400143, + InvalidMetadata = 400150, + InvalidRateLimitId = 400151, + InvalidRateLimitLabels = 400152, + InvalidRateLimitAmounts = 400153, + InvalidRateLimitName = 400154, + InvalidCircuitBreakerId = 400160, + InvalidCircuitBreakerVersion = 400161, + InvalidCircuitBreakerName = 400162, + InvalidCircuitBreakerNamespace = 400163, + InvalidCircuitBreakerOwners = 400164, + InvalidCircuitBreakerToken = 400165, + InvalidCircuitBreakerBusiness = 400166, + InvalidCircuitBreakerDepartment = 400167, + InvalidCircuitBreakerComment = 400168, + CircuitBreakerRuleExisted = 400169, + InvalidRoutingId = 400700, + InvalidRoutingPolicy = 400701, + InvalidRoutingName = 400702, + InvalidRoutingPriority = 400703, + InvalidFaultDetectId = 400900, + InvalidFaultDetectName = 400901, + InvalidFaultDetectNamespace = 400902, + FaultDetectRuleExisted = 400903, + InvalidMatchRule = 400904, + /// network relative codes + ServicesExistedMesh = 400170, + ResourcesExistedMesh = 400171, + InvalidMeshParameter = 400172, + /// platform relative codes + InvalidPlatformId = 400180, + InvalidPlatformName = 400181, + InvalidPlatformDomain = 400182, + InvalidPlatformQps = 400183, + InvalidPlatformToken = 400184, + InvalidPlatformOwner = 400185, + InvalidPlatformDepartment = 400186, + InvalidPlatformComment = 400187, + NotFoundPlatform = 400188, + /// flux relative codes + InvalidFluxRateLimitId = 400190, + InvalidFluxRateLimitQps = 400191, + InvalidFluxRateLimitSetKey = 400192, + ExistedResource = 400201, + NotFoundResource = 400202, + NamespaceExistedServices = 400203, + ServiceExistedInstances = 400204, + ServiceExistedRoutings = 400205, + ServiceExistedRateLimits = 400206, + ExistReleasedConfig = 400207, + SameInstanceRequest = 400208, + ServiceExistedCircuitBreakers = 400209, + ServiceExistedAlias = 400210, + NamespaceExistedMeshResources = 400211, + NamespaceExistedCircuitBreakers = 400212, + ServiceSubscribedByMeshes = 400213, + ServiceExistedFluxRateLimits = 400214, + NamespaceExistedConfigGroups = 400219, + NotFoundService = 400301, + NotFoundRouting = 400302, + NotFoundInstance = 400303, + NotFoundServiceAlias = 400304, + NotFoundNamespace = 400305, + NotFoundSourceService = 400306, + NotFoundRateLimit = 400307, + NotFoundCircuitBreaker = 400308, + NotFoundMasterConfig = 400309, + NotFoundTagConfig = 400310, + NotFoundTagConfigOrService = 400311, + ClientApiNotOpen = 400401, + NotAllowBusinessService = 400402, + NotAllowAliasUpdate = 400501, + NotAllowAliasCreateInstance = 400502, + NotAllowAliasCreateRouting = 400503, + NotAllowCreateAliasForAlias = 400504, + NotAllowAliasCreateRateLimit = 400505, + NotAllowAliasBindRule = 400506, + NotAllowDifferentNamespaceBindRule = 400507, + Unauthorized = 401000, + NotAllowedAccess = 401001, + CmdbNotFindHost = 404001, + DataConflict = 409000, + InstanceTooManyRequests = 429001, + IpRateLimit = 429002, + ApiRateLimit = 403003, + ExecuteException = 500000, + StoreLayerException = 500001, + CmdbPluginException = 500002, + ParseRoutingException = 500004, + ParseRateLimitException = 500005, + ParseCircuitBreakerException = 500006, + HeartbeatException = 500007, + InstanceRegisTimeout = 500008, + /// config center status codes + InvalidConfigFileGroupName = 400801, + InvalidConfigFileName = 400802, + InvalidConfigFileContentLength = 400803, + InvalidConfigFileFormat = 400804, + InvalidConfigFileTags = 400805, + InvalidWatchConfigFileFormat = 400806, + NotFoundResourceConfigFile = 400807, + InvalidConfigFileTemplateName = 400808, + EncryptConfigFileException = 400809, + DecryptConfigFileException = 400810, + /// auth codes + InvalidUserOwners = 400410, + InvalidUserId = 400411, + InvalidUserPassword = 400412, + InvalidUserMobile = 400413, + InvalidUserEmail = 400414, + InvalidUserGroupOwners = 400420, + InvalidUserGroupId = 400421, + InvalidAuthStrategyOwners = 400430, + InvalidAuthStrategyName = 400431, + InvalidAuthStrategyId = 400432, + InvalidPrincipalType = 400440, + UserExisted = 400215, + UserGroupExisted = 400216, + AuthStrategyRuleExisted = 400217, + SubAccountExisted = 400218, + NotFoundUser = 400312, + NotFoundOwnerUser = 400313, + NotFoundUserGroup = 400314, + NotFoundAuthStrategyRule = 400315, + NotAllowModifyDefaultStrategyPrincipal = 400508, + NotAllowModifyOwnerDefaultStrategy = 400509, + EmptyAutToken = 401002, + TokenDisabled = 401003, + TokenNotExisted = 401004, + AuthTokenForbidden = 403001, + OperationRoleForbidden = 403002, +} +impl Code { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Code::Unknown => "Unknown", + Code::ExecuteSuccess => "ExecuteSuccess", + Code::DataNoChange => "DataNoChange", + Code::NoNeedUpdate => "NoNeedUpdate", + Code::BadRequest => "BadRequest", + Code::ParseException => "ParseException", + Code::EmptyRequest => "EmptyRequest", + Code::BatchSizeOverLimit => "BatchSizeOverLimit", + Code::InvalidDiscoverResource => "InvalidDiscoverResource", + Code::InvalidRequestId => "InvalidRequestID", + Code::InvalidUserName => "InvalidUserName", + Code::InvalidUserToken => "InvalidUserToken", + Code::InvalidParameter => "InvalidParameter", + Code::EmptyQueryParameter => "EmptyQueryParameter", + Code::InvalidQueryInsParameter => "InvalidQueryInsParameter", + Code::InvalidNamespaceName => "InvalidNamespaceName", + Code::InvalidNamespaceOwners => "InvalidNamespaceOwners", + Code::InvalidNamespaceToken => "InvalidNamespaceToken", + Code::InvalidServiceName => "InvalidServiceName", + Code::InvalidServiceOwners => "InvalidServiceOwners", + Code::InvalidServiceToken => "InvalidServiceToken", + Code::InvalidServiceMetadata => "InvalidServiceMetadata", + Code::InvalidServicePorts => "InvalidServicePorts", + Code::InvalidServiceBusiness => "InvalidServiceBusiness", + Code::InvalidServiceDepartment => "InvalidServiceDepartment", + Code::InvalidServiceCmdb => "InvalidServiceCMDB", + Code::InvalidServiceComment => "InvalidServiceComment", + Code::InvalidServiceAliasComment => "InvalidServiceAliasComment", + Code::InvalidInstanceId => "InvalidInstanceID", + Code::InvalidInstanceHost => "InvalidInstanceHost", + Code::InvalidInstancePort => "InvalidInstancePort", + Code::InvalidServiceAlias => "InvalidServiceAlias", + Code::InvalidNamespaceWithAlias => "InvalidNamespaceWithAlias", + Code::InvalidServiceAliasOwners => "InvalidServiceAliasOwners", + Code::InvalidInstanceProtocol => "InvalidInstanceProtocol", + Code::InvalidInstanceVersion => "InvalidInstanceVersion", + Code::InvalidInstanceLogicSet => "InvalidInstanceLogicSet", + Code::InvalidInstanceIsolate => "InvalidInstanceIsolate", + Code::HealthCheckNotOpen => "HealthCheckNotOpen", + Code::HeartbeatOnDisabledIns => "HeartbeatOnDisabledIns", + Code::HeartbeatExceedLimit => "HeartbeatExceedLimit", + Code::HeartbeatTypeNotFound => "HeartbeatTypeNotFound", + Code::InvalidMetadata => "InvalidMetadata", + Code::InvalidRateLimitId => "InvalidRateLimitID", + Code::InvalidRateLimitLabels => "InvalidRateLimitLabels", + Code::InvalidRateLimitAmounts => "InvalidRateLimitAmounts", + Code::InvalidRateLimitName => "InvalidRateLimitName", + Code::InvalidCircuitBreakerId => "InvalidCircuitBreakerID", + Code::InvalidCircuitBreakerVersion => "InvalidCircuitBreakerVersion", + Code::InvalidCircuitBreakerName => "InvalidCircuitBreakerName", + Code::InvalidCircuitBreakerNamespace => "InvalidCircuitBreakerNamespace", + Code::InvalidCircuitBreakerOwners => "InvalidCircuitBreakerOwners", + Code::InvalidCircuitBreakerToken => "InvalidCircuitBreakerToken", + Code::InvalidCircuitBreakerBusiness => "InvalidCircuitBreakerBusiness", + Code::InvalidCircuitBreakerDepartment => "InvalidCircuitBreakerDepartment", + Code::InvalidCircuitBreakerComment => "InvalidCircuitBreakerComment", + Code::CircuitBreakerRuleExisted => "CircuitBreakerRuleExisted", + Code::InvalidRoutingId => "InvalidRoutingID", + Code::InvalidRoutingPolicy => "InvalidRoutingPolicy", + Code::InvalidRoutingName => "InvalidRoutingName", + Code::InvalidRoutingPriority => "InvalidRoutingPriority", + Code::InvalidFaultDetectId => "InvalidFaultDetectID", + Code::InvalidFaultDetectName => "InvalidFaultDetectName", + Code::InvalidFaultDetectNamespace => "InvalidFaultDetectNamespace", + Code::FaultDetectRuleExisted => "FaultDetectRuleExisted", + Code::InvalidMatchRule => "InvalidMatchRule", + Code::ServicesExistedMesh => "ServicesExistedMesh", + Code::ResourcesExistedMesh => "ResourcesExistedMesh", + Code::InvalidMeshParameter => "InvalidMeshParameter", + Code::InvalidPlatformId => "InvalidPlatformID", + Code::InvalidPlatformName => "InvalidPlatformName", + Code::InvalidPlatformDomain => "InvalidPlatformDomain", + Code::InvalidPlatformQps => "InvalidPlatformQPS", + Code::InvalidPlatformToken => "InvalidPlatformToken", + Code::InvalidPlatformOwner => "InvalidPlatformOwner", + Code::InvalidPlatformDepartment => "InvalidPlatformDepartment", + Code::InvalidPlatformComment => "InvalidPlatformComment", + Code::NotFoundPlatform => "NotFoundPlatform", + Code::InvalidFluxRateLimitId => "InvalidFluxRateLimitId", + Code::InvalidFluxRateLimitQps => "InvalidFluxRateLimitQps", + Code::InvalidFluxRateLimitSetKey => "InvalidFluxRateLimitSetKey", + Code::ExistedResource => "ExistedResource", + Code::NotFoundResource => "NotFoundResource", + Code::NamespaceExistedServices => "NamespaceExistedServices", + Code::ServiceExistedInstances => "ServiceExistedInstances", + Code::ServiceExistedRoutings => "ServiceExistedRoutings", + Code::ServiceExistedRateLimits => "ServiceExistedRateLimits", + Code::ExistReleasedConfig => "ExistReleasedConfig", + Code::SameInstanceRequest => "SameInstanceRequest", + Code::ServiceExistedCircuitBreakers => "ServiceExistedCircuitBreakers", + Code::ServiceExistedAlias => "ServiceExistedAlias", + Code::NamespaceExistedMeshResources => "NamespaceExistedMeshResources", + Code::NamespaceExistedCircuitBreakers => "NamespaceExistedCircuitBreakers", + Code::ServiceSubscribedByMeshes => "ServiceSubscribedByMeshes", + Code::ServiceExistedFluxRateLimits => "ServiceExistedFluxRateLimits", + Code::NamespaceExistedConfigGroups => "NamespaceExistedConfigGroups", + Code::NotFoundService => "NotFoundService", + Code::NotFoundRouting => "NotFoundRouting", + Code::NotFoundInstance => "NotFoundInstance", + Code::NotFoundServiceAlias => "NotFoundServiceAlias", + Code::NotFoundNamespace => "NotFoundNamespace", + Code::NotFoundSourceService => "NotFoundSourceService", + Code::NotFoundRateLimit => "NotFoundRateLimit", + Code::NotFoundCircuitBreaker => "NotFoundCircuitBreaker", + Code::NotFoundMasterConfig => "NotFoundMasterConfig", + Code::NotFoundTagConfig => "NotFoundTagConfig", + Code::NotFoundTagConfigOrService => "NotFoundTagConfigOrService", + Code::ClientApiNotOpen => "ClientAPINotOpen", + Code::NotAllowBusinessService => "NotAllowBusinessService", + Code::NotAllowAliasUpdate => "NotAllowAliasUpdate", + Code::NotAllowAliasCreateInstance => "NotAllowAliasCreateInstance", + Code::NotAllowAliasCreateRouting => "NotAllowAliasCreateRouting", + Code::NotAllowCreateAliasForAlias => "NotAllowCreateAliasForAlias", + Code::NotAllowAliasCreateRateLimit => "NotAllowAliasCreateRateLimit", + Code::NotAllowAliasBindRule => "NotAllowAliasBindRule", + Code::NotAllowDifferentNamespaceBindRule => { + "NotAllowDifferentNamespaceBindRule" + } + Code::Unauthorized => "Unauthorized", + Code::NotAllowedAccess => "NotAllowedAccess", + Code::CmdbNotFindHost => "CMDBNotFindHost", + Code::DataConflict => "DataConflict", + Code::InstanceTooManyRequests => "InstanceTooManyRequests", + Code::IpRateLimit => "IPRateLimit", + Code::ApiRateLimit => "APIRateLimit", + Code::ExecuteException => "ExecuteException", + Code::StoreLayerException => "StoreLayerException", + Code::CmdbPluginException => "CMDBPluginException", + Code::ParseRoutingException => "ParseRoutingException", + Code::ParseRateLimitException => "ParseRateLimitException", + Code::ParseCircuitBreakerException => "ParseCircuitBreakerException", + Code::HeartbeatException => "HeartbeatException", + Code::InstanceRegisTimeout => "InstanceRegisTimeout", + Code::InvalidConfigFileGroupName => "InvalidConfigFileGroupName", + Code::InvalidConfigFileName => "InvalidConfigFileName", + Code::InvalidConfigFileContentLength => "InvalidConfigFileContentLength", + Code::InvalidConfigFileFormat => "InvalidConfigFileFormat", + Code::InvalidConfigFileTags => "InvalidConfigFileTags", + Code::InvalidWatchConfigFileFormat => "InvalidWatchConfigFileFormat", + Code::NotFoundResourceConfigFile => "NotFoundResourceConfigFile", + Code::InvalidConfigFileTemplateName => "InvalidConfigFileTemplateName", + Code::EncryptConfigFileException => "EncryptConfigFileException", + Code::DecryptConfigFileException => "DecryptConfigFileException", + Code::InvalidUserOwners => "InvalidUserOwners", + Code::InvalidUserId => "InvalidUserID", + Code::InvalidUserPassword => "InvalidUserPassword", + Code::InvalidUserMobile => "InvalidUserMobile", + Code::InvalidUserEmail => "InvalidUserEmail", + Code::InvalidUserGroupOwners => "InvalidUserGroupOwners", + Code::InvalidUserGroupId => "InvalidUserGroupID", + Code::InvalidAuthStrategyOwners => "InvalidAuthStrategyOwners", + Code::InvalidAuthStrategyName => "InvalidAuthStrategyName", + Code::InvalidAuthStrategyId => "InvalidAuthStrategyID", + Code::InvalidPrincipalType => "InvalidPrincipalType", + Code::UserExisted => "UserExisted", + Code::UserGroupExisted => "UserGroupExisted", + Code::AuthStrategyRuleExisted => "AuthStrategyRuleExisted", + Code::SubAccountExisted => "SubAccountExisted", + Code::NotFoundUser => "NotFoundUser", + Code::NotFoundOwnerUser => "NotFoundOwnerUser", + Code::NotFoundUserGroup => "NotFoundUserGroup", + Code::NotFoundAuthStrategyRule => "NotFoundAuthStrategyRule", + Code::NotAllowModifyDefaultStrategyPrincipal => { + "NotAllowModifyDefaultStrategyPrincipal" + } + Code::NotAllowModifyOwnerDefaultStrategy => { + "NotAllowModifyOwnerDefaultStrategy" + } + Code::EmptyAutToken => "EmptyAutToken", + Code::TokenDisabled => "TokenDisabled", + Code::TokenNotExisted => "TokenNotExisted", + Code::AuthTokenForbidden => "AuthTokenForbidden", + Code::OperationRoleForbidden => "OperationRoleForbidden", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "Unknown" => Some(Self::Unknown), + "ExecuteSuccess" => Some(Self::ExecuteSuccess), + "DataNoChange" => Some(Self::DataNoChange), + "NoNeedUpdate" => Some(Self::NoNeedUpdate), + "BadRequest" => Some(Self::BadRequest), + "ParseException" => Some(Self::ParseException), + "EmptyRequest" => Some(Self::EmptyRequest), + "BatchSizeOverLimit" => Some(Self::BatchSizeOverLimit), + "InvalidDiscoverResource" => Some(Self::InvalidDiscoverResource), + "InvalidRequestID" => Some(Self::InvalidRequestId), + "InvalidUserName" => Some(Self::InvalidUserName), + "InvalidUserToken" => Some(Self::InvalidUserToken), + "InvalidParameter" => Some(Self::InvalidParameter), + "EmptyQueryParameter" => Some(Self::EmptyQueryParameter), + "InvalidQueryInsParameter" => Some(Self::InvalidQueryInsParameter), + "InvalidNamespaceName" => Some(Self::InvalidNamespaceName), + "InvalidNamespaceOwners" => Some(Self::InvalidNamespaceOwners), + "InvalidNamespaceToken" => Some(Self::InvalidNamespaceToken), + "InvalidServiceName" => Some(Self::InvalidServiceName), + "InvalidServiceOwners" => Some(Self::InvalidServiceOwners), + "InvalidServiceToken" => Some(Self::InvalidServiceToken), + "InvalidServiceMetadata" => Some(Self::InvalidServiceMetadata), + "InvalidServicePorts" => Some(Self::InvalidServicePorts), + "InvalidServiceBusiness" => Some(Self::InvalidServiceBusiness), + "InvalidServiceDepartment" => Some(Self::InvalidServiceDepartment), + "InvalidServiceCMDB" => Some(Self::InvalidServiceCmdb), + "InvalidServiceComment" => Some(Self::InvalidServiceComment), + "InvalidServiceAliasComment" => Some(Self::InvalidServiceAliasComment), + "InvalidInstanceID" => Some(Self::InvalidInstanceId), + "InvalidInstanceHost" => Some(Self::InvalidInstanceHost), + "InvalidInstancePort" => Some(Self::InvalidInstancePort), + "InvalidServiceAlias" => Some(Self::InvalidServiceAlias), + "InvalidNamespaceWithAlias" => Some(Self::InvalidNamespaceWithAlias), + "InvalidServiceAliasOwners" => Some(Self::InvalidServiceAliasOwners), + "InvalidInstanceProtocol" => Some(Self::InvalidInstanceProtocol), + "InvalidInstanceVersion" => Some(Self::InvalidInstanceVersion), + "InvalidInstanceLogicSet" => Some(Self::InvalidInstanceLogicSet), + "InvalidInstanceIsolate" => Some(Self::InvalidInstanceIsolate), + "HealthCheckNotOpen" => Some(Self::HealthCheckNotOpen), + "HeartbeatOnDisabledIns" => Some(Self::HeartbeatOnDisabledIns), + "HeartbeatExceedLimit" => Some(Self::HeartbeatExceedLimit), + "HeartbeatTypeNotFound" => Some(Self::HeartbeatTypeNotFound), + "InvalidMetadata" => Some(Self::InvalidMetadata), + "InvalidRateLimitID" => Some(Self::InvalidRateLimitId), + "InvalidRateLimitLabels" => Some(Self::InvalidRateLimitLabels), + "InvalidRateLimitAmounts" => Some(Self::InvalidRateLimitAmounts), + "InvalidRateLimitName" => Some(Self::InvalidRateLimitName), + "InvalidCircuitBreakerID" => Some(Self::InvalidCircuitBreakerId), + "InvalidCircuitBreakerVersion" => Some(Self::InvalidCircuitBreakerVersion), + "InvalidCircuitBreakerName" => Some(Self::InvalidCircuitBreakerName), + "InvalidCircuitBreakerNamespace" => { + Some(Self::InvalidCircuitBreakerNamespace) + } + "InvalidCircuitBreakerOwners" => Some(Self::InvalidCircuitBreakerOwners), + "InvalidCircuitBreakerToken" => Some(Self::InvalidCircuitBreakerToken), + "InvalidCircuitBreakerBusiness" => Some(Self::InvalidCircuitBreakerBusiness), + "InvalidCircuitBreakerDepartment" => { + Some(Self::InvalidCircuitBreakerDepartment) + } + "InvalidCircuitBreakerComment" => Some(Self::InvalidCircuitBreakerComment), + "CircuitBreakerRuleExisted" => Some(Self::CircuitBreakerRuleExisted), + "InvalidRoutingID" => Some(Self::InvalidRoutingId), + "InvalidRoutingPolicy" => Some(Self::InvalidRoutingPolicy), + "InvalidRoutingName" => Some(Self::InvalidRoutingName), + "InvalidRoutingPriority" => Some(Self::InvalidRoutingPriority), + "InvalidFaultDetectID" => Some(Self::InvalidFaultDetectId), + "InvalidFaultDetectName" => Some(Self::InvalidFaultDetectName), + "InvalidFaultDetectNamespace" => Some(Self::InvalidFaultDetectNamespace), + "FaultDetectRuleExisted" => Some(Self::FaultDetectRuleExisted), + "InvalidMatchRule" => Some(Self::InvalidMatchRule), + "ServicesExistedMesh" => Some(Self::ServicesExistedMesh), + "ResourcesExistedMesh" => Some(Self::ResourcesExistedMesh), + "InvalidMeshParameter" => Some(Self::InvalidMeshParameter), + "InvalidPlatformID" => Some(Self::InvalidPlatformId), + "InvalidPlatformName" => Some(Self::InvalidPlatformName), + "InvalidPlatformDomain" => Some(Self::InvalidPlatformDomain), + "InvalidPlatformQPS" => Some(Self::InvalidPlatformQps), + "InvalidPlatformToken" => Some(Self::InvalidPlatformToken), + "InvalidPlatformOwner" => Some(Self::InvalidPlatformOwner), + "InvalidPlatformDepartment" => Some(Self::InvalidPlatformDepartment), + "InvalidPlatformComment" => Some(Self::InvalidPlatformComment), + "NotFoundPlatform" => Some(Self::NotFoundPlatform), + "InvalidFluxRateLimitId" => Some(Self::InvalidFluxRateLimitId), + "InvalidFluxRateLimitQps" => Some(Self::InvalidFluxRateLimitQps), + "InvalidFluxRateLimitSetKey" => Some(Self::InvalidFluxRateLimitSetKey), + "ExistedResource" => Some(Self::ExistedResource), + "NotFoundResource" => Some(Self::NotFoundResource), + "NamespaceExistedServices" => Some(Self::NamespaceExistedServices), + "ServiceExistedInstances" => Some(Self::ServiceExistedInstances), + "ServiceExistedRoutings" => Some(Self::ServiceExistedRoutings), + "ServiceExistedRateLimits" => Some(Self::ServiceExistedRateLimits), + "ExistReleasedConfig" => Some(Self::ExistReleasedConfig), + "SameInstanceRequest" => Some(Self::SameInstanceRequest), + "ServiceExistedCircuitBreakers" => Some(Self::ServiceExistedCircuitBreakers), + "ServiceExistedAlias" => Some(Self::ServiceExistedAlias), + "NamespaceExistedMeshResources" => Some(Self::NamespaceExistedMeshResources), + "NamespaceExistedCircuitBreakers" => { + Some(Self::NamespaceExistedCircuitBreakers) + } + "ServiceSubscribedByMeshes" => Some(Self::ServiceSubscribedByMeshes), + "ServiceExistedFluxRateLimits" => Some(Self::ServiceExistedFluxRateLimits), + "NamespaceExistedConfigGroups" => Some(Self::NamespaceExistedConfigGroups), + "NotFoundService" => Some(Self::NotFoundService), + "NotFoundRouting" => Some(Self::NotFoundRouting), + "NotFoundInstance" => Some(Self::NotFoundInstance), + "NotFoundServiceAlias" => Some(Self::NotFoundServiceAlias), + "NotFoundNamespace" => Some(Self::NotFoundNamespace), + "NotFoundSourceService" => Some(Self::NotFoundSourceService), + "NotFoundRateLimit" => Some(Self::NotFoundRateLimit), + "NotFoundCircuitBreaker" => Some(Self::NotFoundCircuitBreaker), + "NotFoundMasterConfig" => Some(Self::NotFoundMasterConfig), + "NotFoundTagConfig" => Some(Self::NotFoundTagConfig), + "NotFoundTagConfigOrService" => Some(Self::NotFoundTagConfigOrService), + "ClientAPINotOpen" => Some(Self::ClientApiNotOpen), + "NotAllowBusinessService" => Some(Self::NotAllowBusinessService), + "NotAllowAliasUpdate" => Some(Self::NotAllowAliasUpdate), + "NotAllowAliasCreateInstance" => Some(Self::NotAllowAliasCreateInstance), + "NotAllowAliasCreateRouting" => Some(Self::NotAllowAliasCreateRouting), + "NotAllowCreateAliasForAlias" => Some(Self::NotAllowCreateAliasForAlias), + "NotAllowAliasCreateRateLimit" => Some(Self::NotAllowAliasCreateRateLimit), + "NotAllowAliasBindRule" => Some(Self::NotAllowAliasBindRule), + "NotAllowDifferentNamespaceBindRule" => { + Some(Self::NotAllowDifferentNamespaceBindRule) + } + "Unauthorized" => Some(Self::Unauthorized), + "NotAllowedAccess" => Some(Self::NotAllowedAccess), + "CMDBNotFindHost" => Some(Self::CmdbNotFindHost), + "DataConflict" => Some(Self::DataConflict), + "InstanceTooManyRequests" => Some(Self::InstanceTooManyRequests), + "IPRateLimit" => Some(Self::IpRateLimit), + "APIRateLimit" => Some(Self::ApiRateLimit), + "ExecuteException" => Some(Self::ExecuteException), + "StoreLayerException" => Some(Self::StoreLayerException), + "CMDBPluginException" => Some(Self::CmdbPluginException), + "ParseRoutingException" => Some(Self::ParseRoutingException), + "ParseRateLimitException" => Some(Self::ParseRateLimitException), + "ParseCircuitBreakerException" => Some(Self::ParseCircuitBreakerException), + "HeartbeatException" => Some(Self::HeartbeatException), + "InstanceRegisTimeout" => Some(Self::InstanceRegisTimeout), + "InvalidConfigFileGroupName" => Some(Self::InvalidConfigFileGroupName), + "InvalidConfigFileName" => Some(Self::InvalidConfigFileName), + "InvalidConfigFileContentLength" => { + Some(Self::InvalidConfigFileContentLength) + } + "InvalidConfigFileFormat" => Some(Self::InvalidConfigFileFormat), + "InvalidConfigFileTags" => Some(Self::InvalidConfigFileTags), + "InvalidWatchConfigFileFormat" => Some(Self::InvalidWatchConfigFileFormat), + "NotFoundResourceConfigFile" => Some(Self::NotFoundResourceConfigFile), + "InvalidConfigFileTemplateName" => Some(Self::InvalidConfigFileTemplateName), + "EncryptConfigFileException" => Some(Self::EncryptConfigFileException), + "DecryptConfigFileException" => Some(Self::DecryptConfigFileException), + "InvalidUserOwners" => Some(Self::InvalidUserOwners), + "InvalidUserID" => Some(Self::InvalidUserId), + "InvalidUserPassword" => Some(Self::InvalidUserPassword), + "InvalidUserMobile" => Some(Self::InvalidUserMobile), + "InvalidUserEmail" => Some(Self::InvalidUserEmail), + "InvalidUserGroupOwners" => Some(Self::InvalidUserGroupOwners), + "InvalidUserGroupID" => Some(Self::InvalidUserGroupId), + "InvalidAuthStrategyOwners" => Some(Self::InvalidAuthStrategyOwners), + "InvalidAuthStrategyName" => Some(Self::InvalidAuthStrategyName), + "InvalidAuthStrategyID" => Some(Self::InvalidAuthStrategyId), + "InvalidPrincipalType" => Some(Self::InvalidPrincipalType), + "UserExisted" => Some(Self::UserExisted), + "UserGroupExisted" => Some(Self::UserGroupExisted), + "AuthStrategyRuleExisted" => Some(Self::AuthStrategyRuleExisted), + "SubAccountExisted" => Some(Self::SubAccountExisted), + "NotFoundUser" => Some(Self::NotFoundUser), + "NotFoundOwnerUser" => Some(Self::NotFoundOwnerUser), + "NotFoundUserGroup" => Some(Self::NotFoundUserGroup), + "NotFoundAuthStrategyRule" => Some(Self::NotFoundAuthStrategyRule), + "NotAllowModifyDefaultStrategyPrincipal" => { + Some(Self::NotAllowModifyDefaultStrategyPrincipal) + } + "NotAllowModifyOwnerDefaultStrategy" => { + Some(Self::NotAllowModifyOwnerDefaultStrategy) + } + "EmptyAutToken" => Some(Self::EmptyAutToken), + "TokenDisabled" => Some(Self::TokenDisabled), + "TokenNotExisted" => Some(Self::TokenNotExisted), + "AuthTokenForbidden" => Some(Self::AuthTokenForbidden), + "OperationRoleForbidden" => Some(Self::OperationRoleForbidden), + _ => None, + } + } }