getPgContainer creates a PostgreSQL container for testing
(ctx context.Context)
| 17 | |
| 18 | // getPgContainer creates a PostgreSQL container for testing |
| 19 | func getPgContainer(ctx context.Context) (*Container, error) { |
| 20 | tc, err := testcontainer.GetPgContainer(ctx) |
| 21 | if err != nil { |
| 22 | return nil, err |
| 23 | } |
| 24 | return &Container{ |
| 25 | Container: tc, |
| 26 | host: tc.GetHost(), |
| 27 | port: tc.GetPort(), |
| 28 | db: tc.GetDB(), |
| 29 | }, nil |
| 30 | } |
| 31 | |
| 32 | // getMySQLContainer creates a MySQL container for testing |
| 33 | func getMySQLContainer(ctx context.Context) (*Container, error) { |