proxy: cleanup and minor refactoring

This change includes minor refactoring and cleanup of the proxy
package including the following items:

 * Rename source files with misspelling of round robin
 * Remove unnecessary and redundant comments
 * Update comments for clarity
 * Add locking when updating the round-robin index
 * Improve method receiver names
 * Rename the LoadBalance method to NextEndpoint to add clarity

No changes in behaviour have been introduced.
This commit is contained in:
Kelsey Hightower
2014-08-03 12:23:15 -07:00
parent 2282f9ce3a
commit 1d3e660248
6 changed files with 175 additions and 179 deletions

View File

@@ -68,9 +68,8 @@ func testEchoConnection(t *testing.T, address, port string) {
func TestProxy(t *testing.T) {
port, err := echoServer(t, "127.0.0.1:0")
if err != nil {
t.Fatal(err)
t.Fatalf("Unexpected error: %v", err)
}
lb := NewLoadBalancerRR()
lb.OnUpdate([]api.Endpoints{
{JSONBase: api.JSONBase{ID: "echo"}, Endpoints: []string{net.JoinHostPort("127.0.0.1", port)}}})