Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MongoDBContainer ¶
type MongoDBContainer struct {
Container *mongodb.MongoDBContainer
Client *mongo.Client
ConnectionString string
}
MongoDBContainer wraps the testcontainers MongoDB container with a client.
func StartMongoDBContainer ¶
func StartMongoDBContainer(ctx context.Context, opts ...MongoDBContainerOption) (*MongoDBContainer, error)
StartMongoDBContainer starts a MongoDB container and returns a wrapper with a connected client.
type MongoDBContainerOption ¶
type MongoDBContainerOption func(*mongoDBContainerOptions)
MongoDBContainerOption configures the MongoDB container.
func WithImage ¶
func WithImage(image string) MongoDBContainerOption
WithImage sets the MongoDB image to use.
func WithReplicaSet ¶
func WithReplicaSet(name string) MongoDBContainerOption
WithReplicaSet enables replica set with the given name.
type SchemaRegistryContainer ¶
type SchemaRegistryContainer struct {
Container testcontainers.Container
URL string
}
SchemaRegistryContainer wraps the testcontainers Schema Registry container.
func StartSchemaRegistryContainer ¶
func StartSchemaRegistryContainer(ctx context.Context, opts ...SchemaRegistryOption) (*SchemaRegistryContainer, error)
StartSchemaRegistryContainer starts a Schema Registry container with an embedded Kafka. This uses Redpanda which includes both Kafka and Schema Registry in one container.
func (*SchemaRegistryContainer) KafkaBroker ¶
func (s *SchemaRegistryContainer) KafkaBroker(ctx context.Context) (string, error)
KafkaBroker returns the Kafka broker address (useful if you need real Kafka too).
type SchemaRegistryOption ¶
type SchemaRegistryOption func(*schemaRegistryOptions)
SchemaRegistryOption configures the Schema Registry container.
func WithSchemaRegistryImage ¶
func WithSchemaRegistryImage(image string) SchemaRegistryOption
WithSchemaRegistryImage sets the Schema Registry image to use.