kafka

package
v2.0.44 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: MIT Imports: 7 Imported by: 5

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:"BROKERS"`
	ScramAlgorithm ScramAlgorithm `toml:"scram_algorithm" json:"scram_algorithm" yaml:"scram_algorithm"  env:"SCRAM_ALGORITHM"`
	UserName       string         `toml:"username" json:"username" yaml:"username"  env:"USERNAME"`
	Password       string         `toml:"password" json:"password" yaml:"password"  env:"PASSWORD"`
	Debug          bool           `toml:"debug" json:"debug" yaml:"debug"  env:"DEBUG"`

	ioc.ObjectImpl
	// contains filtered or unexported fields
}

func Get added in v2.0.8

func Get() *Kafka

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) Priority added in v2.0.10

func (i *Kafka) Priority() int

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