kafka

package
v0.0.0-...-1225d9a Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppName = "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"`
	Debug          bool           `toml:"debug" json:"debug" yaml:"debug"  env:"KAFKA_DEBUG"`

	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