library

package
v0.1.1-0...-d9c3a37 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2014 License: Apache-2.0 Imports: 26 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,
	"movingaverage":   NewMovingAverage,
	"ticker":          NewTicker,
	"fromnsq":         NewFromNSQ,
	"fromhttpstream":  NewFromHTTPStream,
	"fromsqs":         NewFromSQS,
	"frompost":        NewFromPost,
	"tonsq":           NewToNSQ,
	"toelasticsearch": NewToElasticsearch,
	"towebsocket":     NewToWebsocket,
	"tofile":          NewToFile,
	"tolog":           NewToLog,
	"mask":            NewMask,
	"filter":          NewFilter,
	"sync":            NewSync,
	"unpack":          NewUnpack,
	"pack":            NewPack,
	"set":             NewSet,
	"join":            NewJoin,
	"gethttp":         NewGetHTTP,
	"gaussian":        NewGaussian,
	"zipf":            NewZipf,
	"poisson":         NewPoisson,
	"map":             NewMap,
	"histogram":       NewHistogram,
	"timeseries":      NewTimeseries,
	"fromwebsocket":   NewFromWebsocket,
	"tonsqmulti":      NewToNSQMulti,
	"fromudp":         NewFromUDP,
}

Functions

func NewCount

func NewCount() blocks.BlockInterface

a bit of boilerplate for streamtools

func NewFilter

func NewFilter() blocks.BlockInterface

a bit of boilerplate for streamtools

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 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 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 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 NewToNSQ

func NewToNSQ() blocks.BlockInterface

a bit of boilerplate for streamtools

func NewToNSQMulti

func NewToNSQMulti() blocks.BlockInterface

a bit of boilerplate for streamtools

func NewToWebsocket

func NewToWebsocket() blocks.BlockInterface

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

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 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 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 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 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) 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 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 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 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 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