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

Method AddConfig

config/config.go:75–88  ·  view source on GitHub ↗

AddConfig adds a new section->key:value to the configuration.

(section string, option string, value string)

Source from the content-addressed store, hash-verified

73
74// AddConfig adds a new section->key:value to the configuration.
75func (c *Config) AddConfig(section string, option string, value string) bool {
76 if section == "" {
77 section = DEFAULT_SECTION
78 }
79
80 if _, ok := c.data[section]; !ok {
81 c.data[section] = make(map[string]string)
82 }
83
84 _, ok := c.data[section][option]
85 c.data[section][option] = value
86
87 return !ok
88}
89
90func (c *Config) parse(fname string) (err error) {
91 f, err := os.Open(fname)

Callers 2

writeMethod · 0.95
SetMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected