testhelpers

package
v0.0.0-...-1426778 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TruncateMessages

func TruncateMessages()

TruncateMessages will truncate the messages table

func TruncateUsers

func TruncateUsers()

TruncateUsers will truncate the users table

func UserPersistToDB

func UserPersistToDB(name string, userName string, email string, password string)

UserPersistToDB and persist to DB

Types

type TestConfig

type TestConfig struct {
	AppPort    string
	DBHost     string
	DBPort     string
	DBDatabase string
	DBUsername string
	DBPassword string
	Logger     *logrus.Logger
	DBConn     *sql.DB
}

TestConfig this is a general purpose struct where we can keep the test configuration items in a singleton style object

func BootstrapTestConfig

func BootstrapTestConfig() TestConfig

BootstrapTestConfig will return a db instance

func InitTestConfig

func InitTestConfig() (TestConfig, error)

InitTestConfig this function will run and log out all the different environment variables if something isn't set correctly, it'll die and log the errors

Jump to

Keyboard shortcuts

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