helpers

package
v0.0.0-...-6d5ccd8 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExitOnError

func ExitOnError(err error)

ExitOnError will print out the error and exit

func GenerateDBConfigString

func GenerateDBConfigString(environment string) (string, string)

GenerateDBConfigString generates the config for migration

func GetLatestBaseFolder

func GetLatestBaseFolder() (string, error)

GetLatestBaseFolder helps to identify what is the current base folder

func SearchAndReplaceFiles

func SearchAndReplaceFiles(fullPath string, replacers map[string]string) error

SearchAndReplaceFiles searches all files in fullPath and replace

Types

type DBConfig

type DBConfig struct {
	Development Postgresql
	Test        Postgresql
	Staging     Postgresql
	Production  Postgresql
}

DBConfig Type for MySql

func LoadDBConfig

func LoadDBConfig(configFile string) (*DBConfig, error)

LoadDBConfig is used to load database config

type Postgresql

type Postgresql struct {
	Dbname   string
	Host     string
	Port     int64
	Adapter  string
	User     string
	Password string
	Sslmode  string
}

Postgresql is postgresql struct to expose data of db connection

func RetrieveDBConfig

func RetrieveDBConfig(environment string) Postgresql

RetrieveDBConfig helps to get the DBConfig for an environment

Jump to

Keyboard shortcuts

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