Skip to content
/ baka Public

stupidly simple centralized peer list for groupcache

Notifications You must be signed in to change notification settings

guregu/baka

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

a stupidly simple centralized peer list for groupcache

Usage

Server

Installing: go get github.com/guregu/baka/bakad

Running: bakad [--bind 0.0.0.0:1337] [--timeout 1m]

Timeout specifies how long to wait before a peer is considered dead and removed from the list. Uses the syntax specified here.

Client

import 	"github.com/guregu/baka"

var peers *groupcache.HTTPPool

func main() {
	// ex. bakad is at 10.0.0.1:1337 and this server is at 10.0.0.42:7000
	server := "http://10.0.0.1:1337"
	self := "http://10.0.0.42:7000"
	peers = groupcache.NewHTTPPool(self)
	// refresh peers list every 10 seconds
	baka.Update(server, self, peers, time.Second*10)
}

About

stupidly simple centralized peer list for groupcache

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Languages