MCPcopy
hub / github.com/CodisLabs/codis / ListGroup

Method ListGroup

pkg/models/store.go:162–180  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

160}
161
162func (s *Store) ListGroup() (map[int]*Group, error) {
163 paths, err := s.client.List(s.GroupDir(), false)
164 if err != nil {
165 return nil, err
166 }
167 group := make(map[int]*Group)
168 for _, path := range paths {
169 b, err := s.client.Read(path, true)
170 if err != nil {
171 return nil, err
172 }
173 g := &Group{}
174 if err := jsonDecode(g, b); err != nil {
175 return nil, err
176 }
177 group[g.Id] = g
178 }
179 return group, nil
180}
181
182func (s *Store) LoadGroup(gid int, must bool) (*Group, error) {
183 b, err := s.client.Read(s.GroupPath(gid), must)

Callers 3

refillCacheGroupMethod · 0.80
dumpConfigV3Method · 0.80
handleConfigRestoreMethod · 0.80

Calls 4

GroupDirMethod · 0.95
jsonDecodeFunction · 0.85
ListMethod · 0.65
ReadMethod · 0.65

Tested by

no test coverage detected