offers

command module
v3.0.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2018 License: MIT Imports: 1 Imported by: 0

README

Offers

Build Status Coverage Status Code Climate Go Report Card Docs

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) env variable and add $GOPATH/bin to your $PATH

make setup
Building
make build
Running
make run-full
Automated tests

Offers has unit, integration and acceptance tests (using cucumber). To run all of them:

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 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 you can use this variable to specify your project's URL to send errors to.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL