MCPcopy Create free account
hub / github.com/CodisLabs/codis / ListProxy

Method ListProxy

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

Source from the content-addressed store, hash-verified

200}
201
202func (s *Store) ListProxy() (map[string]*Proxy, error) {
203 paths, err := s.client.List(s.ProxyDir(), false)
204 if err != nil {
205 return nil, err
206 }
207 proxy := make(map[string]*Proxy)
208 for _, path := range paths {
209 b, err := s.client.Read(path, true)
210 if err != nil {
211 return nil, err
212 }
213 p := &Proxy{}
214 if err := jsonDecode(p, b); err != nil {
215 return nil, err
216 }
217 proxy[p.Token] = p
218 }
219 return proxy, nil
220}
221
222func (s *Store) LoadProxy(token string, must bool) (*Proxy, error) {
223 b, err := s.client.Read(s.ProxyPath(token), must)

Callers 3

refillCacheProxyMethod · 0.80
dumpConfigV3Method · 0.80
handleConfigRestoreMethod · 0.80

Calls 4

ProxyDirMethod · 0.95
jsonDecodeFunction · 0.85
ListMethod · 0.65
ReadMethod · 0.65

Tested by

no test coverage detected