pubsub

package
v0.0.0-...-9bb4683 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func CreateKafkaPublisher

func CreateKafkaPublisher(kafkaDSN string) (sarama.SyncProducer, error)

func CreateKafkaSubscriber

func CreateKafkaSubscriber(kafkaDSN string, group string) (sarama.ConsumerGroup, error)

Types

type GroupConsumer

type GroupConsumer struct {
	Ready chan bool
	// contains filtered or unexported fields
}

func NewGroupConsumer

func NewGroupConsumer(client sarama.ConsumerGroup, newFunc NewGroupTaskFunc) *GroupConsumer

func (*GroupConsumer) Cleanup

func (consumer *GroupConsumer) Cleanup(session sarama.ConsumerGroupSession) error

Cleanup is run at the end of a session, once all ConsumeClaim goroutines have exited

func (*GroupConsumer) ConsumeClaim

func (consumer *GroupConsumer) ConsumeClaim(session sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error

ConsumeClaim must start a consumer loop of ConsumerGroupClaim's Messages().

func (*GroupConsumer) Output

func (consumer *GroupConsumer) Output() <-chan GroupTask

func (*GroupConsumer) Setup

func (consumer *GroupConsumer) Setup(session sarama.ConsumerGroupSession) error

Setup is run at the beginning of a new session, before ConsumeClaim

func (*GroupConsumer) StartConsume

func (consumer *GroupConsumer) StartConsume(gctx context.Context, allTopic string, consumerCount int) error

func (*GroupConsumer) StopConsume

func (consumer *GroupConsumer) StopConsume() error

type GroupTask

type GroupTask interface {
	Finish()
	Wait()
}

type Message

type Message struct {
	Lag int64
	*sarama.ConsumerMessage
}

type NewGroupTaskFunc

type NewGroupTaskFunc func(*Message) (GroupTask, error)

type XDGSCRAMClient

type XDGSCRAMClient struct {
	*scram.Client
	*scram.ClientConversation
	scram.HashGeneratorFcn
}

func (*XDGSCRAMClient) Begin

func (x *XDGSCRAMClient) Begin(userName, password, authzID string) (err error)

func (*XDGSCRAMClient) Done

func (x *XDGSCRAMClient) Done() bool

func (*XDGSCRAMClient) Step

func (x *XDGSCRAMClient) Step(challenge string) (response string, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL