MCPcopy
hub / github.com/minio/minio-go / FuncMatch

Method FuncMatch

pkg/set/set.go:92–100  ·  view source on GitHub ↗

FuncMatch - returns new set containing each value that passes match function. A 'matchFn' should accept element in a set as first argument and 'matchValue' as second argument. The function can do any logic to compare both the arguments and should return true to accept element in a set to include in

(matchFn func(T, T) bool, matchValue T)

Source from the content-addressed store, hash-verified

90// compare both the arguments and should return true to accept element in
91// a set to include in output set else the element is ignored.
92func (set Set[T]) FuncMatch(matchFn func(T, T) bool, matchValue T) Set[T] {
93 nset := New[T]()
94 for k := range set {
95 if matchFn(k, matchValue) {
96 nset.Add(k)
97 }
98 }
99 return nset
100}
101
102// ApplyFunc - returns new set containing each value processed by 'applyFn'.
103// A 'applyFn' should accept element in a set as an argument and return

Callers 10

isValidStatementFunction · 0.45
getInUsePolicyFunction · 0.45
removeStatementsFunction · 0.45
GetPolicyFunction · 0.45
TestIntSetFuncMatchFunction · 0.45
TestStringSetFuncMatchFunction · 0.45
ExampleSet_FuncMatchFunction · 0.45

Calls 1

AddMethod · 0.45

Tested by 6

TestIntSetFuncMatchFunction · 0.36
TestStringSetFuncMatchFunction · 0.36
ExampleSet_FuncMatchFunction · 0.36