testutil

package
v1.1.28 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TestDBUser     = "vulcan"
	TestDBPassword = "vulcan"

	DBConnString          = "port=5434 user=%s password=%s sslmode=disable dbname=%s"
	DBConnStringWithoutDB = "port=5434 user=%s password=%s sslmode=disable dbname=scan-enginedb"
)

Variables

This section is empty.

Functions

func CheckErrors

func CheckErrors(err1, err2 error) bool

CheckErrors returns trues if the both params are nil or both are not nil and are the same kind.

func DropDB

func DropDB(dbName string) error

DropDB well drops an existing DB.

func ErrToStr

func ErrToStr(err error) string

func FloatPointer

func FloatPointer(n float32) *float32

FloatPointer returns a pointer to a float32 parameter passed in. It's just an utility option for initializing inline struct fields.

func Int64Pointer

func Int64Pointer(i int64) *int64

IntPointer returns a pointer to a int parameter passed in. It's just an utility option for initializing inline struct fields.

func IntPointer

func IntPointer(i int) *int

IntPointer returns a pointer to a int parameter passed in. It's just an utility option for initializing inline struct fields.

func LoadFixtures

func LoadFixtures(fixturesDir, dbName string) error

LoadFixtures ...

func SetupDB

func SetupDB(dbDirPath string, dbName string) error

SetupDB initializes the db to be used in tests.

func StringPointer

func StringPointer(s string) *string

StringPointer returns a pointer to a string parameter passed in. It's just an utility option for initializing inline struct fields.

Types

This section is empty.

Jump to

Keyboard shortcuts

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