Skip to content

Latest commit

 

History

History
42 lines (31 loc) · 764 Bytes

README.md

File metadata and controls

42 lines (31 loc) · 764 Bytes

cslb

Client-Side Load Balancer

This Project is in early developing state

Feature

  • Multiple client-side load balancing solutions support
  • Multiple distributing strategies
    • Round-Robin
    • Weighted Round-Robin
    • Hashed
  • Exile unhealthy node
  • Node list TTL

Usage

Example:

package main

import (
	"log"
	
	"github.com/RangerCD/cslb"
)

func main() {
	lb := cslb.NewLoadBalancer(
		cslb.NewRRDNSService([]string{"example.com"}, true, true), 
		cslb.NewRoundRobinStrategy(),
	)

	log.Println(lb.Next()) // IP 1
	log.Println(lb.Next()) // IP 2
}