https://github.com/topfreegames/offers
Offers is a service meant to handle offers/promotions in your games.
https://github.com/topfreegames/offers
Last synced: 1 day ago
JSON representation
Offers is a service meant to handle offers/promotions in your games.
- Host: GitHub
- URL: https://github.com/topfreegames/offers
- Owner: topfreegames
- License: mit
- Created: 2017-02-09T18:37:20.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-03-18T17:38:09.000Z (over 6 years ago)
- Last Synced: 2024-06-20T13:39:06.668Z (over 1 year ago)
- Language: Go
- Size: 5.76 MB
- Stars: 2
- Watchers: 18
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Offers
[](https://travis-ci.org/topfreegames/offers)
[](https://coveralls.io/github/topfreegames/offers?branch=master)
[](https://codeclimate.com/github/topfreegames/offers)
[](https://goreportcard.com/report/github.com/topfreegames/offers)
[](http://offers-api.readthedocs.io/en/latest/)
[](https://imagelayers.io/?images=tfgco/offers:latest 'Offers Image Layers')Offers is a service meant to handle offers/promotions in your games.
### Dependencies
* Go 1.7
* Postgres >= 9.5### Setup
First, set your $GOPATH ([Go Lang](https://golang.org/doc/install)) env variable and add $GOPATH/bin to your $PATH```bash
make setup
```### Building
```bash
make build
```### Running
```bash
make run-full
```### Automated tests
Offers has unit, integration and acceptance tests (using cucumber). To run all of them:
```bash
make test
```### Available Environment variables
Offers uses PostgreSQL to store offers information. The container takes environment variables to specify this connection:
* `OFFERS_POSTGRES_HOST` - PostgreSQL host to connect to;
* `OFFERS_POSTGRES_PORT` - PostgreSQL port to connect to;
* `OFFERS_POSTGRES_DBNAME` - PostgreSQL database to connect to;
* `OFFERS_POSTGRES_PASSWORD` - Password of the PostgreSQL Server to connect to;
* `OFFERS_POSTGRES_USER` - PostgreSQL user;Offers uses basic auth to restrict access to routes that are not used directly by a client consuming the offers.
* `OFFERS_BASICAUTH_USERNAME` - Basic Auth user;
* `OFFERS_BASICAUTH_PASSWORD` - Basic Auth password;When a client requests the available offers the API returns a `max-age` header. The cache TTL (in seconds) can be defined using the following variable:
* `OFFERS_CACHE_MAXAGESECONDS` - Max age in seconds;
Other than that, there are a couple more configurations you can pass using environment variables:
* `OFFERS_NEWRELIC_KEY` - If you have a [New Relic](https://newrelic.com/) account, you can use this variable to specify your API Key to populate data with New Relic API;
* `OFFERS_NEWRELIC_APP` - Name of the NewRelic app ;
* `OFFERS_SENTRY_URL` - If you have a [sentry server](https://docs.getsentry.com/hosted/) you can use this variable to specify your project's URL to send errors to.