Categorygithub.com/CCThomas/goconfig
module
0.3.0
Repository: https://github.com/ccthomas/goconfig.git
Documentation: pkg.go.dev

# README

goconfig

Golang Configuration Package to assist with developing simple micro services.

Requirements

  • Golang verison 1.6

Usage

Envrionemnt Variables

VariableNotes
GOCONFIG_DB_HOSTDatabase Host. Example: postgres
GOCONFIG_DB_NAMEDatabase Name
GOCONFIG_DB_PASSWORDDatabase Password
GOCONFIG_DB_PORTDatabase Port
GOCONFIG_DB_SSLMODEShould Database use SSLMode
GOCONFIG_DB_USERDatabase User
GOCONFIG_LOG_FILE_NAMEName of log file.
GOCONFIG_LOG_LEVELLog levels can be found here.
GOCONFIG_LOG_TO_TERMINALIf true , logs will be printed to the terminal

Logger

import "github.com/CCThomas/goconfig/pkg/loggers"
loggers.ConfigureLogrus()
GOCONFIG_LOG_FILE_NAME=my-service.log
GOCONFIG_LOG_LEVEL=debug
GOCONFIG_LOG_TO_TERMINAL=true

Database

Currently Postgres is the only supported database

import "github.com/CCThomas/goconfig/pkg/databases"
databases.ConfigureGorm()
database.DB.Create(&myModel)
GOCONFIG_DB_HOST=localhost
GOCONFIG_DB_USER=myuser
GOCONFIG_DB_PASSWORD=mypassword
GOCONFIG_DB_NAME=dbname
GOCONFIG_DB_PORT=5434
GOCONFIG_DB_SSLMODE=disable

Third Party

# Packages

No description provided by the author