this method will return a string of addr server from list server.
()
| 259 | |
| 260 | // this method will return a string of addr server from list server. |
| 261 | func (r *roundrobin) get() string { |
| 262 | r.Lock() |
| 263 | defer r.Unlock() |
| 264 | |
| 265 | if r.current >= len(r.pool) { |
| 266 | r.current %= len(r.pool) |
| 267 | } |
| 268 | |
| 269 | result := r.pool[r.current] |
| 270 | r.current++ |
| 271 | return result |
| 272 | } |
| 273 | |
| 274 | // BalancerForward Forward performs the given http request with round robin algorithm to server and fills the given http response. |
| 275 | // This method will return a fiber.Handler |
no test coverage detected