MCPcopy
hub / github.com/apache/casbin / LoadFunctionMap

Function LoadFunctionMap

model/function.go:37–54  ·  view source on GitHub ↗

LoadFunctionMap loads an initial function map.

()

Source from the content-addressed store, hash-verified

35
36// LoadFunctionMap loads an initial function map.
37func LoadFunctionMap() FunctionMap {
38 fm := &FunctionMap{}
39 fm.fns = &sync.Map{}
40
41 fm.AddFunction("keyMatch", util.KeyMatchFunc)
42 fm.AddFunction("keyGet", util.KeyGetFunc)
43 fm.AddFunction("keyMatch2", util.KeyMatch2Func)
44 fm.AddFunction("keyGet2", util.KeyGet2Func)
45 fm.AddFunction("keyMatch3", util.KeyMatch3Func)
46 fm.AddFunction("keyGet3", util.KeyGet3Func)
47 fm.AddFunction("keyMatch4", util.KeyMatch4Func)
48 fm.AddFunction("keyMatch5", util.KeyMatch5Func)
49 fm.AddFunction("regexMatch", util.RegexMatchFunc)
50 fm.AddFunction("ipMatch", util.IPMatchFunc)
51 fm.AddFunction("globMatch", util.GlobMatchFunc)
52
53 return *fm
54}
55
56// GetFunctions return a map with all the functions.
57func (fm *FunctionMap) GetFunctions() map[string]govaluate.ExpressionFunction {

Callers 3

LoadModelMethod · 0.92
SetModelMethod · 0.92

Calls 1

AddFunctionMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…