Documentation ¶
Overview ¶
Package config contains the configuration structs and validators used in the project.
Index ¶
- func ConsumerStructLevelValidator(structLevel validator.StructLevel)
- func Validate(cfg *Config) error
- type Config
- type Consumer
- type JetstreamConsumerConfig
- type JetstreamConsumerSettings
- type KafkaConsumerConfig
- type KafkaConsumerSettings
- type KerberosConfig
- type PlainSASLConfig
- type PrometheusConfig
- type PubsubConsumerConfig
- type PubsubConsumerSettings
- type PulsarConsumerConfig
- type PulsarConsumerSettings
- type RunOptions
- type ServiceBusConsumerConfig
- type ServiceBusConsumerSettings
- type TLSConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConsumerStructLevelValidator ¶
func ConsumerStructLevelValidator(structLevel validator.StructLevel)
ConsumerStructLevelValidator is a custom validator which validates broker structure.
Types ¶
type Config ¶
type Config struct { Consumer Consumer `toml:"consumer"` RunOptions RunOptions }
type Consumer ¶
type Consumer struct { Type string `toml:"type" val:"oneof=kafka pubsub servicebus jetstream pulsar"` Kafka KafkaConsumerConfig `toml:"kafka"` Pubsub PubsubConsumerConfig `toml:"pubsub"` ServiceBus ServiceBusConsumerConfig `toml:"servicebus"` Jetstream JetstreamConsumerConfig `toml:"jetstream"` Pulsar PulsarConsumerConfig `toml:"pulsar"` }
type JetstreamConsumerConfig ¶
type JetstreamConsumerConfig struct { URL string `toml:"url"` Subject string `toml:"subject"` ConsumerName string `toml:"consumer_name"` Settings JetstreamConsumerSettings `toml:"settings"` }
func DefaultJetstream ¶
func DefaultJetstream() JetstreamConsumerConfig
type JetstreamConsumerSettings ¶
type JetstreamConsumerSettings struct {
BatchSize int `toml:"batch_size"`
}
type KafkaConsumerConfig ¶
type KafkaConsumerConfig struct { Address string `toml:"address"` TLSConfig TLSConfig `toml:"tls_config"` Topic string `toml:"topic"` GroupID string `toml:"group_id"` Kerberos KerberosConfig `toml:"kerberos"` PlainSASL PlainSASLConfig `toml:"plain_sasl"` Prometheus PrometheusConfig `toml:"prometheus"` Settings KafkaConsumerSettings `toml:"settings"` }
func DefaultKafka ¶
func DefaultKafka() KafkaConsumerConfig
type KafkaConsumerSettings ¶
type KerberosConfig ¶
type PlainSASLConfig ¶
type PrometheusConfig ¶
type PrometheusConfig struct { Enabled bool `toml:"enabled"` Namespace string `toml:"namespace"` Registerer prometheus.Registerer Gatherer prometheus.Gatherer }
type PubsubConsumerConfig ¶
type PubsubConsumerConfig struct { ProjectID string `toml:"project_id"` SubscriptionID string `toml:"subscription_id"` Settings PubsubConsumerSettings `toml:"settings"` }
func DefaultPubsub ¶
func DefaultPubsub() PubsubConsumerConfig
type PubsubConsumerSettings ¶
type PubsubConsumerSettings struct { MaxExtension time.Duration `toml:"max_extension"` MaxExtensionPeriod time.Duration `toml:"max_extension_period"` MaxOutstandingMessages int `toml:"max_outstanding_messages"` MaxOutstandingBytes int `toml:"max_outstanding_bytes"` NumGoroutines int `toml:"num_goroutines"` }
type PulsarConsumerConfig ¶
type PulsarConsumerConfig struct { ServiceURL string `toml:"service_url"` Topic string `toml:"topic"` Subscription string `toml:"subscription"` TLSConfig TLSConfig `toml:"tls_config"` Settings PulsarConsumerSettings `toml:"settings"` }
func DefaultPulsar ¶
func DefaultPulsar() PulsarConsumerConfig
type PulsarConsumerSettings ¶
type PulsarConsumerSettings struct { ConnectionTimeout time.Duration `toml:"connection_timeout"` OperationTimeout time.Duration `toml:"operation_timeout"` NackRedeliveryDelay time.Duration `toml:"nack_redelivery_delay"` MaxConnectionsPerBroker int `toml:"max_connections_per_broker"` SubscriptionType string `toml:"subscription_type"` ReceiverQueueSize int `toml:"receiver_queue_size"` MaxReconnectToBroker *uint `toml:"max_reconnect_to_broker"` TLSTrustCertsFilePath string `toml:"tls_trust_certs_file_path"` TLSAllowInsecureConnection bool `toml:"tls_allow_insecure_connection" ` }
type RunOptions ¶
type ServiceBusConsumerConfig ¶
type ServiceBusConsumerConfig struct { ConnectionString string `toml:"connection_string"` Topic string `toml:"topic"` Subscription string `toml:"subscription"` Settings ServiceBusConsumerSettings `toml:"settings"` }
func DefaultServiceBus ¶
func DefaultServiceBus() ServiceBusConsumerConfig
type ServiceBusConsumerSettings ¶
type ServiceBusConsumerSettings struct {
BatchSize int `toml:"batch_size"`
}
type TLSConfig ¶
type TLSConfig struct { Enabled bool `toml:"enabled"` ClientCertFile string `toml:"client_cert_file" val:"required_if=Enabled true,omitempty,file"` ClientKeyFile string `toml:"client_key_file" val:"required_if=Enabled true,omitempty,file"` CaCertFile string `toml:"ca_cert_file" val:"required_if=Enabled true,omitempty,file"` }
Click to show internal directories.
Click to hide internal directories.