Documentation ¶
Index ¶
- func MustRun(opts ...options.Option) *testsql.Container
- func Run(opts ...options.Option) (*testsql.Container, error)
- func RunForTest(t *testing.T, opts ...options.Option) *testsql.Container
- func RunForTestWithContext(t *testing.T, ctx context.Context, opts ...options.Option) *testsql.Container
- func RunWithContext(ctx context.Context, opts ...options.Option) (con *testsql.Container, err error)
- func WithInitialDatabase(dbName string) options.Option
- func WithPassword(password string) options.Option
- func WithTrust() options.Option
- func WithUser(user string) options.Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Run ¶
Run creates and starts a docker Container with the `postgres` image. Defaults to `postgres:latest` if no option sets image tag. A default context is used with a timeout of two minutes. To customize use RunWithContext.
func RunForTest ¶
RunForTest creates and starts a docker Container with the `postgres` image. Defaults to `postgres:latest` if no option sets image tag. The Container is automatically terminated after the test has finished. A default context is used with a timeout of two minutes. To customize use RunTestWithContext.
func RunForTestWithContext ¶
func RunForTestWithContext(t *testing.T, ctx context.Context, opts ...options.Option) *testsql.Container
RunForTestWithContext creates and starts a docker Container with the `postgres` image. Defaults to `latest` if no option sets image tag. A context can be provided to configure things such as timeout. The Container is automatically terminated after the test has finished.
func RunWithContext ¶
func RunWithContext(ctx context.Context, opts ...options.Option) (con *testsql.Container, err error)
RunWithContext creates and starts a docker Container with the `postgres` image. Defaults to `postgres:latest` if no option sets image tag. A context can be provided to configure things such as timeout.
func WithInitialDatabase ¶
WithInitialDatabase sets POSTGRES_DB
func WithPassword ¶
WithPassword sets POSTGRES_PASSWORD to the given password.
Types ¶
This section is empty.