Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventBusConsumer ¶
type EventBusConsumer interface {
SubscribeToTopic(chan<- *lib.BuildEvent, <-chan struct{}, gocql.UUID) error
}
EventBusConsumer describes an object cabable of subscribing to events somewhere
type EventBusManager ¶
type EventBusManager interface { EventBusProducer EventBusConsumer }
EventBusManager describes an object that can publish and subscribe to events somewhere
type EventBusProducer ¶
type EventBusProducer interface {
PublishEvent(*lib.BuildEvent) error
}
EventBusProducer describes an object capable of publishing events somewhere
type KafkaManager ¶
type KafkaManager struct {
// contains filtered or unexported fields
}
KafkaManager handles sending event messages to the configured Kafka topic
func NewKafkaManager ¶
func NewKafkaManager(brokers []string, topic string, maxsends uint, mc metrics.MetricsCollector, logger *log.Logger) (*KafkaManager, error)
NewKafkaManager returns a new Kafka manager object
func (*KafkaManager) PublishEvent ¶
func (kp *KafkaManager) PublishEvent(event *lib.BuildEvent) error
PublishEvent publishes a build event to the configured Kafka topic
func (*KafkaManager) SubscribeToTopic ¶
func (kp *KafkaManager) SubscribeToTopic(output chan<- *lib.BuildEvent, done <-chan struct{}, buildID gocql.UUID) error
SubscribeToTopic listens to the configured topic, filters by build_id and writes the resulting messages to output. When the subscribed build is finished output is closed. done is a signal from the caller to abort the stream subscription