Client-Side Load Balancer
This Project is in early developing state
- Multiple client-side load balancing solutions support
- Round-Robin DNS
- SRV DNS
- Static Node List
- Multiple distributing strategies
- Round-Robin
- Weighted Round-Robin
- Hashed
- Exile unhealthy node
- Node list TTL
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
}