github.com/Heebron/moby@v0.0.0-20221111184709-6eab4f55faf7/libnetwork/osl/kernel/knobs.go (about)

     1  package kernel
     2  
     3  type conditionalCheck func(val1, val2 string) bool
     4  
     5  // OSValue represents a tuple, value defined, check function when to apply the value
     6  type OSValue struct {
     7  	Value   string
     8  	CheckFn conditionalCheck
     9  }
    10  
    11  func propertyIsValid(val1, val2 string, check conditionalCheck) bool {
    12  	if check == nil || check(val1, val2) {
    13  		return true
    14  	}
    15  	return false
    16  }