Documentation
¶
Index ¶
- type ExporterLocator
- type ExporterLocatorOption
- type ExporterTemplate
- type KafkaBase
- func (b *KafkaBase) Close()
- func (b *KafkaBase) InitProducer(cfg KafkaBaseConfig) error
- func (b *KafkaBase) Produce(data []byte) error
- func (b *KafkaBase) ResolveBaseConfig(settings map[string]interface{}) (KafkaBaseConfig, error)
- func (b *KafkaBase) ValidateBaseConfig(settings map[string]interface{}) error
- type KafkaBaseConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExporterLocator ¶
type ExporterLocator struct {
// contains filtered or unexported fields
}
func NewExporterLocator ¶
func NewExporterLocator(opts ...ExporterLocatorOption) *ExporterLocator
func (*ExporterLocator) Build ¶
func (l *ExporterLocator) Build(cfg telemetrydomain.ExporterConfig) (appmetrics.Exporter, error)
func (*ExporterLocator) Validate ¶
func (l *ExporterLocator) Validate(cfg telemetrydomain.ExporterConfig) error
type ExporterLocatorOption ¶
type ExporterLocatorOption func(*ExporterLocator)
func WithExporter ¶
func WithExporter(name string, template ExporterTemplate) ExporterLocatorOption
type ExporterTemplate ¶
type KafkaBase ¶
type KafkaBase struct {
EnvCfg config.KafkaConfig
Logger *slog.Logger
Producer *kafka.Producer
Topic string
}
func NewKafkaBase ¶
func NewKafkaBase(logger *slog.Logger, envCfg config.KafkaConfig) KafkaBase
func (*KafkaBase) InitProducer ¶
func (b *KafkaBase) InitProducer(cfg KafkaBaseConfig) error
InitProducer creates the producer and starts the asynchronous delivery-report handler. Topic creation runs in the background so an unreachable broker never blocks startup.
func (*KafkaBase) Produce ¶
Produce enqueues a message without blocking on delivery. Delivery outcomes are reported asynchronously through handleDeliveryReports.
func (*KafkaBase) ResolveBaseConfig ¶
func (b *KafkaBase) ResolveBaseConfig(settings map[string]interface{}) (KafkaBaseConfig, error)
func (*KafkaBase) ValidateBaseConfig ¶
type KafkaBaseConfig ¶
Click to show internal directories.
Click to hide internal directories.