kafka

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigEntity

type ConfigEntity struct {
	Tls      TLSEntity `json:"tls" bson:"tls" yaml:"tls" mapstructure:"tls"`
	Account  string    `json:"account" bson:"account" yaml:"account" mapstructure:"account"`
	Password string    `json:"password" bson:"password" yaml:"password" mapstructure:"password"`
	Address  []string  `json:"address" yaml:"address" mapstructure:"address"`
	MaxRetry uint      `json:"max_retry" yaml:"max_retry" mapstructure:"max_retry"`
}

type ConsumptionEntity

type ConsumptionEntity struct {
	Topic   string
	Handle  func(read *kafka.Reader, message kafka.Message)
	GroupId string
}

type CoreEntity

type CoreEntity struct {
	// contains filtered or unexported fields
}

func New

func New(logger *zap.Logger, config *ConfigEntity) (*CoreEntity, error)

func (*CoreEntity) Cli

func (core *CoreEntity) Cli() *kafka.Client

func (*CoreEntity) Conn

func (core *CoreEntity) Conn() *kafka.Dialer

func (*CoreEntity) Consumption

func (core *CoreEntity) Consumption(config *ConsumptionEntity)

func (*CoreEntity) InitTopics

func (core *CoreEntity) InitTopics(topics []string)

func (*CoreEntity) Production

func (core *CoreEntity) Production(topic string, message []kafka.Message)

func (*CoreEntity) Topic

func (core *CoreEntity) Topic(key string) *kafka.Writer

func (*CoreEntity) Uninstall

func (core *CoreEntity) Uninstall()

type TLSEntity

type TLSEntity struct {
	CaCert        string `json:"ca_cert" bson:"ca_cert" yaml:"ca_cert" mapstructure:"ca_cert"`
	ClientCert    string `json:"client_cert" bson:"client_cert" yaml:"client_cert" mapstructure:"client_cert"`
	ClientCertKey string `json:"client_cert_key" bson:"client_cert_key" yaml:"client_cert_key" mapstructure:"client_cert_key"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳