typical-rest-server

module
v0.8.9 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2019 License: MIT

README

Typical REST Server

Example of typical and scalable RESTful API Server for Go

Usage
  • typical-rest-server: Run the application
  • typical-rest-server route: Print available API Routes
Configuration
Name Type Default Required
APP_ADDRESS string :8089 Yes
PG_DBNAME string Yes
PG_HOST string localhost
PG_PASSWORD string pgpass Yes
PG_PORT int 5432
PG_USER string postgres Yes
REDIS_DB int 0
REDIS_DIAL_TIMEOUT Duration 5s Yes
REDIS_HOST string localhost Yes
REDIS_IDLE_CHECK_FREQUENCY Duration 1m Yes
REDIS_IDLE_TIMEOUT Duration 5m Yes
REDIS_MAX_CONN_AGE Duration 30m Yes
REDIS_PASSWORD string redispass
REDIS_POOL_SIZE int 20 Yes
REDIS_PORT string 6379 Yes
REDIS_READ_WRITE_TIMEOUT Duration 3s Yes
SERVER_DEBUG bool false

Development Guide

Prerequisite

Install Go (It is recommend to install via Homebrew brew install go)

Build & Run

Use ./typicalw run to build and run the project.

Test

Use ./typicalw test to test the project.

Release the destribution

Use ./typicalw release to make the release. Learn More

Other Command
  • ./typicalw docker: Docker utility
    • ./typicalw docker compose: Generate docker-compose.yaml
    • ./typicalw docker up: Spin up docker containers
    • ./typicalw docker down: Take down all docker containers
  • ./typicalw redis: Redis Tool
    • ./typicalw redis console: Redis Interactive
  • ./typicalw postgres: Postgres Database Tool
    • ./typicalw postgres create: Create New Database
    • ./typicalw postgres drop: Drop Database
    • ./typicalw postgres migrate: Migrate Database
    • ./typicalw postgres rollback: Rollback Database
    • ./typicalw postgres seed: Database Seeding
    • ./typicalw postgres console: PostgreSQL Interactive

Directories

Path Synopsis
app
cmd
internal
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
pkg

Jump to

Keyboard shortcuts

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