Documentation
¶
Index ¶
- func Init(ctx context.Context, env Environment, mig migrations.Migrations, ...) (db *sql.DB, term func(), err error)
- func Reuse(ctx context.Context, reuse *Reusable, mig migrations.Migrations, ...) (db *sql.DB, term func(), err error)
- func ReuseForTesting(t *testing.T, reuse *Reusable, mig migrations.Migrations, ...) *sql.DB
- func UseExternal(ctx context.Context, migrations migrations.Migrations, ...) (db *sql.DB, term func(), err error)
- func UseExternalConfig(ctx context.Context, cfg *ExternalEnvironmentConfig, ...) (db *sql.DB, term func(), err error)
- func UseExternalForTesting(t *testing.T, migrations migrations.Migrations, ...) *sql.DB
- func UseExternalForTestingConfig(t *testing.T, cfg *ExternalEnvironmentConfig, migrations migrations.Migrations, ...) *sql.DB
- type Environment
- type ExternalEnvironmentConfig
- type ProvideEnvironmentFunc
- type Reusable
- type ReusableOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Init ¶
func Init( ctx context.Context, env Environment, mig migrations.Migrations, initialQueries ...migrations.Query, ) (db *sql.DB, term func(), err error)
func Reuse ¶
func Reuse( ctx context.Context, reuse *Reusable, mig migrations.Migrations, initialQueries ...migrations.Query, ) (db *sql.DB, term func(), err error)
func ReuseForTesting ¶
func ReuseForTesting( t *testing.T, reuse *Reusable, mig migrations.Migrations, initialQueries ...migrations.Query, ) *sql.DB
func UseExternal ¶
func UseExternal( ctx context.Context, migrations migrations.Migrations, initialQueries ...migrations.Query, ) (db *sql.DB, term func(), err error)
func UseExternalConfig ¶
func UseExternalConfig( ctx context.Context, cfg *ExternalEnvironmentConfig, migrations migrations.Migrations, initialQueries ...migrations.Query, ) (db *sql.DB, term func(), err error)
func UseExternalForTesting ¶
func UseExternalForTesting( t *testing.T, migrations migrations.Migrations, initialQueries ...migrations.Query, ) *sql.DB
func UseExternalForTestingConfig ¶
func UseExternalForTestingConfig( t *testing.T, cfg *ExternalEnvironmentConfig, migrations migrations.Migrations, initialQueries ...migrations.Query, ) *sql.DB
Types ¶
type Environment ¶
type ProvideEnvironmentFunc ¶
type ProvideEnvironmentFunc func(ctx context.Context) (Environment, error)
func ExternalEnvironment ¶
func ExternalEnvironment(cfg *ExternalEnvironmentConfig) ProvideEnvironmentFunc
type Reusable ¶
type Reusable struct {
// contains filtered or unexported fields
}
func ExternalReusable ¶
func ExternalReusable() *Reusable
func NewReusable ¶
func NewReusable(ccf ProvideEnvironmentFunc, opts ...ReusableOption) *Reusable
type ReusableOption ¶
type ReusableOption func(r *Reusable)
func WithWaitDuration ¶
func WithWaitDuration(duration time.Duration) ReusableOption
Click to show internal directories.
Click to hide internal directories.