Struct haproxy_api::Core [−][src]
pub struct Core<'lua> { /* fields omitted */ }
Expand description
The “Core” class contains all the HAProxy core functions.
Implementations
Returns a map of declared proxies (frontends and backends), indexed by proxy name.
Returns a map of declared proxies with backend capability, indexed by the backend name.
Returns a map of declared proxies with frontend capability, indexed by the frontend name.
Returns the executing thread number starting at 0. If thread is 0, Lua scope is shared by all threads, otherwise the scope is dedicated to a single thread. This is HAProxy 2.4 feature.
Sends a log on the default syslog server if it is configured and on the stderr if it is allowed.
Adds the ACL key
in the ACLs list referenced by filename
.
Deletes the ACL entry by key
in the ACLs list referenced by filename
.
Deletes the map entry indexed with the specified key
in the list of maps
referenced by his filename
.
Sets the value
associated to the key
in the map referenced by filename
.
Returns HAProxy core information (uptime, pid, memory pool usage, tasks number, …).
Returns the current time.
The time returned is fixed by the HAProxy core and assures than the hour will be monotonic
and that the system call gettimeofday
will not be called too.
Takes a string representing http date, and returns an integer containing the corresponding date with a epoch format. A valid http date me respect the format IMF, RFC850 or ASCTIME.
Take a string representing IMF date, and returns an integer containing the corresponding date with a epoch format.
Takess a string representing RFC850 date, and returns an integer containing the corresponding date with a epoch format.
Takes a string representing ASCTIME date, and returns an integer containing the corresponding date with a epoch format.
Registers a function executed as an action.
The expected actions are tcp-req
, tcp-res
, http-req
or http-res
.
All the registered actions can be used in HAProxy with the prefix lua.
.
Registers an asynchronous function executed as an action.
Same as register_action
but using Lua function.
Registers a function executed as a converter.
All the registered converters can be used in HAProxy with the prefix lua.
.
Registers an asynchronous function executed as a converter.
Same as register_converters
but using Lua function.
Registers a function executed as sample fetch.
All the registered sample fetch can be used in HAProxy with the prefix lua.
.
Registers an asynchronous function executed as sample fetch.
Same as register_fetches
but using Lua function.
pub fn register_lua_service<S>(
&self,
name: &str,
mode: ServiceMode,
code: &S
) -> Result<()> where
S: AsChunk<'lua> + ?Sized,
pub fn register_lua_service<S>(
&self,
name: &str,
mode: ServiceMode,
code: &S
) -> Result<()> where
S: AsChunk<'lua> + ?Sized,
Registers a Lua function executed as a service.
All the registered service can be used in HAProxy with the prefix lua.
.
Registers a function executed after the configuration parsing. This is useful to check any parameters.
Registers and start an independent task. The task is started when the HAProxy main scheduler starts.
Registers and start an independent asynchronous task.
Same as register_task
but using Lua function.
Registers a Lua function executed as a cli command.
Changes the nice of the current task or current session.
Parses ipv4 or ipv6 addresses and its facultative associated network.
Matches two networks. For example “127.0.0.1/32” matches “127.0.0.0/8”. The order of network is not important.
Trait Implementations
Auto Trait Implementations
impl<'lua> !RefUnwindSafe for Core<'lua>
impl<'lua> !UnwindSafe for Core<'lua>
Blanket Implementations
Mutably borrows from an owned value. Read more