Documentation
¶
Index ¶
- func InstallMiddleware(handle ...ProducerHandler)
- type Consumer
- type ConsumerImpl
- func (c *ConsumerImpl) Booting(bootManager freedom.BootManager)
- func (c *ConsumerImpl) Close() error
- func (c *ConsumerImpl) Restart() error
- func (c *ConsumerImpl) SetProxyTimeout(timeout time.Duration)
- func (c *ConsumerImpl) SetRateLimit(rate int)
- func (c *ConsumerImpl) Start(addrs []string, groupID string, config *sarama.Config, proxyAddr string, ...)
- type Msg
- func (msg *Msg) GetExecution() error
- func (msg *Msg) GetHeader() map[string]interface{}
- func (msg *Msg) GetMessageKey() string
- func (msg *Msg) IsStopped() bool
- func (msg *Msg) Next()
- func (msg *Msg) Publish() error
- func (msg *Msg) SetHeader(head map[string]interface{}) *Msg
- func (msg *Msg) SetMessageKey(key string) *Msg
- func (msg *Msg) Stop() *Msg
- type Producer
- type ProducerHandler
- type ProducerImpl
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InstallMiddleware ¶ added in v1.8.4
func InstallMiddleware(handle ...ProducerHandler)
InstallMiddleware Install the middleware.. You can control the publishing of messages by installing middleware.
Types ¶
type Consumer ¶
type Consumer interface { // Start pass in the relevant address, configuration. Start(addrs []string, groupID string, config *sarama.Config, proxyAddr string, proxyH2C bool) // Restart the connection. Restart() error // Close the connection. Close() error // Set the limit flow per second. SetRateLimit(rate int) // Set the HTTP agent to time out. SetProxyTimeout(time.Duration) }
Consumer Kafka Consumer interface definition.
func GetConsumer ¶ added in v1.8.8
func GetConsumer() Consumer
GetConsumer Returns the Consumer instance.
type ConsumerImpl ¶ added in v1.8.8
ConsumerImpl Kafka Consumer implementation.
func (*ConsumerImpl) Booting ¶ added in v1.8.8
func (c *ConsumerImpl) Booting(bootManager freedom.BootManager)
Booting The method of overriding the component . The single-case component initiates a callback.
func (*ConsumerImpl) Close ¶ added in v1.8.8
func (c *ConsumerImpl) Close() error
Close the connection.
func (*ConsumerImpl) Restart ¶ added in v1.8.8
func (c *ConsumerImpl) Restart() error
Restart the connection.
func (*ConsumerImpl) SetProxyTimeout ¶ added in v1.8.9
func (c *ConsumerImpl) SetProxyTimeout(timeout time.Duration)
SetProxyTimeout Set the HTTP agent to time out.
func (*ConsumerImpl) SetRateLimit ¶ added in v1.8.9
func (c *ConsumerImpl) SetRateLimit(rate int)
SetRateLimit Set the limit flow per second.
type Msg ¶
Msg Kafka Message.
func (*Msg) GetExecution ¶ added in v1.8.4
GetExecution Get the results of the execution .
func (*Msg) GetMessageKey ¶ added in v1.8.4
GetMessageKey Get kafka key.
func (*Msg) Next ¶ added in v1.8.4
func (msg *Msg) Next()
Next Perform the next step, typically for the control of middleware.
func (*Msg) SetMessageKey ¶ added in v1.8.4
SetMessageKey Set kafka key.
type Producer ¶
type Producer interface { // Create a new message NewMsg(topic string, content []byte) *Msg // Start pass in the relevant address, configuration. Start(addrs []string, config *sarama.Config) // Restart the connection. Restart() error }
Producer The producer's interface definition.
func GetProducer ¶ added in v1.8.8
func GetProducer() Producer
GetProducer Gets an instance of the producer.
type ProducerHandler ¶ added in v1.8.4
type ProducerHandler func(*Msg)
ProducerHandler The function declaration of the Kafka Producer middleware..
type ProducerImpl ¶ added in v1.4.3
ProducerImpl The realization of the producer.
func (*ProducerImpl) Booting ¶ added in v1.4.3
func (pi *ProducerImpl) Booting(bootManager freedom.BootManager)
Booting The method of overriding the component . The single-case component initiates a callback.
func (*ProducerImpl) NewMsg ¶ added in v1.4.3
func (pi *ProducerImpl) NewMsg(topic string, content []byte) *Msg
NewMsg Create a new message.
func (*ProducerImpl) Restart ¶ added in v1.8.8
func (pi *ProducerImpl) Restart() error
Restart the connection.