Documentation ¶
Overview ¶
Package kafka https://github.com/Shopify/sarama/blob/master/examples/sasl_scram_client/scram_client.go
Index ¶
- Constants
- Variables
- type Config
- type Publisher
- 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 (b *Subscriber) Debug(l logger.Logger)
- func (s *Subscriber) Disconnect() error
- func (s *Subscriber) Setup(sarama.ConsumerGroupSession) error
- func (s *Subscriber) Sub(topic string, h bus.EventHandler) error
- type XDGSCRAMClient
Constants ¶
View Source
const ( MetaKafkaPartition = "kafka.partition" MetaKafkaKey = "kafka.key" MetaKafkaHeaders = "kafka.headers" )
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() } )
View Source
var ( // ErrNoBroker todo ErrNoBroker = errors.New("connect kafka error, no broker here") )
Functions ¶
This section is empty.
Types ¶
type Config ¶ added in v0.6.1
type Config struct {
// contains filtered or unexported fields
}
Config 配置
func (*Config) ValidatePublisherConfig ¶ added in v0.6.1
ValidatePublisherConfig todo
func (*Config) ValidateSubscriberConfig ¶ added in v0.6.1
ValidateSubscriberConfig todo
type Publisher ¶
type Publisher struct {
// contains filtered or unexported fields
}
Publisher kafka broker
type Subscriber ¶
type Subscriber struct {
// contains filtered or unexported fields
}
Subscriber kafka broker
func NewSubscriber ¶
func NewSubscriber(conf *Config) (*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 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.