Skip to content

Commit

Permalink
Correct main module name (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
nhatthm authored Aug 18, 2022
1 parent 7d55b4c commit ba5956e
Show file tree
Hide file tree
Showing 12 changed files with 46 additions and 46 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
[![GitHub Releases](https://img.shields.io/github/v/release/nhatthm/testcontainers-go-registry)](https://github.com/nhatthm/testcontainers-go-registry/releases/latest)
[![Build Status](https://github.com/nhatthm/testcontainers-go-registry/actions/workflows/test.yaml/badge.svg)](https://github.com/nhatthm/testcontainers-go-registry/actions/workflows/test.yaml)
[![codecov](https://codecov.io/gh/nhatthm/testcontainers-go-registry/branch/master/graph/badge.svg?token=eTdAgDE2vR)](https://codecov.io/gh/nhatthm/testcontainers-go-registry)
[![Go Report Card](https://goreportcard.com/badge/github.com/nhatthm/testcontainers-go-registry)](https://goreportcard.com/report/github.com/nhatthm/testcontainers-go-registry)
[![GoDevDoc](https://img.shields.io/badge/dev-doc-00ADD8?logo=go)](https://pkg.go.dev/github.com/nhatthm/testcontainers-go-registry)
[![Go Report Card](https://goreportcard.com/badge/go.nhat.io/testcontainers-registry)](https://goreportcard.com/report/go.nhat.io/testcontainers-registry)
[![GoDevDoc](https://img.shields.io/badge/dev-doc-00ADD8?logo=go)](https://pkg.go.dev/go.nhat.io/testcontainers-registry)
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/donate/?hosted_button_id=PJZSGJN57TDJY)

Common Image Registry for Testcontainers-Go
Expand All @@ -16,7 +16,7 @@ Common Image Registry for Testcontainers-Go
## Install

```bash
go get go.nhat.io/testcontainers-go-registry
go get go.nhat.io/testcontainers-registry
```

## Mongo
Expand All @@ -28,7 +28,7 @@ import (
"context"

"go.nhat.io/testcontainers-go-registry/mongo"
testcontainers "go.nhat.io/testcontainers-go-extra"
testcontainers "go.nhat.io/testcontainers-extra"
)

const (
Expand All @@ -52,7 +52,7 @@ import (
"context"

"go.nhat.io/testcontainers-go-registry/mysql"
testcontainers "go.nhat.io/testcontainers-go-extra"
testcontainers "go.nhat.io/testcontainers-extra"
)

const (
Expand All @@ -79,7 +79,7 @@ import (
"context"

"go.nhat.io/testcontainers-go-registry/postgres"
testcontainers "go.nhat.io/testcontainers-go-extra"
testcontainers "go.nhat.io/testcontainers-extra"
)

const (
Expand All @@ -105,7 +105,7 @@ package example
import (
"context"

testcontainers "go.nhat.io/testcontainers-go-extra"
testcontainers "go.nhat.io/testcontainers-extra"
"go.nhat.io/testcontainers-go-registry/mssql"
)

Expand Down Expand Up @@ -134,7 +134,7 @@ import (
"context"

"go.nhat.io/testcontainers-go-registry/postgres"
testcontainers "go.nhat.io/testcontainers-go-extra"
testcontainers "go.nhat.io/testcontainers-extra"
)

const (
Expand All @@ -159,7 +159,7 @@ package example
import (
"context"

testcontainers "go.nhat.io/testcontainers-go-extra"
testcontainers "go.nhat.io/testcontainers-extra"
"go.nhat.io/testcontainers-go-registry/mysql"
)

Expand Down
2 changes: 1 addition & 1 deletion database/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/golang-migrate/migrate/v4"
_ "github.com/golang-migrate/migrate/v4/source/file" // Default migration source.
"go.nhat.io/testcontainers-go-extra"
"go.nhat.io/testcontainers-extra"
)

// RunMigrations runs database migration when container is ready.
Expand Down
4 changes: 2 additions & 2 deletions database/mongo/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package mongo
import (
"context"

"go.nhat.io/testcontainers-go-extra"
"go.nhat.io/testcontainers-extra"
)

// StartGenericContainer starts a new mysql container.
//
// Deprecated: Use go.nhat.io/testcontainers-go-registry/mongo.StartGenericContainer instead.
// Deprecated: Use go.nhat.io/testcontainers-registry/mongo.StartGenericContainer instead.
func StartGenericContainer(ctx context.Context, opts ...testcontainers.GenericContainerOption) (testcontainers.Container, error) {
r := Request(opts...)

Expand Down
12 changes: 6 additions & 6 deletions database/mongo/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import (
"time"

_ "github.com/golang-migrate/migrate/v4/database/mongodb" // Database driver
"go.nhat.io/testcontainers-go-extra"
"go.nhat.io/testcontainers-go-extra/wait"
"go.nhat.io/testcontainers-extra"
"go.nhat.io/testcontainers-extra/wait"

db "go.nhat.io/testcontainers-go-registry/database"
db "go.nhat.io/testcontainers-registry/database"
)

// Request creates a new request for starting a mongo server.
//
// Deprecated: Use go.nhat.io/testcontainers-go-registry/mongo.Request instead.
// Deprecated: Use go.nhat.io/testcontainers-registry/mongo.Request instead.
func Request(opts ...testcontainers.GenericContainerOption) testcontainers.StartGenericContainerRequest {
finalOpts := make([]testcontainers.GenericContainerOption, 1, len(opts)+1)
finalOpts[0] = testcontainers.PopulateHostPortEnv
Expand All @@ -36,14 +36,14 @@ func Request(opts ...testcontainers.GenericContainerOption) testcontainers.Start

// RunMigrations is option to run migrations.
//
// Deprecated: Use go.nhat.io/testcontainers-go-registry/mongo.RunMigrations instead.
// Deprecated: Use go.nhat.io/testcontainers-registry/mongo.RunMigrations instead.
func RunMigrations(migrationSource, dbName string) testcontainers.ContainerCallback {
return db.RunMigrations(migrationSource, DSN(dbName))
}

// DSN returns the database dsn for connecting to server.
//
// Deprecated: Use go.nhat.io/testcontainers-go-registry/mongo.DSN instead.
// Deprecated: Use go.nhat.io/testcontainers-registry/mongo.DSN instead.
func DSN(dbName string) string {
return fmt.Sprintf("mongodb://$MONGO_27017_HOST:$MONGO_27017_PORT/%s", dbName)
}
4 changes: 2 additions & 2 deletions database/mssql/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package mssql
import (
"context"

"go.nhat.io/testcontainers-go-extra"
"go.nhat.io/testcontainers-extra"
)

// StartGenericContainer starts a new mssql container.
//
// Deprecated: Use go.nhat.io/testcontainers-go-registry/mssql.StartGenericContainer instead.
// Deprecated: Use go.nhat.io/testcontainers-registry/mssql.StartGenericContainer instead.
func StartGenericContainer(ctx context.Context, dbName, dbPassword string, opts ...testcontainers.GenericContainerOption) (testcontainers.Container, error) {
r := Request(dbName, dbPassword, opts...)

Expand Down
12 changes: 6 additions & 6 deletions database/mssql/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import (

_ "github.com/golang-migrate/migrate/v4/database/sqlserver" // Database driver
"github.com/testcontainers/testcontainers-go/wait"
"go.nhat.io/testcontainers-go-extra"
extrawait "go.nhat.io/testcontainers-go-extra/wait"
"go.nhat.io/testcontainers-extra"
extrawait "go.nhat.io/testcontainers-extra/wait"

db "go.nhat.io/testcontainers-go-registry/database"
db "go.nhat.io/testcontainers-registry/database"
)

// Request creates a new request for starting a mssql server.
//
// Deprecated: Use go.nhat.io/testcontainers-go-registry/mssql.Request instead.
// Deprecated: Use go.nhat.io/testcontainers-registry/mssql.Request instead.
func Request(dbName, dbPassword string, opts ...testcontainers.GenericContainerOption) testcontainers.StartGenericContainerRequest {
finalOpts := make([]testcontainers.GenericContainerOption, 2, len(opts)+2)

Expand Down Expand Up @@ -65,14 +65,14 @@ func Request(dbName, dbPassword string, opts ...testcontainers.GenericContainerO

// RunMigrations is option to run migrations.
//
// Deprecated: Use go.nhat.io/testcontainers-go-registry/mssql.RunMigrations instead.
// Deprecated: Use go.nhat.io/testcontainers-registry/mssql.RunMigrations instead.
func RunMigrations(migrationSource string) testcontainers.ContainerCallback {
return db.RunMigrations(migrationSource, DSN(`$MSSQL_DB`, `$SA_PASSWORD`))
}

// DSN returns the database dsn for connecting to server.
//
// Deprecated: Use go.nhat.io/testcontainers-go-registry/mssql.DSN instead.
// Deprecated: Use go.nhat.io/testcontainers-registry/mssql.DSN instead.
func DSN(dbName, dbPassword string) string {
return fmt.Sprintf("sqlserver://sa:%s@$MSSQL_1433_HOST:$MSSQL_1433_PORT?database=%s", dbPassword, dbName)
}
4 changes: 2 additions & 2 deletions database/mysql/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package mysql
import (
"context"

"go.nhat.io/testcontainers-go-extra"
"go.nhat.io/testcontainers-extra"
)

// StartGenericContainer starts a new mysql container.
//
// Deprecated: Use go.nhat.io/testcontainers-go-registry/mysql.StartGenericContainer instead.
// Deprecated: Use go.nhat.io/testcontainers-registry/mysql.StartGenericContainer instead.
func StartGenericContainer(ctx context.Context, dbName, dbUser, dbPassword string, opts ...testcontainers.GenericContainerOption) (testcontainers.Container, error) {
r := Request(dbName, dbUser, dbPassword, opts...)

Expand Down
12 changes: 6 additions & 6 deletions database/mysql/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import (

_ "github.com/golang-migrate/migrate/v4/database/mysql" // Database driver
"github.com/testcontainers/testcontainers-go/wait"
"go.nhat.io/testcontainers-go-extra"
extrawait "go.nhat.io/testcontainers-go-extra/wait"
"go.nhat.io/testcontainers-extra"
extrawait "go.nhat.io/testcontainers-extra/wait"

db "go.nhat.io/testcontainers-go-registry/database"
db "go.nhat.io/testcontainers-registry/database"
)

// Request creates a new request for starting a mysql server.
//
// Deprecated: Use go.nhat.io/testcontainers-go-registry/mysql.Request instead.
// Deprecated: Use go.nhat.io/testcontainers-registry/mysql.Request instead.
func Request(dbName, dbUser, dbPassword string, opts ...testcontainers.GenericContainerOption) testcontainers.StartGenericContainerRequest {
finalOpts := make([]testcontainers.GenericContainerOption, 1, len(opts)+1)
finalOpts[0] = testcontainers.PopulateHostPortEnv
Expand Down Expand Up @@ -48,14 +48,14 @@ func Request(dbName, dbUser, dbPassword string, opts ...testcontainers.GenericCo

// RunMigrations is option to run migrations.
//
// Deprecated: Use go.nhat.io/testcontainers-go-registry/mysql.RunMigrations instead.
// Deprecated: Use go.nhat.io/testcontainers-registry/mysql.RunMigrations instead.
func RunMigrations(migrationSource string) testcontainers.ContainerCallback {
return db.RunMigrations(migrationSource, fmt.Sprintf("mysql://%s", DSN(`$MYSQL_DATABASE`, `$MYSQL_USER`, `$MYSQL_PASSWORD`)))
}

// DSN returns the database dsn for connecting to server.
//
// Deprecated: Use go.nhat.io/testcontainers-go-registry/mysql.DSN instead.
// Deprecated: Use go.nhat.io/testcontainers-registry/mysql.DSN instead.
func DSN(dbName, dbUser, dbPassword string) string {
return fmt.Sprintf("%s:%s@tcp($MYSQL_3306_HOST:$MYSQL_3306_PORT)/%s?charset=utf8&parseTime=true", dbUser, dbPassword, dbName)
}
4 changes: 2 additions & 2 deletions database/postgres/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package postgres
import (
"context"

"go.nhat.io/testcontainers-go-extra"
"go.nhat.io/testcontainers-extra"
)

// StartGenericContainer starts a new mysql container.
//
// Deprecated: Use go.nhat.io/testcontainers-go-registry/postgres.StartGenericContainer instead.
// Deprecated: Use go.nhat.io/testcontainers-registry/postgres.StartGenericContainer instead.
func StartGenericContainer(ctx context.Context, dbName, dbUser, dbPassword string, opts ...testcontainers.GenericContainerOption) (testcontainers.Container, error) {
r := Request(dbName, dbUser, dbPassword, opts...)

Expand Down
12 changes: 6 additions & 6 deletions database/postgres/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import (
"time"

_ "github.com/golang-migrate/migrate/v4/database/postgres" // Database driver
"go.nhat.io/testcontainers-go-extra"
"go.nhat.io/testcontainers-go-extra/wait"
"go.nhat.io/testcontainers-extra"
"go.nhat.io/testcontainers-extra/wait"

db "go.nhat.io/testcontainers-go-registry/database"
db "go.nhat.io/testcontainers-registry/database"
)

// Request creates a new request for starting a postgres server.
//
// Deprecated: Use go.nhat.io/testcontainers-go-registry/postgres.Request instead.
// Deprecated: Use go.nhat.io/testcontainers-registry/postgres.Request instead.
func Request(dbName, dbUser, dbPassword string, opts ...testcontainers.GenericContainerOption) testcontainers.StartGenericContainerRequest {
finalOpts := make([]testcontainers.GenericContainerOption, 1, len(opts)+1)
finalOpts[0] = testcontainers.PopulateHostPortEnv
Expand Down Expand Up @@ -42,14 +42,14 @@ func Request(dbName, dbUser, dbPassword string, opts ...testcontainers.GenericCo

// RunMigrations is option to run migrations.
//
// Deprecated: Use go.nhat.io/testcontainers-go-registry/postgres.RunMigrations instead.
// Deprecated: Use go.nhat.io/testcontainers-registry/postgres.RunMigrations instead.
func RunMigrations(migrationSource string) testcontainers.ContainerCallback {
return db.RunMigrations(migrationSource, DSN(`$POSTGRES_DB`, `$POSTGRES_USER`, `$POSTGRES_PASSWORD`))
}

// DSN returns the database dsn for connecting to server.
//
// Deprecated: Use go.nhat.io/testcontainers-go-registry/postgres.DSN instead.
// Deprecated: Use go.nhat.io/testcontainers-registry/postgres.DSN instead.
func DSN(dbName, dbUser, dbPassword string) string {
return fmt.Sprintf("postgres://%s:%s@$POSTGRES_5432_HOST:$POSTGRES_5432_PORT/%s?sslmode=disable&client_encoding=UTF8", dbUser, dbPassword, dbName)
}
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module go.nhat.io/testcontainers-go-registry
module go.nhat.io/testcontainers-registry

go 1.18

require (
github.com/golang-migrate/migrate/v4 v4.15.2
github.com/testcontainers/testcontainers-go v0.13.0
go.nhat.io/testcontainers-go-extra v0.4.0
go.nhat.io/testcontainers-extra v0.5.0
)

require (
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1157,8 +1157,8 @@ go.mongodb.org/mongo-driver v1.7.0/go.mod h1:Q4oFMbo1+MSNqICAdYMlC/zSTrwCogR4R8N
go.mongodb.org/mongo-driver v1.10.1 h1:NujsPveKwHaWuKUer/ceo9DzEe7HIj1SlJ6uvXZG0S4=
go.mongodb.org/mongo-driver v1.10.1/go.mod h1:z4XpeoU6w+9Vht+jAFyLgVrD+jGSQQe0+CBWFHNiHt8=
go.mozilla.org/pkcs7 v0.0.0-20200128120323-432b2356ecb1/go.mod h1:SNgMg+EgDFwmvSmLRTNKC5fegJjB7v23qTQ0XLGUNHk=
go.nhat.io/testcontainers-go-extra v0.4.0 h1:LJIkviVSO6mP82zqREhFMRuoUODqNvzT66X+GU8uNiY=
go.nhat.io/testcontainers-go-extra v0.4.0/go.mod h1:vJn/acYygoFnmR+r0eWdHSsOHIs38ItiKAwVQVi2OB0=
go.nhat.io/testcontainers-extra v0.5.0 h1:zOVezME+hNuRd26KmcZwcnSn1upKDn0AzzgBrCEcbaI=
go.nhat.io/testcontainers-extra v0.5.0/go.mod h1:68Y74GSXbiLGLkMifzTe6rVWV4EU+CU2akDcyqmNM0E=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
Expand Down

0 comments on commit ba5956e

Please sign in to comment.