Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InbucketContainer ¶
type InbucketContainer struct {
testcontainers.Container
}
InbucketContainer represents the Inbucket container type used in the module
func RunContainer ¶
func RunContainer(ctx context.Context, opts ...testcontainers.ContainerCustomizer) (*InbucketContainer, error)
RunContainer creates an instance of the Inbucket container type
Example ¶
// runInbucketContainer { ctx := context.Background() inbucketContainer, err := inbucket.RunContainer(ctx, testcontainers.WithImage("inbucket/inbucket:sha-2d409bb")) if err != nil { log.Fatalf("failed to start container: %s", err) } // Clean up the container defer func() { if err := inbucketContainer.Terminate(ctx); err != nil { log.Fatalf("failed to terminate container: %s", err) } }() // } state, err := inbucketContainer.State(ctx) if err != nil { log.Fatalf("failed to get container state: %s", err) // nolint:gocritic } fmt.Println(state.Running)
Output: true
func (*InbucketContainer) SmtpConnection ¶
func (c *InbucketContainer) SmtpConnection(ctx context.Context) (string, error)
SmtpConnection returns the connection string for the smtp server, using the default 2500 port, and obtaining the host and exposed port from the container.
func (*InbucketContainer) WebInterface ¶
func (c *InbucketContainer) WebInterface(ctx context.Context) (string, error)
WebInterface returns the connection string for the web interface server, using the default 9000 port, and obtaining the host and exposed port from the container.
Click to show internal directories.
Click to hide internal directories.