config

package
v0.0.0-...-1893941 Latest Latest
Warning

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

Go to latest
Published: May 3, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Router *mux.Router = mux.NewRouter().StrictSlash(true)

Router routes endpoint requests to their designated functions

View Source
var SQLTLSCert *tls.Config

SQLTLSCert holds TLS Certs for PSQL as the 'pgx' package does not include TLS Certs when reading the connection string

Functions

func CloseApplication

func CloseApplication()

CloseApplication

func CreateHTTPServer

func CreateHTTPServer() http.Server

CreateHTTPServer applies the functions to their

func ExecPSQLFunc

func ExecPSQLFunc(funcName string, args ...interface{}) ([]*map[string]interface{}, error)

ExecPSQLFunc is a convenience wrapper for executing database functions

func ExecRawPSQLQuery

func ExecRawPSQLQuery(query string) error

ExecRawPSQLQuery executes a raw query that does not return a result. Will only return an error.

func InitializeApplication

func InitializeApplication()

InitializeApplication

func LoggerMiddleware

func LoggerMiddleware(next http.Handler) http.Handler

LoggerMiddleware ensures that all requests are logged properly for future analysis

Types

type Configuration

type Configuration struct {
	Application struct {
		Environment  string `toml:"environment"`
		LogDirectory string `toml:"log-directory"`
	} `toml:"application"`
	Server struct {
		Host string `toml:"host"`
		Port int    `toml:"port"`
	} `toml:"api-server"`
	Database struct {
		PSQLConnectionString string `toml:"psql-connection-string"`
		TLSCert              string `toml:"tls-cert"`
	} `toml:"database"`
}
var Config Configuration

Config

type CustomLogger

type CustomLogger struct {
	Debug *log.Logger
	Info  *log.Logger
	Warn  *log.Logger
	Error *log.Logger
}
var MainLogger CustomLogger

MainLogger performs logging for tasks on the main thread

func CreateWorkerLogger

func CreateWorkerLogger(workerName string) *CustomLogger

CreateWorkerLogger returns a custom logger that adds the worker name to the logger prefix

Jump to

Keyboard shortcuts

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