pubsub

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultConsumerConfig

func DefaultConsumerConfig(brokers []string, consumerGroup string, topics []string) kafka.ReaderConfig

Types

type Balancer added in v0.2.0

type Balancer struct{}

func (Balancer) AssignGroups added in v0.2.0

func (r Balancer) AssignGroups(members []kafka.GroupMember, topicPartitions []kafka.Partition) kafka.GroupMemberAssignments

func (Balancer) ProtocolName added in v0.2.0

func (r Balancer) ProtocolName() string

func (Balancer) UserData added in v0.2.0

func (r Balancer) UserData() ([]byte, error)

type KafkaPublisher

type KafkaPublisher interface {
	Publish(ctx context.Context, messages ...kafka.Message) error
	PublishMetric(ctx context.Context, topic, measurement string, tags map[string]string, fields map[string]interface{}, tm time.Time) error
	Close() error
}

func NewKafkaPublisher

func NewKafkaPublisher(brokers []string) KafkaPublisher

type KafkaSubscriber

type KafkaSubscriber interface {
	Subscribe(ctx context.Context, onMessage OnKafkaMessage) error
	Close() error
}

func NewKafkaSubscriber

func NewKafkaSubscriber(config kafka.ReaderConfig) KafkaSubscriber

type OnKafkaMessage

type OnKafkaMessage func(message kafka.Message)

Jump to

Keyboard shortcuts

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