Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
.gitignore | H A D | 24-Dec-2019 | 252 | |||
.travis.yml | H A D | 24-Dec-2019 | 69 | |||
LICENSE | H A D | 24-Dec-2019 | 1 KiB | |||
README.md | H A D | 24-Dec-2019 | 943 | |||
epsilon_greedy.go | H A D | 24-Dec-2019 | 5.5 KiB | |||
epsilon_value_calculators.go | H A D | 24-Dec-2019 | 1.5 KiB | |||
example_test.go | H A D | 24-Dec-2019 | 275 | |||
go.mod | H A D | 24-Dec-2019 | 89 | |||
go.sum | H A D | 24-Dec-2019 | 867 | |||
host_entry.go | H A D | 24-Dec-2019 | 1.4 KiB | |||
hostpool.go | H A D | 24-Dec-2019 | 4.6 KiB | |||
hostpool_test.go | H A D | 24-Dec-2019 | 3.5 KiB |
README.md
1go-hostpool 2=========== 3 4[![Build Status](https://secure.travis-ci.org/bitly/go-hostpool.png?branch=master)](http://travis-ci.org/bitly/go-hostpool) [![GoDoc](https://godoc.org/github.com/bitly/go-hostpool?status.svg)](https://godoc.org/github.com/bitly/go-hostpool) [![GitHub release](https://img.shields.io/github/release/bitly/go-hostpool.svg)](https://github.com/bitly/go-hostpool/releases/latest) 5 6 7A Go package to intelligently and flexibly pool among multiple hosts from your Go application. 8Host selection can operate in round robin or epsilon greedy mode, and unresponsive hosts are 9avoided. 10Usage example: 11 12```go 13hp := hostpool.NewEpsilonGreedy([]string{"a", "b"}, 0, &hostpool.LinearEpsilonValueCalculator{}) 14hostResponse := hp.Get() 15hostname := hostResponse.Host() 16err := _ // (make a request with hostname) 17hostResponse.Mark(err) 18``` 19 20View more detailed documentation on [godoc.org](http://godoc.org/github.com/bitly/go-hostpool) 21