Client side load balancer for Consul DNS SRV records
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Build Status GoDoc

Consul Client Load Balancer for Go Demo

Selects a SRV record answer according to specified load balancer algorithm, then resolves its A record to an ip, and returns an Address structure:

type Address struct {
	Address string
	Port    uint16

Notes for Consul / Confd Cluster Demo

Version 0.1.0 contains the demo service used in my blog post outlining how to use Consul for service discovery and configuration management while using Confd and DNS to keep your applications decoupled from the specifics of Consul.


srvName := "my-svc.service.consul"
c := clb.NewClb("", "8600", clb.RoundRobin)
address, err := c.GetAddress(srvName)
if err != nil {

fmt.Printf("%s", address.String())
// Output:


tests are run against some fixture dns entries I set up on (dig SRV).

  • make deps install deps
  • make test run all tests