No description
  • Go 99%
  • Shell 0.6%
  • Makefile 0.4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2020-04-28 22:12:51 +03:00
.circleci POSTGRES_HOST_AUTH_METHOD=trust 2020-03-13 21:11:33 +03:00
cmd gocodescore: implement the first version 2019-10-22 10:15:27 +03:00
internal gocodescore: implement the first version 2019-10-22 10:15:27 +03:00
migrations return links to previous pull analyzes 2019-06-27 22:57:49 +03:00
pkg don't accept hooks if the service is disabled 2020-04-18 19:19:20 +03:00
scripts print ./scripts/build_email_campaign/ into stdout 2020-03-14 13:41:16 +03:00
test support service config analyzed-paths 2019-10-20 21:03:56 +03:00
.dockerignore k8s deployment updates 2019-03-09 21:34:06 +03:00
.gitignore implement build log 2019-01-13 01:25:02 +03:00
.golangci.yml support golangci-lint v1.23.0 2020-01-19 16:55:06 +03:00
.pre-commit-config.yaml support golangci-lint v1.20.0 2019-10-14 12:58:20 +03:00
build.sh build golangci-api-build-email-campaign 2020-03-14 13:39:21 +03:00
CONTRIBUTING.md update CLA 2018-11-04 13:01:27 +03:00
docker-compose.yml fix for test user 2018-04-13 14:59:54 +03:00
go.mod use go1.14 2020-03-13 20:56:51 +03:00
go.sum use go1.14 2020-03-13 20:56:51 +03:00
LICENSE initial commit 2018-02-17 15:47:49 +03:00
Makefile fix makefile tabs 2019-06-30 11:23:02 +03:00
Procfile make a monorepo 2018-12-01 12:14:01 +03:00
README.md typo 2019-12-31 16:21:51 -05:00

CircleCI GolangCI

API

This repository contains code of API.

Development

Technologies

Go (golang), heroku, circleci, docker, redis, postgres. Web framework is a go kit wrapped with a code generation.

Preparation

Run:

docker-compose up -d
echo "create database api_prod;" | docker-compose exec -T pg psql -Upostgres

It runs postgres and redis needed for both api and worker.

How to run

make run_api
make run_worker

Configuration

Configurate via .env file. Dev .env may be like this:

WEB_ROOT="https://dev.golangci.com"
API_URL="https://api.dev.golangci.com"
GITHUB_CALLBACK_HOST=https://api.dev.golangci.com
DATABASE_URL="postgresql://postgres:test@localhost:5432/api_prod?sslmode=disable"
REDIS_URL="redis://127.0.0.1:6379"
PORT=3000
APP_NAME="GolangCI Dev"

Tests need .env.test file, overriding options from .env. There can be something like this:

DATABASE_URL="postgresql://postgres:test@localhost:5432/api_test?sslmode=disable"
DATABASE_DEBUG=1

How to run tests

echo "CREATE DATABASE api_test;" | docker-compose exec -T pg psql -U postgres
make test

How to test with web

Run golangci-web, golangci-worker and golangci-api. Go to https://dev.golangci.com locally and it will work.

Subscriptions and Payment Gateway

Requirements

To use Subscriptions you will need to configure the env variables for the gateway of your choice.

  • Note: Currently only SecurionPay is supported and uses SECURIONPAY_SECRET and SECURIONPAY_PLANID.

Payment Gateway Callbacks

Run ngrok http 3000 on your development machine, and use https://{ngrok_id}.ngrok.io/v1/payment/{gateway}/events as URL to receive events from the payment gateway.

  • {gateway} for SecurionPay is securionpay.
  • {ngrok_id}'s are unique and you must update the callback URL when you restart Ngrok service.

Contributing

See CONTRIBUTING.