conf

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2018 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureLogging

func ConfigureLogging(config *LoggingConfig) (*logrus.Entry, error)

ConfigureLogging will take the logging configuration and also adds a few default parameters

func PostgresConnect

func PostgresConnect(config *Config) *sql.DB

PostgresConnect connects to postgres db

Types

type Config

type Config struct {
	API struct {
		Host string `mapstructure:"host" json:"host"`
		Port int    `mapstructure:"port" json:"port"`
	} `mapstructure:"api" json:"api"`

	DB struct {
		Host     string `mapstructure:"host" json:"host"`
		Port     uint   `mapstructure:"port" json:"port"`
		Name     string `mapstructure:"name" json:"name"`
		User     string `mapstructure:"user" json:"user"`
		Password string `mapstructure:"password" json:"password"`
	} `mapstructure:"db" json:"db"`

	LogConfig struct {
		Level string `mapstructure:"level"`
		File  string `mapstructure:"file"`
	} `mapstructure:"log_config" json:"log_config"`
}

Config the application's configuration

func Load

func Load(configFile string) (*Config, error)

Load will construct the config from the file

type LoggingConfig

type LoggingConfig struct {
	Level string
	File  string
}

LoggingConfig specifies all the parameters needed for logging

Jump to

Keyboard shortcuts

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