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 ¶
- func KafkaSubscription(brokers []string, config *sarama.Config, group string, topics []string, ...) (*pubsub.Subscription, error)
- func KafkaTopic(brokers []string, config *sarama.Config, topicName string, ...) (*pubsub.Topic, error)
- func Subscription(ctx context.Context, url string) (*pubsub.Subscription, error)
- func Topic(ctx context.Context, url string) (*pubsub.Topic, error)
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 ¶
Types ¶
This section is empty.