kafka

package
v0.0.0-...-39b592d Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	Id     string
	Buffer []byte
	Sent   uint64
}

type FileIdGenerator

type FileIdGenerator struct{}

func (*FileIdGenerator) Generate

func (g *FileIdGenerator) Generate() string

type IdGenerator

type IdGenerator interface {
	Generate() string
}

type KafkaWriter

type KafkaWriter interface {
	WriteMessages(ctx context.Context, msgs ...kafka.Message) error
	Close() error
}

type Plugin

type Plugin struct {
	Writer      KafkaWriter
	IdGenerator IdGenerator
	Topic       string
	MessageSize int
	CloseChan   chan bool
	FileSize    uint64
	CurrentFile *File
}

func NewPlugin

func NewPlugin(config *config.KafkaPluginConfig) (*Plugin, error)

func (*Plugin) Start

func (p *Plugin) Start(ctx context.Context) chan<- string

Start produces Kafka messages containing data that is written to the returned channel

Jump to

Keyboard shortcuts

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