kafka

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// OriginalTimestamp will store the timestamp of the message in the scheduler topic
	OriginalTimestamp = "scheduler-timestamp"
	// OriginalKey stores the original schedule key
	OriginalKey = "scheduler-key"
	// OriginalTopic stores the scheduler topic where it came from
	OriginalTopic = "scheduler-topic"
)

Variables

This section is empty.

Functions

func DefaultCollector

func DefaultCollector() prometheus.Collector

func DefaultSince

func DefaultSince() time.Time

Types

type Config

type Config struct {
	FilePath              string
	BootstrapServers      string
	HistoryTopic          string
	GroupID               string
	SessionTimeout        int
	SchedulesTopics       []string
	ScheduleGraceInterval uint
}

func DefaultConfig

func DefaultConfig() Config

func DefaultRunnerParams

func DefaultRunnerParams() (Config, time.Time, instrument.Collector)

func (Config) String

func (c Config) String() string

type EventHandler

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

func NewHandler

func NewHandler(kafkaConfiguration confluent.ConfigMap, bootstrapServers, historyTopic string) (EventHandler, error)

func (EventHandler) Close

func (k EventHandler) Close()

func (EventHandler) Handle

func (k EventHandler) Handle(event scheduler.Event)

func (EventHandler) String

func (k EventHandler) String() string

type HandlerOpaque

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

in the confluent go lib, in the delivery channel, the original timestamp and headers are not available, so we need to pass them through via the Opaque field

type Runner

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

func DefaultRunner

func DefaultRunner() *Runner

func NewRunner

func NewRunner(c Config, since time.Time, collector instrument.Collector) *Runner

func (Runner) Close

func (r Runner) Close() error

func (*Runner) Start

func (r *Runner) Start() error

Jump to

Keyboard shortcuts

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