kaplex

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

README

kaplex

Wrapper around the segmentio kafka-go library to simplify usage

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(c *KafkaConfig)

func Read

func Read(topic string, f func(e Event))

func Send

func Send(event *Event) error

Types

type Event

type Event struct {
	ID     string `json:"id"`
	Source string `json:"source"`
	Type   string `json:"type"`
	Topic  string `json:"topic"`
	Data   []byte `json:"data"`
}

func NewEvent

func NewEvent(topic string) *Event

func (*Event) AsJson

func (e *Event) AsJson() []byte

type KafkaConfig

type KafkaConfig struct {
	Url           string `yaml:"url" env:"KAFKA_URL"`
	ConsumerGroup string `yaml:"consumerGroup" env:"KAFKA_CONSUMER_GROUP"`
}

Jump to

Keyboard shortcuts

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