Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ConsumerDefaults = Consumer{ Logger: *zap.NewNop(), HandleInterrupt: true, Name: "consumer", AllowEnvironmentBasedConfiguration: true, }
ConsumerDefaults holds the default values for Consumer.
var ProducerDefaults = Producer{ Logger: *zap.NewNop(), HandleInterrupt: true, Name: "producer", AllowEnvironmentBasedConfiguration: true, }
ProducerDefaults holds the default values for Producer.
Functions ¶
This section is empty.
Types ¶
type Consumer ¶
type Consumer struct { Inmem inmemconfig.Consumer Kafka kafkaconfig.Consumer Pubsub pubsubconfig.Consumer Standardstream standardstreamconfig.Consumer // Logger is the configurable logger instance to log messages. If left // undefined, a no-op logger will be used. Logger zap.Logger `ignored:"true"` // HandleInterrupt determines whether the consumer should close itself // gracefully when an interrupt signal (^C) is received. This defaults to true // to increase first-time ease-of-use, but if the application wants to handle // these signals manually, this flag disables the automated implementation. HandleInterrupt bool `ignored:"true"` // Name is the name of the current processor. It is currently only used to // determine the prefix for environment-variable based configuration values. // For example, if Name is set to `MyProcessor`, then all environment // variable-based configurations need to start with `MYPROCESSOR_`. If no name // is set, then the prefix is "consumer" is used, so you prepend all // environment variables with "CONSUMER_. Name string `ignored:"true"` // AllowEnvironmentBasedConfiguration allows you to disable configuring the // stream client based on predefined environment variables. This is enabled by // default, but can be disabled if you want full control over the behavior of // the stream client without any outside influence. AllowEnvironmentBasedConfiguration bool `ignored:"true"` }
Consumer contains the configuration for all the different consumer that implement the stream.Consumer interface. When a consumer is instantiated, these options can be passed into the new consumer to determine its behavior. If the consumer only has to support a single implementation of the interface, then all other configuration values can be ignored.
func NewConsumer ¶
NewConsumer returns a new Consumer configuration struct, containing the values passed into the function. If any error occurs during configuration validation, an error is returned as the second argument.
func TestNewConsumer ¶
TestNewConsumer returns a new consumer configuration struct, optionally with the default values removed.
type Producer ¶
type Producer struct { Inmem inmemconfig.Producer Kafka kafkaconfig.Producer Pubsub pubsubconfig.Producer Standardstream standardstreamconfig.Producer // Logger is the configurable logger instance to log messages. If left // undefined, a no-op logger will be used. Logger zap.Logger `ignored:"true"` // HandleInterrupt determines whether the producer should close itself // gracefully when an interrupt signal (^C) is received. This defaults to true // to increase first-time ease-of-use, but if the application wants to handle // these signals manually, this flag disables the automated implementation. HandleInterrupt bool `ignored:"true"` // Name is the name of the current processor. It is currently only used to // determine the prefix for environment-variable based configuration values. // For example, if Name is set to `MyProcessor`, then all environment // variable-based configurations need to start with `MYPROCESSOR_`.If no name // is set, then the prefix is "producer" is used, so you prepend all // environment variables with "PRODUCER_. Name string `ignored:"true"` // AllowEnvironmentBasedConfiguration allows you to disable configuring the // stream client based on predefined environment variables. This is enabled by // default, but can be disabled if you want full control over the behavior of // the stream client without any outside influence. AllowEnvironmentBasedConfiguration bool `ignored:"true"` }
Producer contains the configuration for all the different consumer that implement the stream.Producer interface. When a producer is instantiated, these options can be passed into the new producer to determine its behavior. If the producer only has to support a single implementation of the interface, then all other configuration values can be ignored.
func NewProducer ¶
NewProducer returns a new Producer configuration struct, containing the values passed into the function. If any error occurs during configuration validation, an error is returned as the second argument.
func TestNewProducer ¶
TestNewProducer returns a new producer configuration struct, optionally with the default values removed.