Bouncer is the gatekeeper between the podded ecosystem and CCPs ESI API. It serves two main functions;
- To provide metrics on the response times and codes of all requests
- To enforce a global rate limit on requests
You should have a memcached server running and accessible (I won't cover this here)
The bouncer server can be run by cloning this repo, then using make to build the executable
git clone https://github.com/podded/bouncer
cd bouncer
makeGo get can fetch down the latest bouncer version
go get -u https://github.com/podded/bouncerThe bouncer server is designed to be run standalone on a machine. it can be invoked by running the binary built in the bin folder
./bin/bouncer_serverThere are a number of configuration options that can be set (either in env variables or a .env file in the working directory)
Examples of these can be found in .env
The client should be embedded within the service which will be making a request to ESI. Code for this would look like;
bc, version, err := client.NewBouncer(bouncerAddress, maxTimeout, descriptor)
if err != nil {
log.Fatalf("Failed to connect to bouncer....: %s\n", err)
}
log.Printf("Connected to bouncer. version %s\n", version)
r := bouncer.Request{
URL: fmt.Sprintf("https://esi.evetech.net/v1/killmails/%d/%s/", idhp.ID, idhp.Hash),
Method: "GET",
}
resp, _, err := bc.MakeRequest(r)
if err != nil {
log.Printf("ERROR making esi request for id %d: %s", killid, err)
continue
}
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.