kafka

package
v1.9.20 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2023 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

View Source
const (
	KAFKA = "kafka"
)

Variables

This section is empty.

Functions

func ConsumerGroup

func ConsumerGroup(groupId string, topics []string) *kafka.Reader

func Producer

func Producer(topic string) *kafka.Writer

Types

type Kafka

type Kafka struct {
	Brokers        []string       `toml:"brokers" json:"brokers" yaml:"brokers"  env:"KAFKA_BROKERS"`
	ScramAlgorithm ScramAlgorithm `toml:"scram_algorithm" json:"scram_algorithm" yaml:"scram_algorithm"  env:"KAFKA_SCRAM_ALGORITHM"`
	UserName       string         `toml:"username" json:"username" yaml:"username"  env:"KAFKA_USERNAME"`
	Password       string         `toml:"password" json:"password" yaml:"password"  env:"KAFKA_PASSWORD"`

	ioc.ObjectImpl
	// contains filtered or unexported fields
}

func (*Kafka) ConsumerGroup

func (k *Kafka) ConsumerGroup(groupId string, topics []string) *kafka.Reader

func (*Kafka) Init

func (k *Kafka) Init() error

func (*Kafka) Name

func (m *Kafka) Name() string

func (*Kafka) Producer

func (k *Kafka) Producer(topic string) *kafka.Writer

type ScramAlgorithm

type ScramAlgorithm string
const (
	SHA256 ScramAlgorithm = "SHA256"
	SHA512 ScramAlgorithm = "SHA512"
)

Jump to

Keyboard shortcuts

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