Documentation ¶
Index ¶
- func CreateApplication[TServer, TContainer any](creater AppCreater[TServer, TContainer], configName ...string) (TServer, TContainer)
- func CreateApplicationFunc[TServer, TContainer any](creater AppCreaterFunc[TServer, TContainer]) (TServer, TContainer)
- func CreateMongoDBWithDBName(t testing.TB, optMaker MongoOptions) (*mongo.Client, string)
- func CreateMySQL(t testing.TB, optMaker MySQLOptions) (*sql.DB, string)
- func CreateScyllaDB(t testing.TB, optMaker ScyllaDBOptions) *gocql.Session
- func FindConfig(workingDir string, configName ...string) (string, error)
- func FindFile(workingDir string, fileName string) (string, error)
- func GetConfig[T any](t testing.TB, create func(*viper.Viper) (T, error)) T
- func NewAppTestLogger(t testing.TB, level zerolog.Level) (zerolog.Logger, *zltest.Tester)
- func Timeout(t testing.TB, timeout time.Duration) context.Context
- func WorkingDir(t testing.TB) string
- type AppCreater
- type AppCreaterFunc
- type MongoOptions
- type MySQLOptions
- type MySQLOptionsData
- type ScyllaDBOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateApplication ¶
func CreateApplication[TServer, TContainer any](creater AppCreater[TServer, TContainer], configName ...string) (TServer, TContainer)
Creates a new instance of application for testing purposes
func CreateApplicationFunc ¶
func CreateApplicationFunc[TServer, TContainer any](creater AppCreaterFunc[TServer, TContainer]) (TServer, TContainer)
TODO: Check if it's needed to document this
func CreateMongoDBWithDBName ¶ added in v0.15.0
func CreateMySQL ¶ added in v0.16.0
func CreateScyllaDB ¶ added in v0.9.1
func CreateScyllaDB(t testing.TB, optMaker ScyllaDBOptions) *gocql.Session
func FindConfig ¶
Returns directory of config files and error if file doesent exist
func NewAppTestLogger ¶
Returns new instance of zerolog and *zltest.Tester for testing puurposes
func WorkingDir ¶ added in v0.9.1
Types ¶
type AppCreater ¶
type AppCreater[TServer, TContainer any] interface { Create(context.Context, *viper.Viper) (TServer, TContainer) }
interface AppCreater Retunrs Server and Container for testing purposes
type AppCreaterFunc ¶
type AppCreaterFunc[TServer, TContainer any] func(context.Context, *viper.Viper) (TServer, TContainer)
Delegates functions for AppCreater
type MongoOptions ¶ added in v0.9.1
type MongoOptions interface {
GetOptions() *options.ClientOptions
}
type MySQLOptions ¶ added in v0.16.0
type MySQLOptions interface {
GetOptions() MySQLOptionsData
}
type MySQLOptionsData ¶ added in v0.16.0
type ScyllaDBOptions ¶ added in v0.9.1
type ScyllaDBOptions interface {
GetOptions() *gocql.ClusterConfig
}
Click to show internal directories.
Click to hide internal directories.