Documentation ¶
Overview ¶
Package kafka https://github.com/Shopify/sarama/blob/master/examples/sasl_scram_client/scram_client.go
Index ¶
- Variables
- type Publisher
- type PublisherConfig
- type Subscriber
- func (s *Subscriber) Cleanup(sarama.ConsumerGroupSession) error
- func (s *Subscriber) Connect() error
- func (s *Subscriber) ConsumeClaim(session sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error
- func (s *Subscriber) Disconnect() error
- func (s *Subscriber) Setup(sarama.ConsumerGroupSession) error
- func (s *Subscriber) Sub(topic string, h bus.EventHandler) error
- type SubscriberConfig
- type XDGSCRAMClient
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // SHA256 todo SHA256 scram.HashGeneratorFcn = func() hash.Hash { return sha256.New() } // SHA512 todo SHA512 scram.HashGeneratorFcn = func() hash.Hash { return sha512.New() } )
Functions ¶
This section is empty.
Types ¶
type Publisher ¶
type Publisher struct {
// contains filtered or unexported fields
}
Publisher kafka broker
func NewPublisher ¶
func NewPublisher(conf *PublisherConfig) (*Publisher, error)
NewPublisher kafka broker
type PublisherConfig ¶
type PublisherConfig struct { BulkMaxSize int `json:"bulk_max_size"` PublishTimeout time.Duration `json:"publish_timeout" ` BulkFlushFrequency time.Duration `json:"bulk_flush_frequency"` Partitioner string `json:"partitioner"` Compression string `json:"compression"` CompressionLevel int `json:"compression_level"` MaxRetries int `json:"max_retries"` MaxMessageBytes *int `json:"max_message_bytes"` RequiredACKs *int `json:"required_acks"` // contains filtered or unexported fields }
PublisherConfig todo
func DefaultPublisherConfig ¶
func DefaultPublisherConfig() *PublisherConfig
DefaultPublisherConfig 默认配置
type Subscriber ¶
type Subscriber struct {
// contains filtered or unexported fields
}
Subscriber kafka broker
func NewSubscriber ¶
func NewSubscriber(conf *SubscriberConfig) (*Subscriber, error)
NewSubscriber kafka broker
func (*Subscriber) Cleanup ¶
func (s *Subscriber) Cleanup(sarama.ConsumerGroupSession) error
Cleanup is run at the end of a session, once all ConsumeClaim goroutines have exited
func (*Subscriber) ConsumeClaim ¶
func (s *Subscriber) ConsumeClaim(session sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error
ConsumeClaim must start a consumer loop of ConsumerGroupClaim's Messages().
func (*Subscriber) Setup ¶
func (s *Subscriber) Setup(sarama.ConsumerGroupSession) error
Setup is run at the beginning of a new session, before ConsumeClaim
type SubscriberConfig ¶
type SubscriberConfig struct { GroupID string `json:"group_id,omitempty"` Offset string `json:"offset,omitempty"` BalanceStrategy string `json:"balance_strategy,omitempty"` // contains filtered or unexported fields }
SubscriberConfig todo
func DefaultSubscriberConfig ¶
func DefaultSubscriberConfig() *SubscriberConfig
DefaultSubscriberConfig 默认配置
type XDGSCRAMClient ¶
type XDGSCRAMClient struct { *scram.Client *scram.ClientConversation scram.HashGeneratorFcn }
XDGSCRAMClient todo
func (*XDGSCRAMClient) Begin ¶
func (x *XDGSCRAMClient) Begin(userName, password, authzID string) (err error)
Begin todo
Click to show internal directories.
Click to hide internal directories.