-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfn.libsonnet
38 lines (37 loc) · 1.3 KB
/
fn.libsonnet
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// This file exports function generators for modifying data analogous to the ones found in f.libsonnet.
// Thereby separating the construction of functions from applying them.
//
// Functions function(x) are meant to be applied through f(raw).apply(...).
{
drop:: function() function(x) x.drop(),
rules: {
add:: function(group) function(x)
x.rules.add(group),
group:: function(selector)
{
drop:: function() function(x)
x.rules.group(selector).drop(),
rename:: function(name) function(x)
x.rules.group(selector).rename(name),
add:: function(rule) function(x)
x.rules.group(selector).add(rule),
rule:: function(ruleSelectorFunc) {
drop:: function() function(x)
x.rules.group(selector).rule(ruleSelectorFunc).drop(),
patch:: function(patch) function(x)
x.rules.group(selector).rule(ruleSelectorFunc).patch(patch),
},
},
},
dashboards: {
dashboard:: function(selector)
{
drop:: function() function(x)
x.dashboards.dashboard(selector).drop(),
rename:: function(name) function(x)
x.dashboards.dashboard(selector).rename(name),
patch:: function(patch) function(x)
x.dashboards.dashboard(selector).patch(patch),
}
},
}