kafka

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "kafka"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Enable  bool   `env:"KAFKA_ENABLE" default:"false" yaml:"enable"`
	Brokers string `env:"KAFKA_BROKERS" default:"localhost:9092" yaml:"brokers"`
}

type Meta

type Meta struct {
	ID        string    `json:"id" yaml:"id"`
	Name      string    `json:"name" yaml:"name"`
	CreatedAt time.Time `json:"created_at" yaml:"created_at"`
	Version   string    `json:"version" yaml:"version"`
}

func NewMeta

func NewMeta(name string, version string) Meta

type MetricsWriter

type MetricsWriter interface {
	AddCounter(name string, count float64, help string)
}

type Plugin

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

func New

func New() *Plugin

func (*Plugin) Boot

func (p *Plugin) Boot(conf interface{}, dependencies ...interface{}) plugins.Plugin

func (*Plugin) Close

func (p *Plugin) Close() error

func (*Plugin) EnableMetrics

func (p *Plugin) EnableMetrics(metrics MetricsWriter)

func (*Plugin) IsEnabled

func (p *Plugin) IsEnabled() bool

func (*Plugin) Name

func (p *Plugin) Name() string

func (*Plugin) ReadFromTopic

func (p *Plugin) ReadFromTopic(topic string, consumerGroupID string, messageC chan kafka.Message)

func (*Plugin) Start

func (p *Plugin) Start() error

func (*Plugin) WriteToTopic

func (p *Plugin) WriteToTopic(topic string, key string, value string) error

Jump to

Keyboard shortcuts

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