brokerchaos

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigProvider

type ConfigProvider interface {
	GetActivePolicies() []config.Policy
	IsCommandIgnored(protocol string, cmd string) bool
}

type Evaluator

type Evaluator interface {
	Evaluate(ctx context.Context, msgCtx *MessageContext) (bool, time.Duration, error)
}

func NewEvaluator

func NewEvaluator(provider ConfigProvider) Evaluator

type KafkaConsumerMiddleware

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

func NewKafkaConsumerMiddleware

func NewKafkaConsumerMiddleware(eval Evaluator) *KafkaConsumerMiddleware

func (*KafkaConsumerMiddleware) Intercept

func (m *KafkaConsumerMiddleware) Intercept(ctx context.Context, msg *sarama.ConsumerMessage) (drop bool, err error)

type MessageContext

type MessageContext struct {
	Topic     string
	Protocol  ProtocolType
	Partition int32
	GetHeader func(key string) (string, bool)
}

type ProtocolType

type ProtocolType string
const (
	ProtocolKafka    ProtocolType = "kafka"
	ProtocolRabbitMQ ProtocolType = "rabbitmq"
)

type RabbitMQMiddleware

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

func NewRabbitMQMiddleware

func NewRabbitMQMiddleware(eval Evaluator) *RabbitMQMiddleware

func (*RabbitMQMiddleware) Intercept

func (m *RabbitMQMiddleware) Intercept(ctx context.Context, delivery *amqp.Delivery) (drop bool, err error)

Jump to

Keyboard shortcuts

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