pub struct RouteBuilder {Show 18 fields
pub id: Option<String>,
pub name: Option<String>,
pub desc: Option<String>,
pub status: Option<i64>,
pub plugins: Option<Plugins>,
pub uri: Option<String>,
pub uris: Option<Vec<String>>,
pub host: Option<String>,
pub hosts: Option<Vec<String>>,
pub remote_addr: Option<String>,
pub remote_addrs: Option<Vec<String>>,
pub methods: Option<Vec<String>>,
pub upstream: Option<UpstreamRequest>,
pub upstream_id: Option<String>,
pub service_id: Option<String>,
pub timeout: Option<ApisixTimeout>,
pub enable_websocket: Option<bool>,
pub priority: Option<i64>,
}Fields§
§id: Option<String>§name: Option<String>§desc: Option<String>§status: Option<i64>§plugins: Option<Plugins>§uri: Option<String>§uris: Option<Vec<String>>§host: Option<String>§hosts: Option<Vec<String>>§remote_addr: Option<String>§remote_addrs: Option<Vec<String>>§methods: Option<Vec<String>>§upstream: Option<UpstreamRequest>§upstream_id: Option<String>§service_id: Option<String>§timeout: Option<ApisixTimeout>§enable_websocket: Option<bool>§priority: Option<i64>Implementations§
Source§impl RouteBuilder
impl RouteBuilder
pub fn new() -> Self
pub fn with_id(self, id: String) -> Self
Sourcepub fn with_status(self, status: i64) -> Self
pub fn with_status(self, status: i64) -> Self
Enables the current Route. Set to 1 (enabled) by default 1 to enable, 0 to disable
Sourcepub fn with_plugins(self, plugins: Plugins) -> Self
pub fn with_plugins(self, plugins: Plugins) -> Self
Plugins that are executed during the request/response cycle. See Plugins for more
Sourcepub fn with_uri(self, uri: String) -> Self
pub fn with_uri(self, uri: String) -> Self
Matches the uri. For more advanced matching see Router Example: “/hello”
Sourcepub fn with_uris(self, uris: Vec<String>) -> Self
pub fn with_uris(self, uris: Vec<String>) -> Self
Matches with any one of the multiple uris specified in the form of a non-empty list Example: [“/hello”, “/word”]
Sourcepub fn with_host(self, host: String) -> Self
pub fn with_host(self, host: String) -> Self
Matches with domain names such as foo.com or PAN domain names like *.foo.com. Example: “foo.com”
Sourcepub fn with_hosts(self, hosts: Vec<String>) -> Self
pub fn with_hosts(self, hosts: Vec<String>) -> Self
Matches with any one of the multiple hosts specified in the form of a non-empty list Example: [“foo.com”, “bar.com”]
Sourcepub fn with_remote_addr(self, remote_addr: String) -> Self
pub fn with_remote_addr(self, remote_addr: String) -> Self
Matches with the specified IP address in standard IPv4 format (192.168.1.101), CIDR format (192.168.1.0/24), or in IPv6 format (::1, fe80::1, fe80::1/64) Example: “192.168.1.0/24”
Sourcepub fn with_remote_addrs(self, remote_addrs: Vec<String>) -> Self
pub fn with_remote_addrs(self, remote_addrs: Vec<String>) -> Self
Matches with any one of the multiple remote_addrs specified in the form of a non-empty list Example: [“127.0.0.1”, “192.0.0.0/8”, “::1”]
Sourcepub fn with_methods(self, methods: Vec<String>) -> Self
pub fn with_methods(self, methods: Vec<String>) -> Self
Matches with the specified methods. Matches all methods if empty or unspecified Example: [“GET”, “POST”]
Sourcepub fn with_upstream(self, upstream: UpstreamRequest) -> Self
pub fn with_upstream(self, upstream: UpstreamRequest) -> Self
Configuration of the Upstream [@UpstreamRequest]
Sourcepub fn with_upstream_id(self, upstream_id: String) -> Self
pub fn with_upstream_id(self, upstream_id: String) -> Self
Id of the Upstream service
Sourcepub fn with_service_id(self, service_id: String) -> Self
pub fn with_service_id(self, service_id: String) -> Self
Configuration of the bound Service
Sourcepub fn with_timeout(self, timeout: ApisixTimeout) -> Self
pub fn with_timeout(self, timeout: ApisixTimeout) -> Self
Sets the timeout (in seconds) for connecting to, and sending and receiving messages between the Upstream and the Route. This will overwrite the timeout value configured in your Upstream Example: {“connect”: 0.5,“send”: 0.5,“read”: 0.5}
Sourcepub fn with_enable_websocket(self, enable_websocket: bool) -> Self
pub fn with_enable_websocket(self, enable_websocket: bool) -> Self
Enables a websocket. Set to false by default
Sourcepub fn priority(self, priority: i64) -> Self
pub fn priority(self, priority: i64) -> Self
If different Routes matches to the same uri, then the Route is matched based on its priority. A higher value corresponds to higher priority. It is set to 0 by default.
pub fn build(self) -> Result<RouteRequest, ApisixClientError>
Trait Implementations§
Source§impl Clone for RouteBuilder
impl Clone for RouteBuilder
Source§fn clone(&self) -> RouteBuilder
fn clone(&self) -> RouteBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more