Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithAcceptEULA ¶
func WithAcceptEULA() testcontainers.CustomizeRequestOption
func WithPassword ¶
func WithPassword(password string) testcontainers.CustomizeRequestOption
Types ¶
type MSSQLServerContainer ¶
type MSSQLServerContainer struct { testcontainers.Container // contains filtered or unexported fields }
MSSQLServerContainer represents the MSSQLServer container type used in the module
func RunContainer ¶
func RunContainer(ctx context.Context, opts ...testcontainers.ContainerCustomizer) (*MSSQLServerContainer, error)
RunContainer creates an instance of the MSSQLServer container type
Example ¶
// runMSSQLServerContainer { ctx := context.Background() password := "SuperStrong@Passw0rd" mssqlContainer, err := mssql.RunContainer(ctx, testcontainers.WithImage("mcr.microsoft.com/mssql/server:2022-RTM-GDR1-ubuntu-20.04"), mssql.WithAcceptEULA(), mssql.WithPassword(password), ) if err != nil { log.Fatalf("failed to start container: %s", err) } // Clean up the container defer func() { if err := mssqlContainer.Terminate(ctx); err != nil { log.Fatalf("failed to terminate container: %s", err) } }() // } state, err := mssqlContainer.State(ctx) if err != nil { log.Fatalf("failed to get container state: %s", err) // nolint:gocritic } fmt.Println(state.Running)
Output: true
func (*MSSQLServerContainer) ConnectionString ¶
Click to show internal directories.
Click to hide internal directories.