Base
env var
yaml value: str
Set a environment variable, in the form ‘$’ + variable name, E.g. $TCP_LISTEN_ADDR.
The value of the environment variable will be parsed just as you write this value as yaml string directly there.
nonzero u32
yaml value: int
A non-zero u32 in value type.
humanize usize
yaml value: int | str
For str value, it support units of 2^10 like “KiB”, “MiB”, or units of 1000 like “KB”, “MB”.
For int value or str value without unit, the unit will be bytes.
See also
humanize u32
yaml value: int | str
For str value, it support units of 2^10 like “KiB”, “MiB”, or units of 1000 like “KB”, “MB”.
For int value or str value without unit, the unit will be bytes.
humanize duration
yaml value: int | str
For str value, at least one unit is required. Multiple units string like “1h 30m 71s” is also supported. See duration units for all supported units.
For int and real value, the unit will be seconds.
See also
upstream str
yaml value: str
The string should be in <ip>[:<port>] or <domain>[:<port>] format.
If omitted, the port will be set to 0.
url str
yaml value: str
The string should be a valid url.
ascii str
yaml value: str
The string should only consists of ascii characters.
rfc3339 datetime str
yaml value: str
The string should be a value rfc3339 datetime string.
selective pick policy
yaml value: str
The policy to select item from selective vectors.
The following values are supported:
random
The default one.
serial | sequence
For nodes with the same weights, the order is kept as in the config.
round_robin | rr
For nodes with the same weights, the order is kept as in the config.
ketama
Ketama Consistent Hash. The key format is defined in the context of each selective vector.
rendezvous
Rendezvous Hash. The key format is defined in the context of each selective vector.
jump_hash
Jump Consistent Hash. The key format is defined in the context of each selective vector.
weighted upstream addr
yaml value: map | string
A upstream str with weight set, which make can be grouped into selective vector.
The map consists 2 fields:
addr
required, type: upstream str
The real value.
weight
optional, type: f64
The weight of the real value. It may be converted to the smallest u32 greater than or equal to the f64 value when used.
default: 1.0
If the value type is string, then it’s value will be the addr field, with weight set to default value.
list
yaml value: mix
A list container type for type T.
The value could be a single value of type T, or a sequence of values of type T.