configuration

package
v0.0.0-...-4870372 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package configuration returns a configuration gathered from configuration.json file

Index

Constants

View Source
const (
	// CONFILENAME is the configuration file name
	CONFILENAME = "configuration.json"
	// PRODUCTION is used to attach the db to docker
	PRODUCTION = "production"
	// DOCKERHOST is the docker container name
	DOCKERHOST = "db"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	// Environment represents the working environment
	Environment string `json:"environment"`
	// Server embeds environment variables used to initialize the server
	Server Server `json:"SERVER"`
	// PSQL embeds environment variables used to initialize PSQL connection
	PSQL PSQL `json:"PSQL"`
}

Configuration embeds environment variables used to initialize the system

func Get

func Get() (*Configuration, error)

Get returns a *Configuration filled with values fetched from a configuration file confFileName

type PSQL

type PSQL struct {
	// DriverName represents PSQL driver name
	DriverName string `json:"DRIVERNAME"`
	// DBName represents PSQL database table name
	DBName string `json:"DBNAME"`
	// User represents PSQL User
	User string `json:"USER"`
	// Host represents PSQL database host
	Host string `json:"HOST"`
	// SSLMode has value `disable` if no authentication is required
	SSLMode string `json:"SSLMODE"`
}

PSQL embeds PSQL information

type Server

type Server struct {
	// Host is the host of the server
	Host string `json:"HOST"`
	// Port is the port where the server should listen
	Port string `json:"PORT"`
}

Server embeds server information

Jump to

Keyboard shortcuts

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