MCPcopy Index your code
hub / github.com/apache/casbin / NewModelFromFile

Function NewModelFromFile

model/model.go:139–148  ·  view source on GitHub ↗

NewModelFromFile creates a model from a .CONF file.

(path string)

Source from the content-addressed store, hash-verified

137
138// NewModelFromFile creates a model from a .CONF file.
139func NewModelFromFile(path string) (Model, error) {
140 m := NewModel()
141
142 err := m.LoadModel(path)
143 if err != nil {
144 return nil, err
145 }
146
147 return m, nil
148}
149
150// NewModelFromString creates a model from a string which contains model text.
151func NewModelFromString(text string) (Model, error) {

Callers 4

TestLinkConditionFuncFunction · 0.92
InitWithAdapterMethod · 0.92
LoadModelMethod · 0.92
TestNewModelFromFileFunction · 0.85

Calls 2

LoadModelMethod · 0.95
NewModelFunction · 0.85

Tested by 2

TestLinkConditionFuncFunction · 0.74
TestNewModelFromFileFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…