aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/docker/libnetwork/osl/kernel/knobs.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/docker/libnetwork/osl/kernel/knobs.go')
-rw-r--r--vendor/github.com/docker/libnetwork/osl/kernel/knobs.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/vendor/github.com/docker/libnetwork/osl/kernel/knobs.go b/vendor/github.com/docker/libnetwork/osl/kernel/knobs.go
new file mode 100644
index 000000000..a7cd7dbb7
--- /dev/null
+++ b/vendor/github.com/docker/libnetwork/osl/kernel/knobs.go
@@ -0,0 +1,16 @@
+package kernel
+
+type conditionalCheck func(val1, val2 string) bool
+
+// OSValue represents a tuple, value defined, check function when to apply the value
+type OSValue struct {
+ Value string
+ CheckFn conditionalCheck
+}
+
+func propertyIsValid(val1, val2 string, check conditionalCheck) bool {
+ if check == nil || check(val1, val2) {
+ return true
+ }
+ return false
+}