pub struct UpcallGroupSource { /* private fields */ }Expand description
Shell-based group source that runs commands for lookups.
Commands can use %s as a placeholder for the group name.
The optional mapall upcall returns all group-to-nodes mappings in a
single call (upstream commit 68e5df9). Its output is a list of
group: nodes lines and is used to serve both map and list
queries from the cache. When a group is missing from the mapall
output, resolution falls back to the per-group map upcall if one is
defined; otherwise the group resolves to an empty node set.
Implementations§
Source§impl UpcallGroupSource
impl UpcallGroupSource
Sourcepub fn new(
map_upcall: Option<String>,
all_upcall: Option<String>,
list_upcall: Option<String>,
reverse_upcall: Option<String>,
) -> Self
pub fn new( map_upcall: Option<String>, all_upcall: Option<String>, list_upcall: Option<String>, reverse_upcall: Option<String>, ) -> Self
Create a new UpcallGroupSource with the given command templates.
Command templates can use %s as a placeholder for the group name.
Sourcepub fn with_mapall_upcall(self, mapall_upcall: Option<String>) -> Self
pub fn with_mapall_upcall(self, mapall_upcall: Option<String>) -> Self
Set the optional mapall upcall command template, returning all
group-to-nodes mappings as group: nodes lines in one call.
Sourcepub fn with_cache_time(self, cache_time: f64) -> Self
pub fn with_cache_time(self, cache_time: f64) -> Self
Set the upcall cache lifetime in seconds (0 disables caching).
Sourcepub fn clear_cache(&self)
pub fn clear_cache(&self)
Remove all previously cached upcall results whatever their
lifetime is (mirrors Python UpcallGroupSource.clear_cache()).