Documentation ¶
Index ¶
- Variables
- func LoadDatabase() (*database.DBW, string)
- func LoadDatabaseFromFile(file string, usePrefix bool) (*database.DBW, string)
- func SetupDatabase() (*database.DBW, string)
- func TeardownDatabase(unique string)
- type FatalfFuncType
- type GenerateFuncType
- type MockLogger
- type MockToken
- type PrintfFuncType
Constants ¶
This section is empty.
Variables ¶
View Source
var FatalfFuncDefault = func(format string, v ...interface{}) {}
FatalfFuncDefault .
View Source
var GenerateFuncDefault = func(userID string, duration time.Duration) (string, error) { return "", nil }
GenerateFuncDefault .
View Source
var PrintfFuncDefault = func(format string, v ...interface{}) {}
PrintfFuncDefault .
Functions ¶
func LoadDatabase ¶
LoadDatabase will set up the DB and apply migrations for the tests.
func LoadDatabaseFromFile ¶
LoadDatabaseFromFile will set up the DB for the tests.
func SetupDatabase ¶
SetupDatabase will create the test database and set the environment variables.
func TeardownDatabase ¶
func TeardownDatabase(unique string)
TeardownDatabase will destroy the test database and unset the environment variables.
Types ¶
type GenerateFuncType ¶
GenerateFuncType .
type MockLogger ¶
type MockLogger struct { FatalfFunc FatalfFuncType PrintfFunc PrintfFuncType }
MockLogger is a mocked logger.
type MockToken ¶
type MockToken struct {
GenerateFunc GenerateFuncType
}
MockToken is a mocked webtoken.
Click to show internal directories.
Click to hide internal directories.