logkafka

package module
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: MIT Imports: 5 Imported by: 3

README

logrus-kafka-hook

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewKafkaClient

func NewKafkaClient(addrs []string, kafkaOpts ...KafkaOptionFunc) (sarama.Client, error)

Types

type DynamicTopicsFunc added in v0.1.3

type DynamicTopicsFunc func(entry *logrus.Entry) []string

type HookFilter added in v0.1.1

type HookFilter func(entry *logrus.Entry) bool

type KafkaOptionFunc

type KafkaOptionFunc func(*sarama.Config)

func WithKafkaSASLEnable

func WithKafkaSASLEnable(enable bool) KafkaOptionFunc

func WithKafkaSASLHandshake

func WithKafkaSASLHandshake(enable bool) KafkaOptionFunc

func WithKafkaSASLMechanism

func WithKafkaSASLMechanism(mechanism sarama.SASLMechanism) KafkaOptionFunc

func WithKafkaSASLPassword

func WithKafkaSASLPassword(password string) KafkaOptionFunc

func WithKafkaSASLUser

func WithKafkaSASLUser(user string) KafkaOptionFunc

func WithKafkaTLSConfig

func WithKafkaTLSConfig(config *tls.Config) KafkaOptionFunc

func WithKafkaTLSEnable

func WithKafkaTLSEnable(enable bool) KafkaOptionFunc

type LogKafkaHook

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

func NewLogKafkaHook

func NewLogKafkaHook(addrs, topics []string, kafkaOpts []KafkaOptionFunc, opts ...LogKafkaHookOptionFunc) (*LogKafkaHook, error)

func NewLogKafkaHookFromClient

func NewLogKafkaHookFromClient(client sarama.Client, topics []string, opts ...LogKafkaHookOptionFunc) (*LogKafkaHook, error)

func (*LogKafkaHook) Fire

func (l *LogKafkaHook) Fire(entry *logrus.Entry) error

func (*LogKafkaHook) Levels

func (l *LogKafkaHook) Levels() []logrus.Level

type LogKafkaHookOptionFunc

type LogKafkaHookOptionFunc func(*LogKafkaHook)

func WithDynamicTopicsFunc added in v0.1.3

func WithDynamicTopicsFunc(f DynamicTopicsFunc) LogKafkaHookOptionFunc

func WithHookFilters added in v0.1.1

func WithHookFilters(filters ...HookFilter) LogKafkaHookOptionFunc

func WithHookKeyFormatter added in v0.1.1

func WithHookKeyFormatter(formatter logrus.Formatter) LogKafkaHookOptionFunc

func WithHookLevels added in v0.1.1

func WithHookLevels(levels []logrus.Level) LogKafkaHookOptionFunc

func WithHookMustHasFields added in v0.1.1

func WithHookMustHasFields(fields []string) LogKafkaHookOptionFunc

func WithHookMustNotHasFields added in v0.1.1

func WithHookMustNotHasFields(fields []string) LogKafkaHookOptionFunc

func WithHookValueFormatter added in v0.1.1

func WithHookValueFormatter(formatter logrus.Formatter) LogKafkaHookOptionFunc

Jump to

Keyboard shortcuts

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