forked from DGNum/stateless-uptime-kuma
feat: add helper functions to filter probes in lib
This commit is contained in:
parent
1c73542d29
commit
0ee4239e62
1 changed files with 12 additions and 0 deletions
|
@ -2,6 +2,18 @@
|
|||
rec {
|
||||
mkFqdn = _: cfg: cfg.networking.fqdn;
|
||||
|
||||
probesWithTag =
|
||||
{
|
||||
name,
|
||||
value ? null,
|
||||
}:
|
||||
probesConfig:
|
||||
lib.filterAttrs (
|
||||
k: v: lib.any (tag: tag.name == name && (value == null || tag.value == value)) v.tags
|
||||
) probesConfig.monitors;
|
||||
|
||||
probesWithType = type: probesConfig: lib.filterAttrs (_: v: v.type == type) probesConfig.monitors;
|
||||
|
||||
fromHive =
|
||||
{
|
||||
builder,
|
||||
|
|
Loading…
Reference in a new issue