Documentation ¶
Index ¶
Constants ¶
View Source
const ( NORMAL = 0 CLOSED = 1 )
Variables ¶
This section is empty.
Functions ¶
func DefaultSaramaConfig ¶
func New ¶
func New(producerOpt ProducerOption, opts ...Option) (easypubsub.Publisher, error)
Types ¶
type MarshalMsgFunc ¶
type MarshalMsgFunc func(topic string, msg *easypubsub.Message) (*sarama.ProducerMessage, error)
type Option ¶
type Option func(o *options)
func WithLogger ¶
func WithLogger(logger easypubsub.Logger) Option
func WithMarshalMsgFunc ¶
func WithMarshalMsgFunc(marshalMsgFunc MarshalMsgFunc) Option
type ProducerOption ¶
type ProducerOption func(o *producerOptions)
func AsyncProducer ¶
func AsyncProducer(brokers []string, config *sarama.Config) ProducerOption
func SyncProducer ¶
func SyncProducer(brokers []string, config *sarama.Config) ProducerOption
type PublishResult ¶
type Publisher ¶
type Publisher struct {
// contains filtered or unexported fields
}
func (*Publisher) Publish ¶
func (pub *Publisher) Publish(topic string, msg *easypubsub.Message) (result *easypubsub.PublishResult)
Click to show internal directories.
Click to hide internal directories.