Skip to content

RangerCD/cslb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
}

About

Client-Side Load Balancing for Golang

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages