library

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2014 License: Apache-2.0 Imports: 35 Imported by: 8

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,
	"fromemail":       NewFromEmail,
	"tonsq":           NewToNSQ,
	"toelasticsearch": NewToElasticsearch,
	"toemail":         NewToEmail,
	"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,
	"kullbackleibler": NewKullbackLeibler,
	"learn":           NewLearn,
	"logisticModel":   NewLogisticModel,
	"linearModel":     NewLinearModel,
	"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

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

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 NewFromEmail

func NewFromEmail() blocks.BlockInterface

NewFromEmail is a simple factory for streamtools to make new blocks of this kind. By default, the block is configured for GMail.

func NewFromFile

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 NewKullbackLeibler

func NewKullbackLeibler() blocks.BlockInterface

func NewLearn

func NewLearn() blocks.BlockInterface

a bit of boilerplate for streamtools

func NewLinearModel

func NewLinearModel() blocks.BlockInterface

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

func NewListenerUDP

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

func NewLogisticModel

func NewLogisticModel() blocks.BlockInterface

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

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

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

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 NewToEmail

func NewToEmail() blocks.BlockInterface

NewToEmail is a simple factory for streamtools to make new blocks of this kind. By default, the block is configured for GMail.

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

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

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

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

func (b *Cache) Run()

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

func (*Cache) Setup

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

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

func (b *DeDupe) Run()

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

func (*DeDupe) Setup

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 FromEmail

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

FromEmail holds channels we're going to use to communicate with streamtools, credentials for authenticating with an IMAP server and the IMAP client.

func (*FromEmail) Run

func (e *FromEmail) Run()

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

func (*FromEmail) Setup

func (e *FromEmail) Setup()

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

type FromFile

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

func (b *FromFile) Run()

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

func (*FromFile) Setup

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 KullbackLeibler

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

func (*KullbackLeibler) Run

func (b *KullbackLeibler) Run()

func (*KullbackLeibler) Setup

func (b *KullbackLeibler) Setup()

type Learn

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

func (*Learn) Run

func (b *Learn) Run()

func (*Learn) Setup

func (b *Learn) Setup()

type LinearModel

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

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

func (*LinearModel) Run

func (b *LinearModel) Run()

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

func (*LinearModel) Setup

func (b *LinearModel) Setup()

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

type LogisticModel

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

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

func (*LogisticModel) Run

func (b *LogisticModel) Run()

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

func (*LogisticModel) Setup

func (b *LogisticModel) Setup()

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

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

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

func (b *ParseXML) Run()

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

func (*ParseXML) Setup

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

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

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

func (b *Queue) Run()

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

func (*Queue) Setup

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 ToEmail

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

ToEmail holds channels we're going to use to communicate with streamtools, credentials for authenticating with an SMTP server and the to, from and subject for the email message.

func (*ToEmail) Run

func (e *ToEmail) Run()

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

func (*ToEmail) Send

func (e *ToEmail) Send(msg interface{}) error

Send will package and send the email.

func (*ToEmail) Setup

func (e *ToEmail) 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

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

func (b *ToMongoDB) Run()

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

func (*ToMongoDB) Setup

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

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

func (*Toggle) Run

func (b *Toggle) Run()

func (*Toggle) Setup

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