GetByKey returns a single peer by public key.
(publicKey string)
| 120 | |
| 121 | // GetByKey returns a single peer by public key. |
| 122 | func (ps *PeerStore) GetByKey(publicKey string) *PeerInfo { |
| 123 | ps.mu.RLock() |
| 124 | defer ps.mu.RUnlock() |
| 125 | |
| 126 | return clonePeerInfo(ps.peers[publicKey]) |
| 127 | } |
| 128 | |
| 129 | // GetAll returns all configured peers. |
| 130 | func (ps *PeerStore) GetAll() []*PeerInfo { |