conf

package
v0.0.0-...-f9ec6d5 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2017 License: MIT Imports: 11 Imported by: 3

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

Types

type Config

type Config struct {
	Port           int           `mapstructure:"port" json:"port"`
	JWTSecret      string        `mapstructure:"jwt_secret" json:"jwt_secret"`
	AdminGroupName string        `mapstructure:"admin_group_name" json:"admin_group_name"`
	StripeKey      string        `mapstructure:"stripe_key" json:"stripe_key"`
	LogConfig      LoggingConfig `mapstructure:"log" json:"log"`
	DBConfig       DBConfig      `mapstructure:"db" json:"db"`
}

Config the application's configuration

func LoadConfig

func LoadConfig(cmd *cobra.Command) (*Config, error)

LoadConfig loads the config from a file if specified, otherwise from the environment

type DBConfig

type DBConfig struct {
	Driver      string `mapstructure:"driver" json:"driver"`
	ConnURL     string `mapstructure:"url" json:"url"`
	Namespace   string `mapstructure:"namespace" json:"namespace"`
	Automigrate bool   `mapstructure:"automigrate" json:"automigrate"`
}

type LoggingConfig

type LoggingConfig struct {
	Level string `json:"level"`
	File  string `json:"file"`
}

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