MCPcopy Create free account
hub / github.com/apache/casbin / get

Method get

config/config.go:247–267  ·  view source on GitHub ↗

section.key or key.

(key string)

Source from the content-addressed store, hash-verified

245
246// section.key or key.
247func (c *Config) get(key string) string {
248 var (
249 section string
250 option string
251 )
252
253 keys := strings.Split(strings.ToLower(key), "::")
254 if len(keys) >= 2 {
255 section = keys[0]
256 option = keys[1]
257 } else {
258 section = DEFAULT_SECTION
259 option = keys[0]
260 }
261
262 if value, ok := c.data[section][option]; ok {
263 return value
264 }
265
266 return ""
267}

Callers 6

BoolMethod · 0.95
IntMethod · 0.95
Int64Method · 0.95
Float64Method · 0.95
StringMethod · 0.95
StringsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected