mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-10 21:50:05 +00:00
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:
@@ -14,19 +14,15 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Loadbalancer interface. Implementations use loadbalancer_<strategy> naming.
|
||||
|
||||
package proxy
|
||||
|
||||
import (
|
||||
"net"
|
||||
)
|
||||
|
||||
// LoadBalancer represents a load balancer that decides where to route
|
||||
// the incoming services for a particular service to.
|
||||
// A LoadBalancer distributes incoming requests to service endpoints.
|
||||
type LoadBalancer interface {
|
||||
// LoadBalance takes an incoming request and figures out where to route it to.
|
||||
// Determination is based on destination service (for example, 'mysql') as
|
||||
// well as the source making the connection.
|
||||
LoadBalance(service string, srcAddr net.Addr) (string, error)
|
||||
// NextEndpoint returns the endpoint to handle a request for the given
|
||||
// service and source address.
|
||||
NextEndpoint(service string, srcAddr net.Addr) (string, error)
|
||||
}
|
||||
|
Reference in New Issue
Block a user