MCPcopy Index your code
hub / github.com/APIParkLab/APIPark / loadAccess

Function loadAccess

initialization.go:164–187  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

162}
163
164func loadAccess() (map[string]*Access, int) {
165 confAccess := access.All()
166 unset := 0
167 as := make(map[string]*Access)
168 for group, al := range confAccess {
169 for _, a := range al {
170 g, name := readKey(a.Name)
171 if g != group {
172 log.Fatal("invalid access key:[%s]", a.Name)
173 }
174 as[a.Name] = &Access{
175 Key: a.Name,
176 Group: group,
177 Name: name,
178 Cname: a.CName,
179 Desc: a.Desc,
180 }
181 if a.CName == unsetValue || a.Desc == unsetValue {
182 unset++
183 }
184 }
185 }
186 return as, unset
187}

Callers 1

doCheckFunction · 0.85

Calls 2

readKeyFunction · 0.85
AllMethod · 0.65

Tested by

no test coverage detected