()
| 117 | } |
| 118 | |
| 119 | func (ep *DynamicEndpoint) Get() (netip.AddrPort, error) { |
| 120 | if ap, err := netip.ParseAddrPort(ep.Value); err == nil { |
| 121 | return ap, nil |
| 122 | } |
| 123 | ep.rw.RLock() |
| 124 | defer ep.rw.RUnlock() |
| 125 | if ep.lastValue != (netip.AddrPort{}) { |
| 126 | return ep.lastValue, nil |
| 127 | } |
| 128 | return netip.AddrPort{}, fmt.Errorf("endpoint not resolved") |
| 129 | } |
| 130 | |
| 131 | func (ep *DynamicEndpoint) Clear() { |
| 132 | ep.rw.Lock() |
no outgoing calls
no test coverage detected