Documentation
¶
Index ¶
- Variables
- func New[T any](all ...Option) integration.Bootstrap[T]
- type Container
- type DB
- type Migrator
- type MigratorConfig
- type Option
- func WithContainerImage(image string) Option
- func WithContainerImageEnv(env string) Option
- func WithDBName(dbName string) Option
- func WithDeadline(deadline time.Duration) Option
- func WithFileSystem(fs afero.Fs) Option
- func WithHostedNamespace(ns string) Option
- func WithMigrationsPath(path string) Option
- func WithMigrator(migrator Migrator) Option
- func WithPassword(password string) Option
- func WithPoolConfigInjectLabel(label string) Option
- func WithPoolInjectLabel(label string) Option
- func WithPoolMaxConnections(maxCons int32) Option
- func WithPoolMaxIdleTime(maxIdleTime time.Duration) Option
- func WithPoolMinConnections(minCons int32) Option
- func WithUserName(userName string) Option
- type PostgresContainer
Constants ¶
This section is empty.
Variables ¶
var ErrRequireNamespacePrefixForHostedDB = errors.New("hosted db requires namespace prefix")
Functions ¶
Types ¶
type MigratorConfig ¶
type Option ¶
type Option func(*config)
func WithContainerImage ¶
WithContainerImage override initial container image for run postgresql instance, by default using value 'postgres:16'.
func WithContainerImageEnv ¶
WithContainerImageEnv override ENV contained container image name, by default using GROAT_I9N_PG_IMAGE.
func WithDBName ¶
WithDBName override the initial database for check correct migrationsPath process by default using value 'test'.
func WithDeadline ¶
WithDeadline override the initial timeout for bootstrap container, by default used 5 seconds deadline.
func WithFileSystem ¶
func WithHostedNamespace ¶ added in v0.0.5
func WithMigrationsPath ¶
WithMigrationsPath set default path to migrations files.
func WithMigrator ¶
WithMigrator override default migration func for pgx pool by default used plain sql files in directory.
func WithPassword ¶
WithPassword override the initial password of the user to be created when the container starts as superuser by default using value 'test'.
func WithPoolConfigInjectLabel ¶ added in v0.0.4
func WithPoolInjectLabel ¶ added in v0.0.4
func WithPoolMaxConnections ¶
WithPoolMaxConnections override default number of pgx pool max connections by default used 8.
func WithPoolMaxIdleTime ¶
WithPoolMaxIdleTime override default number of pgx pool min connections by default used one minute.
func WithPoolMinConnections ¶
WithPoolMinConnections override default number of pgx pool min connections by default used 2.
func WithUserName ¶
WithUserName override initial username of the user to be created when the container starts. By default, using value 'test'.
type PostgresContainer ¶ added in v0.0.2
type PostgresContainer interface {
ConnectionString(ctx context.Context, args ...string) (string, error)
Terminate(ctx context.Context, opts ...testcontainers.TerminateOption) error
}