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

Function NewConfigFromText

config/config.go:66–72  ·  view source on GitHub ↗

NewConfigFromText create an empty configuration representation from text.

(text string)

Source from the content-addressed store, hash-verified

64
65// NewConfigFromText create an empty configuration representation from text.
66func NewConfigFromText(text string) (ConfigInterface, error) {
67 c := &Config{
68 data: make(map[string]map[string]string),
69 }
70 err := c.parseBuffer(bufio.NewReader(strings.NewReader(text)))
71 return c, err
72}
73
74// AddConfig adds a new section->key:value to the configuration.
75func (c *Config) AddConfig(section string, option string, value string) bool {

Callers 1

LoadModelFromTextMethod · 0.92

Calls 1

parseBufferMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…