Categorygithub.com/qdm12/go-template
module
0.0.0-20240329144925-ffd9c73758d9
Repository: https://github.com/qdm12/go-template.git
Documentation: pkg.go.dev

# README

go-template

SHORT_DESCRIPTION

Title

Build status

dockeri.co

Last release Last Docker tag Last release size GitHub last release date Commits since release

Latest size

GitHub last commit GitHub commit activity GitHub closed PRs GitHub issues GitHub closed issues

Lines of code Code size GitHub repo size Go version

MIT Visitors count

Features

Setup

  1. Use the following command:

    docker run -d qmcgaw/go-template-docker
    

    You can also use docker-compose.yml with:

    docker-compose up -d
    
  2. You can update the image with docker pull qmcgaw/go-template-docker:latest or use one of the tags available

Environment variables

Environment variableDefaultPossible valuesDescription
HTTP_SERVER_ADDRESS:8000Valid addressHTTP server listening address
HTTP_SERVER_ROOT_URL/URL pathHTTP server root URL
HTTP_SERVER_LOG_REQUESTSonon or offLog requests and responses information
HTTP_SERVER_ALLOWED_ORIGINSCSV of addressesComma separated list of addresses to allow for CORS
HTTP_SERVER_ALLOWED_HEADERSCSV of HTTP header keysComma separated list of header keys to allow for CORS
METRICS_SERVER_ADDRESS:9090Valid addressPrometheus HTTP server listening address
LOG_LEVELinfodebug, info, warning, errorLogging level
STORE_TYPEmemorymemory, json or postgresData store type
STORE_JSON_FILEPATHdata.jsonValid filepathJSON file to use if STORE_TYPE=json
STORE_POSTGRES_ADDRESSpsql:5432Valid addressPostgres database address if STORE_TYPE=postgres
STORE_POSTGRES_USERpostgresPostgres database user if STORE_TYPE=postgres
STORE_POSTGRES_PASSWORDpostgresPostgres database password if STORE_TYPE=postgres
STORE_POSTGRES_DATABASEdatabasePostgres database name if STORE_TYPE=postgres
HEALTH_SERVER_ADDRESS127.0.0.1:9999Valid addressHealth server listening address
TZAmerica/MontrealstringTimezone

Development

You can setup your development environment with a Docker development container or locally:

  1. Install Go, Docker and Git

  2. Install Go dependencies with

    go mod download
    
  3. Install golangci-lint

  4. You might want to use an editor such as Visual Studio Code with the Go extension.

Commands available are:

# Build the binary
go build cmd/app/main.go
# Test the code
go test ./...
# Lint the code
golangci-lint run
# Build the Docker image
docker build -t qmcgaw/go-template-docker .

See Contributing for more information on how to contribute to this repository.

TODOs

# Packages

No description provided by the author