library

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2014 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MAX_UDP_MESSAGE_SIZE = 1024
)

Variables

View Source
var BlockDefs = map[string]*blocks.BlockDef{}
View Source
var Blocks = map[string]func() blocks.BlockInterface{
	"count":           NewCount,
	"toggle":          NewToggle,
	"movingaverage":   NewMovingAverage,
	"ticker":          NewTicker,
	"fromnsq":         NewFromNSQ,
	"fromhttpstream":  NewFromHTTPStream,
	"fromsqs":         NewFromSQS,
	"frompost":        NewFromPost,
	"fromfile":        NewFromFile,
	"tonsq":           NewToNSQ,
	"toelasticsearch": NewToElasticsearch,
	"tofile":          NewToFile,
	"tolog":           NewToLog,
	"tobeanstalkd":    NewToBeanstalkd,
	"tomongodb":       NewToMongoDB,
	"mask":            NewMask,
	"filter":          NewFilter,
	"sync":            NewSync,
	"queue":           NewQueue,
	"unpack":          NewUnpack,
	"pack":            NewPack,
	"parsexml":        NewParseXML,
	"set":             NewSet,
	"cache":           NewCache,
	"join":            NewJoin,
	"gethttp":         NewGetHTTP,
	"gaussian":        NewGaussian,
	"zipf":            NewZipf,
	"poisson":         NewPoisson,
	"map":             NewMap,
	"histogram":       NewHistogram,
	"timeseries":      NewTimeseries,
	"fromwebsocket":   NewFromWebsocket,
	"tonsqmulti":      NewToNSQMulti,
	"fromudp":         NewFromUDP,
	"dedupe":          NewDeDupe,
}

Functions

func NewCache added in v0.2.3

func NewCache() blocks.BlockInterface

we need to build a simple factory so that streamtools can make new blocks of this kind

func NewCount

func NewCount() blocks.BlockInterface

a bit of boilerplate for streamtools

func NewDeDupe added in v0.2.3

func NewDeDupe() blocks.BlockInterface

we need to build a simple factory so that streamtools can make new blocks of this kind

func NewFilter

func NewFilter() blocks.BlockInterface

a bit of boilerplate for streamtools

func NewFromFile added in v0.2.3

func NewFromFile() blocks.BlockInterface

we need to build a simple factory so that streamtools can make new blocks of this kind

func NewFromHTTPStream

func NewFromHTTPStream() blocks.BlockInterface

a bit of boilerplate for streamtools

func NewFromNSQ

func NewFromNSQ() blocks.BlockInterface

a bit of boilerplate for streamtools

func NewFromPost

func NewFromPost() blocks.BlockInterface

we need to build a simple factory so that streamtools can make new blocks of this kind

func NewFromSQS

func NewFromSQS() blocks.BlockInterface

we need to build a simple factory so that streamtools can make new blocks of this kind

func NewFromUDP

func NewFromUDP() blocks.BlockInterface

we need to build a simple factory so that streamtools can make new blocks of this kind

func NewFromWebsocket

func NewFromWebsocket() blocks.BlockInterface

we need to build a simple factory so that streamtools can make new blocks of this kind

func NewGaussian

func NewGaussian() blocks.BlockInterface

we need to build a simple factory so that streamtools can make new blocks of this kind

func NewGetHTTP

func NewGetHTTP() blocks.BlockInterface

we need to build a simple factory so that streamtools can make new blocks of this kind

func NewHistogram

func NewHistogram() blocks.BlockInterface

we need to build a simple factory so that streamtools can make new blocks of this kind

func NewJoin

func NewJoin() blocks.BlockInterface

func NewListenerUDP

func NewListenerUDP(block blocks.BlockInterface, connectionString string, out chan []byte) (*listenerUDP, error)

func NewMap

func NewMap() blocks.BlockInterface

we need to build a simple factory so that streamtools can make new blocks of this kind

func NewMask

func NewMask() blocks.BlockInterface

a bit of boilerplate for streamtools

func NewMovingAverage

func NewMovingAverage() blocks.BlockInterface

we need to build a simple factory so that streamtools can make new blocks of this kind

func NewPack

func NewPack() blocks.BlockInterface

we need to build a simple factory so that streamtools can make new blocks of this kind

func NewParseXML added in v0.2.3

func NewParseXML() blocks.BlockInterface

we need to build a simple factory so that streamtools can make new blocks of this kind

func NewPoisson

func NewPoisson() blocks.BlockInterface

we need to build a simple factory so that streamtools can make new blocks of this kind

func NewPoissonSampler

func NewPoissonSampler(λ float64) func() int

func NewQueue added in v0.2.3

func NewQueue() blocks.BlockInterface

we need to build a simple factory so that streamtools can make new blocks of this kind

func NewSet

func NewSet() blocks.BlockInterface

we need to build a simple factory so that streamtools can make new blocks of this kind

func NewSkeleton

func NewSkeleton() blocks.BlockInterface

we need to build a simple factory so that streamtools can make new blocks of this kind

func NewSync

func NewSync() blocks.BlockInterface

we need to build a simple factory so that streamtools can make new blocks of this kind

func NewTicker

func NewTicker() blocks.BlockInterface

we need to build a simple factory so that streamtools can make new blocks of this kind

func NewTimeseries

func NewTimeseries() blocks.BlockInterface

we need to build a simple factory so that streamtools can make new blocks of this kind

func NewToBeanstalkd

func NewToBeanstalkd() blocks.BlockInterface

we need to build a simple factory so that streamtools can make new blocks of this kind

func NewToElasticsearch

func NewToElasticsearch() blocks.BlockInterface

we need to build a simple factory so that streamtools can make new blocks of this kind

func NewToFile

func NewToFile() blocks.BlockInterface

we need to build a simple factory so that streamtools can make new blocks of this kind

func NewToLog

func NewToLog() blocks.BlockInterface

we need to build a simple factory so that streamtools can make new blocks of this kind

func NewToMongoDB added in v0.2.3

func NewToMongoDB() blocks.BlockInterface

we need to build a simple factory so that streamtools can make new blocks of this kind

func NewToNSQ

func NewToNSQ() blocks.BlockInterface

a bit of boilerplate for streamtools

func NewToNSQMulti

func NewToNSQMulti() blocks.BlockInterface

a bit of boilerplate for streamtools

func NewToggle added in v0.2.3

func NewToggle() blocks.BlockInterface

a bit of boilerplate for streamtools

func NewUnpack

func NewUnpack() blocks.BlockInterface

we need to build a simple factory so that streamtools can make new blocks of this kind

func NewZipf

func NewZipf() blocks.BlockInterface

we need to build a simple factory so that streamtools can make new blocks of this kind

func Start

func Start()

Types

type Cache added in v0.2.3

type Cache struct {
	blocks.Block
	// contains filtered or unexported fields
}

specify those channels we're going to use to communicate with streamtools

func (*Cache) Run added in v0.2.3

func (b *Cache) Run()

Run is the block's main loop. Here we listen on the different channels we set up.

func (*Cache) Setup added in v0.2.3

func (b *Cache) Setup()

Cacheup is called once before running the block. We build up the channels and specify what kind of block this is.

type Count

type Count struct {
	blocks.Block
	// contains filtered or unexported fields
}

func (*Count) Run

func (b *Count) Run()

func (*Count) Setup

func (b *Count) Setup()

type DeDupe added in v0.2.3

type DeDupe struct {
	blocks.Block
	// contains filtered or unexported fields
}

specify those channels we're going to use to communicate with streamtools

func (*DeDupe) Run added in v0.2.3

func (b *DeDupe) Run()

Run is the block's main loop. Here we listen on the different channels we set up.

func (*DeDupe) Setup added in v0.2.3

func (b *DeDupe) Setup()

Setup is called once before running the block. We build up the channels and specify what kind of block this is.

type Filter

type Filter struct {
	blocks.Block
	// contains filtered or unexported fields
}

func (*Filter) Run

func (b *Filter) Run()

func (*Filter) Setup

func (b *Filter) Setup()

type FromFile added in v0.2.3

type FromFile struct {
	blocks.Block
	// contains filtered or unexported fields
}

specify those channels we're going to use to communicate with streamtools

func (*FromFile) Run added in v0.2.3

func (b *FromFile) Run()

Run is the block's main loop. Here we listen on the different channels we set up.

func (*FromFile) Setup added in v0.2.3

func (b *FromFile) Setup()

Setup is called once before running the block. We build up the channels and specify what kind of block this is.

type FromHTTPStream

type FromHTTPStream struct {
	blocks.Block
	// contains filtered or unexported fields
}

specify those channels we're going to use to communicate with streamtools

func (*FromHTTPStream) Run

func (b *FromHTTPStream) Run()

creates a persistent HTTP connection, emitting all messages from the stream into streamtools

func (*FromHTTPStream) Setup

func (b *FromHTTPStream) Setup()

type FromNSQ

type FromNSQ struct {
	blocks.Block
	// contains filtered or unexported fields
}

specify those channels we're going to use to communicate with streamtools

func (*FromNSQ) Run

func (b *FromNSQ) Run()

connects to an NSQ topic and emits each message into streamtools.

func (*FromNSQ) Setup

func (b *FromNSQ) Setup()

type FromPost

type FromPost struct {
	blocks.Block
	// contains filtered or unexported fields
}

specify those channels we're going to use to communicate with streamtools

func (*FromPost) Run

func (b *FromPost) Run()

Run is the block's main loop. Here we listen on the different channels we set up.

func (*FromPost) Setup

func (b *FromPost) Setup()

Setup is called once before running the block. We build up the channels and specify what kind of block this is.

type FromSQS

type FromSQS struct {
	blocks.Block
	// contains filtered or unexported fields
}

specify those channels we're going to use to communicate with streamtools

func (*FromSQS) Run

func (b *FromSQS) Run()

Run is the block's main loop. Here we listen on the different channels we set up.

func (*FromSQS) Setup

func (b *FromSQS) Setup()

Setup is called once before running the block. We build up the channels and specify what kind of block this is.

type FromUDP

type FromUDP struct {
	blocks.Block
	// contains filtered or unexported fields
}

specify those channels we're going to use to communicate with streamtools

func (*FromUDP) Run

func (u *FromUDP) Run()

Run is the block's main loop. Here we listen on the different channels we set up.

func (*FromUDP) Setup

func (u *FromUDP) Setup()

Setup is called once before running the block. We build up the channels and specify what kind of block this is.

type FromWebsocket

type FromWebsocket struct {
	blocks.Block
	// contains filtered or unexported fields
}

specify those channels we're going to use to communicate with streamtools

func (*FromWebsocket) Run

func (b *FromWebsocket) Run()

Run is the block's main loop. Here we listen on the different channels we set up.

func (*FromWebsocket) Setup

func (b *FromWebsocket) Setup()

Setup is called once before running the block. We build up the channels and specify what kind of block this is.

type Gaussian

type Gaussian struct {
	blocks.Block
	// contains filtered or unexported fields
}

specify those channels we're going to use to communicate with streamtools

func (*Gaussian) Run

func (b *Gaussian) Run()

Run is the block's main loop. Here we listen on the different channels we set up.

func (*Gaussian) Setup

func (b *Gaussian) Setup()

Setup is called once before running the block. We build up the channels and specify what kind of block this is.

type GetHTTP

type GetHTTP struct {
	blocks.Block
	// contains filtered or unexported fields
}

specify those channels we're going to use to communicate with streamtools

func (*GetHTTP) Run

func (b *GetHTTP) Run()

Run is the block's main loop. Here we listen on the different channels we set up.

func (*GetHTTP) Setup

func (b *GetHTTP) Setup()

Setup is called once before running the block. We build up the channels and specify what kind of block this is.

type Histogram

type Histogram struct {
	blocks.Block
	// contains filtered or unexported fields
}

specify those channels we're going to use to communicate with streamtools

func (*Histogram) Run

func (b *Histogram) Run()

Run is the block's main loop. Here we listen on the different channels we set up.

func (*Histogram) Setup

func (b *Histogram) Setup()

Setup is called once before running the block. We build up the channels and specify what kind of block this is.

type Join

type Join struct {
	blocks.Block
	// contains filtered or unexported fields
}

func (*Join) Run

func (b *Join) Run()

func (*Join) Setup

func (b *Join) Setup()

type Map

type Map struct {
	blocks.Block
	// contains filtered or unexported fields
}

specify those channels we're going to use to communicate with streamtools

func (*Map) Run

func (b *Map) Run()

Run is the block's main loop. Here we listen on the different channels we set up.

func (*Map) Setup

func (b *Map) Setup()

Setup is called once before running the block. We build up the channels and specify what kind of block this is.

type Mask

type Mask struct {
	blocks.Block
	// contains filtered or unexported fields
}

specify those channels we're going to use to communicate with streamtools

func (*Mask) Run

func (b *Mask) Run()

Mask modifies a JSON stream with an additive key filter. Mask uses the JSON object recieved through the rule channel to determine which keys should be included in the resulting object. An empty JSON object ({}) is used as the notation to include all values for a key.

For instance, if the JSON rule is:

{"a":{}, "b":{"d":{}},"x":{}}

And an incoming message looks like:

{"a":24, "b":{"c":"test", "d":[1,3,4]}, "f":5, "x":{"y":5, "z":10}}

The resulting object after the application of Mask would be:

{"a":24, "b":{"d":[1,3,4]}, "x":{"y":5, "z":10}}

func (*Mask) Setup

func (b *Mask) Setup()

type MovingAverage

type MovingAverage struct {
	blocks.Block
	// contains filtered or unexported fields
}

specify those channels we're going to use to communicate with streamtools

func (*MovingAverage) Run

func (b *MovingAverage) Run()

Run is the block's main loop. Here we listen on the different channels we set up.

func (*MovingAverage) Setup

func (b *MovingAverage) Setup()

Setup is called once before running the block. We build up the channels and specify what kind of block this is.

type PQMessage

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

type Pack

type Pack struct {
	blocks.Block
	// contains filtered or unexported fields
}

specify those channels we're going to use to communicate with streamtools

func (*Pack) Run

func (b *Pack) Run()

Run is the block's main loop. Here we listen on the different channels we set up.

func (*Pack) Setup

func (b *Pack) Setup()

Setup is called once before running the block. We build up the channels and specify what kind of block this is.

type ParseXML added in v0.2.3

type ParseXML struct {
	blocks.Block
	// contains filtered or unexported fields
}

specify those channels we're going to use to communicate with streamtools

func (*ParseXML) Run added in v0.2.3

func (b *ParseXML) Run()

Run is the block's main loop. Here we listen on the different channels we set up.

func (*ParseXML) Setup added in v0.2.3

func (b *ParseXML) Setup()

Setup is called once before running the block. We build up the channels and specify what kind of block this is.

type Poisson

type Poisson struct {
	blocks.Block
	// contains filtered or unexported fields
}

specify those channels we're going to use to communicate with streamtools

func (*Poisson) Run

func (b *Poisson) Run()

func (*Poisson) Setup

func (b *Poisson) Setup()

Setup is called once before running the block. We build up the channels and specify what kind of block this is.

type PriorityQueue

type PriorityQueue []*PQMessage

A PriorityQueue implements heap.Interface and holds Items.

func (PriorityQueue) Len

func (pq PriorityQueue) Len() int

func (PriorityQueue) Less

func (pq PriorityQueue) Less(i, j int) bool

func (*PriorityQueue) Peek added in v0.2.3

func (pq *PriorityQueue) Peek() interface{}

func (*PriorityQueue) PeekAndShift

func (pq *PriorityQueue) PeekAndShift(max time.Time, lag time.Duration) (interface{}, time.Duration)

func (*PriorityQueue) Pop

func (pq *PriorityQueue) Pop() interface{}

func (*PriorityQueue) Push

func (pq *PriorityQueue) Push(x interface{})

func (PriorityQueue) Swap

func (pq PriorityQueue) Swap(i, j int)

type Queue added in v0.2.3

type Queue struct {
	blocks.Block
	// contains filtered or unexported fields
}

specify those channels we're going to use to communicate with streamtools

func (*Queue) Run added in v0.2.3

func (b *Queue) Run()

Run is the block's main loop. Here we listen on the different channels we set up.

func (*Queue) Setup added in v0.2.3

func (b *Queue) Setup()

Setup is called once before running the block. We build up the channels and specify what kind of block this is.

type Set

type Set struct {
	blocks.Block
	// contains filtered or unexported fields
}

specify those channels we're going to use to communicate with streamtools

func (*Set) Run

func (b *Set) Run()

Run is the block's main loop. Here we listen on the different channels we set up.

func (*Set) Setup

func (b *Set) Setup()

Setup is called once before running the block. We build up the channels and specify what kind of block this is.

type Skeleton

type Skeleton struct {
	blocks.Block
	// contains filtered or unexported fields
}

specify those channels we're going to use to communicate with streamtools

func (*Skeleton) Run

func (b *Skeleton) Run()

Run is the block's main loop. Here we listen on the different channels we set up.

func (*Skeleton) Setup

func (b *Skeleton) Setup()

Setup is called once before running the block. We build up the channels and specify what kind of block this is.

type Sync

type Sync struct {
	blocks.Block
	// contains filtered or unexported fields
}

specify those channels we're going to use to communicate with streamtools

func (*Sync) Run

func (b *Sync) Run()

Run is the block's main loop. Here we listen on the different channels we set up.

func (*Sync) Setup

func (b *Sync) Setup()

Setup is called once before running the block. We build up the channels and specify what kind of block this is.

type Ticker

type Ticker struct {
	blocks.Block
	// contains filtered or unexported fields
}

specify those channels we're going to use to communicate with streamtools

func (*Ticker) Run

func (b *Ticker) Run()

Run is the block's main loop. Here we listen on the different channels we set up.

func (*Ticker) Setup

func (b *Ticker) Setup()

Setup is called once before running the block. We build up the channels and specify what kind of block this is.

type Timeseries

type Timeseries struct {
	blocks.Block
	// contains filtered or unexported fields
}

specify those channels we're going to use to communicate with streamtools

func (*Timeseries) Run

func (b *Timeseries) Run()

Run is the block's main loop. Here we listen on the different channels we set up.

func (*Timeseries) Setup

func (b *Timeseries) Setup()

Setup is called once before running the block. We build up the channels and specify what kind of block this is.

type ToBeanstalkd

type ToBeanstalkd struct {
	blocks.Block
	// contains filtered or unexported fields
}

specify those channels we're going to use to communicate with streamtools

func (*ToBeanstalkd) Run

func (b *ToBeanstalkd) Run()

Run is the block's main loop. Here we listen on the different channels we set up.

func (*ToBeanstalkd) Setup

func (b *ToBeanstalkd) Setup()

Setup is called once before running the block. We build up the channels and specify what kind of block this is.

type ToElasticsearch

type ToElasticsearch struct {
	blocks.Block
	// contains filtered or unexported fields
}

specify those channels we're going to use to communicate with streamtools

func (*ToElasticsearch) Run

func (b *ToElasticsearch) Run()

Run is the block's main loop. Here we listen on the different channels we set up. This block posts a message to a specified Elasticsearch index with the given type.

func (*ToElasticsearch) Setup

func (b *ToElasticsearch) Setup()

Setup is called once before running the block. We build up the channels and specify what kind of block this is.

type ToFile

type ToFile struct {
	blocks.Block
	// contains filtered or unexported fields
}

specify those channels we're going to use to communicate with streamtools

func (*ToFile) Run

func (b *ToFile) Run()

Run is the block's main loop. Here we listen on the different channels we set up.

func (*ToFile) Setup

func (b *ToFile) Setup()

Setup is called once before running the block. We build up the channels and specify what kind of block this is.

type ToLog

type ToLog struct {
	blocks.Block
	// contains filtered or unexported fields
}

specify those channels we're going to use to communicate with streamtools

func (*ToLog) Run

func (b *ToLog) Run()

Run is the block's main loop. Here we listen on the different channels we set up.

func (*ToLog) Setup

func (b *ToLog) Setup()

Setup is called once before running the block. We build up the channels and specify what kind of block this is.

type ToMongoDB added in v0.2.3

type ToMongoDB struct {
	blocks.Block
	// contains filtered or unexported fields
}

specify those channels we're going to use to communicate with streamtools

func (*ToMongoDB) Run added in v0.2.3

func (b *ToMongoDB) Run()

Run is the block's main loop. Here we listen on the different channels we set up.

func (*ToMongoDB) Setup added in v0.2.3

func (b *ToMongoDB) Setup()

Setup is called once before running the block. We build up the channels and specify what kind of block this is.

type ToNSQ

type ToNSQ struct {
	blocks.Block
	// contains filtered or unexported fields
}

specify those channels we're going to use to communicate with streamtools

func (*ToNSQ) Run

func (b *ToNSQ) Run()

connects to an NSQ topic and emits each message into streamtools.

func (*ToNSQ) Setup

func (b *ToNSQ) Setup()

type ToNSQMulti

type ToNSQMulti struct {
	blocks.Block
	// contains filtered or unexported fields
}

specify those channels we're going to use to communicate with streamtools

func (*ToNSQMulti) Run

func (b *ToNSQMulti) Run()

connects to an NSQ topic and emits each message into streamtools.

func (*ToNSQMulti) Setup

func (b *ToNSQMulti) Setup()

type Toggle added in v0.2.3

type Toggle struct {
	blocks.Block
	// contains filtered or unexported fields
}

func (*Toggle) Run added in v0.2.3

func (b *Toggle) Run()

func (*Toggle) Setup added in v0.2.3

func (b *Toggle) Setup()

type Unpack

type Unpack struct {
	blocks.Block
	// contains filtered or unexported fields
}

specify those channels we're going to use to communicate with streamtools

func (*Unpack) Run

func (b *Unpack) Run()

Run is the block's main loop. Here we listen on the different channels we set up.

func (*Unpack) Setup

func (b *Unpack) Setup()

Setup is called once before running the block. We build up the channels and specify what kind of block this is.

type Zipf

type Zipf struct {
	blocks.Block
	// contains filtered or unexported fields
}

specify those channels we're going to use to communicate with streamtools

func (*Zipf) Run

func (b *Zipf) Run()

Run is the block's main loop. Here we listen on the different channels we set up. this is actually the Zipf-Manadlebrot "law". http://en.wikipedia.org/wiki/Zipf%E2%80%93Mandelbrot_law the parameter `v` is denoted `q` on wikipedia.

func (*Zipf) Setup

func (b *Zipf) Setup()

Setup is called once before running the block. We build up the channels and specify what kind of block this is.

Jump to

Keyboard shortcuts

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