Documentation
¶
Overview ¶
Package gropanda provides a Redpanda integration for groat-based tests. It leverages testcontainers-go to spin up Redpanda instances for integration testing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New[T any](options ...Option) integration.Bootstrap[T]
New creates a new Redpanda integration bootstrapper.
func WithEnableKafkaAuthorization ¶
func WithEnableKafkaAuthorization(cfg *config)
WithEnableKafkaAuthorization enables Kafka authorization for the Redpanda container.
func WithEnableSASL ¶
func WithEnableSASL(cfg *config)
WithEnableSASL enables SASL authentication for the Redpanda container.
func WithEnableSchemaRegistryHTTPBasicAuth ¶
func WithEnableSchemaRegistryHTTPBasicAuth(c *config)
WithEnableSchemaRegistryHTTPBasicAuth enables HTTP Basic Auth for the Schema Registry.
Types ¶
type Container ¶
type Container[T any] struct { // contains filtered or unexported fields }
Container represents a Redpanda integration container for testing. It provides Redpanda settings and manages its lifecycle during tests.
type Option ¶
type Option func(*config)
Option represents a configuration option for configuring the Redpanda container construction. Used to customize container behavior and specify dependency injection.
func WithInjectLabel ¶
func WithInjectLabel(label string) Option
WithInjectLabel sets the injection label for injection settings information in dependency structure by tag. For example when label is 'redpanda':
type Deps struct {
Config *gropanda.Settings `groat:"redpanda"`
}
func WithNameSpace ¶
func WithNameSpace(ns string) Option
WithNameSpace sets a namespace for the Redpanda integration.
func WithNewServiceAccount ¶
func WithNewServiceAccount(user, pass string) Option
WithNewServiceAccount adds a new service account to the Redpanda container.
func WithSuperusers ¶
func WithSuperusers(users ...string) Option
WithSuperusers adds superusers to the Redpanda container.
type PandaContainer ¶
type PandaContainer interface {
// KafkaSeedBroker returns the Kafka seed broker address.
KafkaSeedBroker(ctx context.Context) (string, error)
// AdminAPIAddress returns the Redpanda Admin API address.
AdminAPIAddress(ctx context.Context) (string, error)
// SchemaRegistryAddress returns the Redpanda Schema Registry address.
SchemaRegistryAddress(ctx context.Context) (string, error)
// HTTPProxyAddress returns the Redpanda HTTP Proxy address.
HTTPProxyAddress(ctx context.Context) (string, error)
// Terminate shuts down the container.
Terminate(ctx context.Context, opts ...testcontainers.TerminateOption) error
}
PandaContainer defines the interface for interacting with a Redpanda container.
type Settings ¶
type Settings struct {
// Brokers is a list of Kafka broker addresses.
Brokers []string
// Prefix is an optional prefix for resources created in Redpanda (e.g. topics).
Prefix string
// HTTPProxyAddress is the address of the Redpanda HTTP Proxy.
HTTPProxyAddress string
// AdminProxyAddress is the address of the Redpanda Admin API.
AdminProxyAddress string
// SchemaRegistryAddress is the address of the Redpanda Schema Registry.
SchemaRegistryAddress string
}
Settings contains Redpanda connection information and configuration.