example_test.go 324 B

12345678910111213
  1. package hostpool
  2. import (
  3. "github.com/bitly/go-hostpool"
  4. )
  5. func ExampleNewEpsilonGreedy() {
  6. hp := hostpool.NewEpsilonGreedy([]string{"a", "b"}, 0, &hostpool.LinearEpsilonValueCalculator{})
  7. hostResponse := hp.Get()
  8. hostname := hostResponse.Host()
  9. err := nil // (make a request with hostname)
  10. hostResponse.Mark(err)
  11. }