config

package
v0.0.0-...-27abfae Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Environments = map[string]Environment{
	"dev":  "dev.yml",
	"prod": "prod.yml",
	"test": "test.yml",
}

Environments contains all the possible environments

Functions

func GetJWTConfig

func GetJWTConfig(claims jwt.Claims) middleware.JWTConfig

GetJWTConfig returns the JWT config

func SetEnviroment

func SetEnviroment(env Environment)

SetEnviroment sets the application wide environment

Types

type Config

type Config struct {
	ConnectionString string `yaml:"connection_string"`
	Database         string `yaml:"database"`
	Debug            bool   `yaml:"debug"`
	Environment      Environment
	JWTKey           string `yaml:"JWT_key"`
	MigrationsPath   string `yaml:"migrations_path"`
}

Config contains the necessary application configuration

func GetConfig

func GetConfig() Config

GetConfig returns the application wide configuration

func (Config) GetCompleteConnectionString

func (config Config) GetCompleteConnectionString() string

GetCompleteConnectionString returns the connection string based on the current config

type Environment

type Environment string

Environment in which the application runs

Jump to

Keyboard shortcuts

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