stream

package
v0.10.4 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package stream exposes gocloud.dev/pubsub and side-loads various packages to register implementations such as kafka or in-memory. Please refer to specific documentation for each implementation.

This package is designed as one import to bring in extra dependencies without requiring multiple projects to know what imports are needed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KafkaSubscription

func KafkaSubscription(brokers []string, config *sarama.Config, group string, topics []string, opts *kafkapubsub.SubscriptionOptions) (*pubsub.Subscription, error)

KafkaSubscription creates a pubsub.Subscription that joins group, receiving messages from topics. It uses a sarama.ConsumerGroup to receive messages. Consumer options can be configured in the Consumer section of the sarama.Config: https://godoc.org/github.com/Shopify/sarama#Config.

func KafkaTopic

func KafkaTopic(brokers []string, config *sarama.Config, topicName string, opts *kafkapubsub.TopicOptions) (*pubsub.Topic, error)

KafkaTopic creates a pubsub.Topic that sends to a Kafka topic. It uses a sarama.SyncProducer to send messages. Producer options can be configured in the Producer section of the sarama.Config: https://godoc.org/github.com/Shopify/sarama#Config.

func Subscription

func Subscription(ctx context.Context, url string) (*pubsub.Subscription, error)

func Topic

func Topic(ctx context.Context, url string) (*pubsub.Topic, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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