kafka

package
v0.0.0-...-5c69eea Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2020 License: MIT Imports: 9 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithAfterFailed

func WithAfterFailed(afterFailed AfterFailed) func(*Loadastic)

func WithAfterSend

func WithAfterSend(afterSend AfterSend) func(*Loadastic)

func WithBeforeSend

func WithBeforeSend(beforeSend BeforeSend) func(*Loadastic)

func WithFailedChecker

func WithFailedChecker(checker FailedChecker) func(*Loadastic)

func WithInitialWorkers

func WithInitialWorkers(initialWorkers uint) func(*Loadastic)

Types

type AfterFailed

type AfterFailed func(request RecordPayload, err error, id uint64, uuid string)

type AfterSend

type AfterSend func(request RecordPayload, response interface{}, id uint64, uuid string)

type BeforeSend

type BeforeSend func(request RecordPayload, tickerTimestamp time.Time, id uint64, uuid string)

type FailedChecker

type FailedChecker func(response interface{}) error

type KafkaSender

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

func (*KafkaSender) InitializeWorker

func (ks *KafkaSender) InitializeWorker() *KafkaWorker

func (*KafkaSender) Send

func (ks *KafkaSender) Send(worker *KafkaWorker, payload RecordPayload) (interface{}, error)

type KafkaWorker

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

type Loadastic

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

func NewLoadastic

func NewLoadastic(sender Sender, opts ...func(*Loadastic)) Loadastic

func (*Loadastic) ExecutePace

func (l *Loadastic) ExecutePace(requestFactory RequestFactory, pacer vegeta.Pacer, duration time.Duration)

func (*Loadastic) StartSteps

func (l *Loadastic) StartSteps(requestFactory RequestFactory, steps ...common.Step)

type RecordPayload

type RecordPayload []byte

type RequestFactory

type RequestFactory func(tickerTimestamp time.Time, id uint64, uuid string) RecordPayload

func RandomRequestFactory

func RandomRequestFactory(messageSize uint) RequestFactory

type Sender

type Sender interface {
	InitializeWorker() *KafkaWorker
	Send(worker *KafkaWorker, request RecordPayload) (interface{}, error)
}

func NewKafkaSender

func NewKafkaSender(bootstrapUrl string, topicName string) (Sender, error)

func NewKafkaSenderFromSaramaClient

func NewKafkaSenderFromSaramaClient(client sarama.Client, topicName string) (Sender, error)

Jump to

Keyboard shortcuts

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