MCPcopy Create free account
hub / github.com/golang/groupcache / PickPeer

Method PickPeer

http.go:130–140  ·  view source on GitHub ↗
(key string)

Source from the content-addressed store, hash-verified

128}
129
130func (p *HTTPPool) PickPeer(key string) (ProtoGetter, bool) {
131 p.mu.Lock()
132 defer p.mu.Unlock()
133 if p.peers.IsEmpty() {
134 return nil, false
135 }
136 if peer := p.peers.Get(key); peer != p.self {
137 return p.httpGetters[peer], true
138 }
139 return nil, false
140}
141
142func (p *HTTPPool) ServeHTTP(w http.ResponseWriter, r *http.Request) {
143 // Parse request.

Callers

nothing calls this directly

Calls 2

IsEmptyMethod · 0.80
GetMethod · 0.65

Tested by

no test coverage detected