Get returns the list for the given address.
(addr string)
| 68 | |
| 69 | // Get returns the list for the given address. |
| 70 | func (p *Pools) Get(addr string) (*Pool, error) { |
| 71 | p.RLock() |
| 72 | defer p.RUnlock() |
| 73 | pool, ok := p.all[addr] |
| 74 | if !ok { |
| 75 | return nil, ErrNoConnection |
| 76 | } |
| 77 | if !pool.IsHealthy() { |
| 78 | return nil, ErrUnhealthyConnection |
| 79 | } |
| 80 | return pool, nil |
| 81 | } |
| 82 | |
| 83 | // GetAll returns all pool entries. |
| 84 | func (p *Pools) GetAll() []*Pool { |