outputs

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Console

type Console struct {
}

Console outputs tweets json to console

func (*Console) Init

func (c *Console) Init() error

Init initializes console output

func (*Console) Start

func (c *Console) Start(tweetChannel chan *twitter.Tweet)

Start starts the console output listening to a channel of tweets

func (*Console) Stop

func (c *Console) Stop()

Stop prints a final message before exiting

type Kafka

type Kafka struct {
	Config interface{}
	// contains filtered or unexported fields
}

Kafka sends tweet to Kafka

func (*Kafka) Init

func (k *Kafka) Init() error

Init initializes an async Kafka producer

func (*Kafka) Start

func (k *Kafka) Start(tweetChannel chan *twitter.Tweet)

Start starts the output to Kafka

func (*Kafka) Stop

func (k *Kafka) Stop()

Stop closes the Kafka producer on interrupt

type Output

type Output interface {
	Init() error
	Start(chan *twitter.Tweet)
	Stop()
}

Output defines an output

func InitializeOutput

func InitializeOutput(outputName string, outputConfig interface{},
	tweets chan *twitter.Tweet) (Output, error)

InitializeOutput initializes and starts the output worker

Jump to

Keyboard shortcuts

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