Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

beeekind/twelvefactor_databases

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MIT licensed Build Status Go Report Card

Sample 12-Factor Application with Golang

This application demonstrates database usage within a Golang application using Postgres.

Usage

docker run gcr.io/twelvefactor/twelvefactor_databases

Environment Options

These are configuration variables that can be passed to the docker container.

Key Description Default
PORT The port on 127.0.0.1 from which this application will serve. 9090
PING_PATH The URL path at which to serve responses /ping
PING_RESPONSE The string response returned by a GET request to /ping PONG
REQ_TIMEOUT Request Timeout in Milliseconds 500
SERVER_READ_TIMEOUT Server Read Timeout in Milliseconds 1000
SERVER_WRITE_TIMEOUT Server Write Timeout in Milliseconds 2000
DB_CONN_MAX_LIFETIME Max duration of a database connection unlimited
DB_MAX_OPEN Max open database connections unlimited
DB_MAX_IDLE Max idle database connections 2
POSTGRES_URI Database connection URI postgresql://postgres@localhost:5432/postgres?sslmode=disable
USERS_PATH Path to expose the users service /users
USERS_SELECT_LIMIT The number of users to return from a GET request to the USERS_PATH 10

About

Simple 12factor Golang application demonstrating database usage (postgres)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.