config

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2018 License: MIT Imports: 9 Imported by: 3

Documentation

Index

Constants

View Source
const (
	KEY_DB_USERS        = "db_users"
	KEY_DB_URI_TEMPLATE = "db-uri-template"
	KEY_PASSWORD        = "password"
	KEY_JWT_SECRET      = "jwt-secret"
	PREFIX_TOKEN        = "Bearer "
	DB_DRIVER_NAME      = "postgres"
	DB_ADMIN_ROLE       = "db-admin-role"
)

Variables

This section is empty.

Functions

func GetCache

func GetCache() *cache.Cache

GetCache retrieves the *cache.Cache for your Application

func GetDbAdminConnection added in v0.1.1

func GetDbAdminConnection() *sql.DB

GetDbAdminConnection retrieves *sql.DB Cache use

func GetDbConnection

func GetDbConnection(name string) *sql.DB

GetDbConnection retrieves *sql.DB Cache use

func GetDbUsers

func GetDbUsers() map[string]map[string]string

GetDbUsers retrieves map with iformation about DB user. example: map{postgres: {name: postgres, password: postgres_user_password}} Cache use

func GetEnv

func GetEnv() string

GetEnv retrieves the name of current environment default "prod"

func GetNoCachedDbConnection

func GetNoCachedDbConnection(name string) *sql.DB

GetNoCachedDbConnection retrieves *sql.DB Cache doesn't use

func GetNoCachedDbUsers

func GetNoCachedDbUsers() map[string]map[string]string

GetNoCachedDbUsers retrieves map with iformation about DB user. example: map{postgres: {name: postgres, password: postgres_user_password}} Cache doesn't use

func GetNoCachedString

func GetNoCachedString(key string) string

GetNoCachedString returns without cache the value associated with the key as a string.

func GetString

func GetString(key string) string

GetString retrieves the string value of the config variable named by the key. If string value have in cache then retrieves from cache

func InitConfigFile added in v0.1.1

func InitConfigFile(path string)

Init config file from the config paths

Types

This section is empty.

Jump to

Keyboard shortcuts

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