Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithDisableTelemetry ¶
func WithDisableTelemetry() testcontainers.CustomizeRequestOption
WithDisableTelemetry - DynamoDB local will not send any telemetry
func WithSharedDB ¶
func WithSharedDB() testcontainers.CustomizeRequestOption
WithSharedDB allows container reuse between successive runs. Data will be persisted
Types ¶
type DynamoDBContainer ¶
type DynamoDBContainer struct {
testcontainers.Container
}
DynamoDBContainer represents the DynamoDB container type used in the module
func Run ¶
func Run(ctx context.Context, img string, opts ...testcontainers.ContainerCustomizer) (*DynamoDBContainer, error)
Run creates an instance of the DynamoDB container type
Example ¶
// runDynamoDBContainer { ctx := context.Background() ctr, err := tcdynamodb.Run(ctx, "amazon/dynamodb-local:2.2.1") defer func() { if err := testcontainers.TerminateContainer(ctr); err != nil { log.Printf("failed to terminate container: %s", err) } }() if err != nil { log.Printf("failed to run dynamodb container: %s", err) return } // } state, err := ctr.State(ctx) if err != nil { log.Printf("failed to get container state: %s", err) return } fmt.Println(state.Running)
Output: true
func (*DynamoDBContainer) ConnectionString ¶
func (c *DynamoDBContainer) ConnectionString(ctx context.Context) (string, error)
ConnectionString returns DynamoDB local endpoint host and port in <host>:<port> format
Click to show internal directories.
Click to hide internal directories.