tweetmap

package
v0.0.0-...-4e229c5 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2015 License: MIT Imports: 9 Imported by: 2

Documentation

Index

Constants

View Source
const (
	TWEETS_PAST_24HRS       int = iota
	TWEETS_BY_WARD          int = iota
	HASH_BY_WARD_PAST_24HRS int = iota
	TOP_HASH_PAST_24HRS     int = iota
)

Query types

Variables

This section is empty.

Functions

func InitPublisher

func InitPublisher(connStr string, tweetChan chan *prototweet.Tweet, errorChan chan error)

Initializes ZMQ as a publisher Returns a channel for incoming tweets that need to be pushed out and an error channel used for outcoming publishing or tweet marshalling errors Goroutine exits on closing of the tweet channel

func InitReceiver

func InitReceiver(connStr string, doneChan chan bool) (chan *prototweet.Tweet, chan error)

Initializes ZMQ as a receiver Returns a channel for incoming tweets and a channel for errors. Takes a connection string, and a boolean channel to signal when to stop receiving tweets. Goroutine exits when any value is passed to the done channel

func ListenToTwitter

func ListenToTwitter(cfg TwitterAPIConfig, filterFunc TweetFilter, doneChan chan bool) (chan *prototweet.Tweet, chan error)

Listens starts up the twitterstream Takes a API configuration, a filter function, and a "done" channel Returns a tweet channel, and an error channel

func ToProtoTweet

func ToProtoTweet(in *twitterstream.Tweet) (out *prototweet.Tweet, err error)

Takes an input tweet from the twitterstream and transform it into a prototweet - a type suitable for transmission over ZMQ and JSON serialization

Types

type Database

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

func NewDatabase

func NewDatabase() (*Database, error)

func (*Database) Disconnect

func (Db *Database) Disconnect()

Wrapper for DB.Close()

func (*Database) Query

func (Db *Database) Query(queryType int, args ...interface{}) ([]byte, error)

Query Returns the result of a query, in marshalled JSON, which then can be served to the client

type ProtoTweetError

type ProtoTweetError struct{}

Prototweet Error Type

func (*ProtoTweetError) Error

func (e *ProtoTweetError) Error() string

type TweetFilter

type TweetFilter func(t *twitterstream.Tweet) bool

Filter type Functions take a tweet and return true if it should continue being processed

type TwitterAPIConfig

type TwitterAPIConfig struct {
	ConsumerKey    string
	ConsumerSecret string
	AccessToken    string
	AccessSecret   string
	SouthEast      twitterstream.Point
	NorthWest      twitterstream.Point
}

API keys and extent bounding box coordinates

Directories

Path Synopsis
Godeps
_workspace/src/github.com/garyburd/go-oauth/oauth
Package oauth is consumer interface for OAuth 1.0, OAuth 1.0a and RFC 5849.
Package oauth is consumer interface for OAuth 1.0, OAuth 1.0a and RFC 5849.
_workspace/src/github.com/golang/protobuf/proto
Package proto converts data structures to and from the wire format of protocol buffers.
Package proto converts data structures to and from the wire format of protocol buffers.
_workspace/src/github.com/lib/pq
Package pq is a pure Go Postgres driver for the database/sql package.
Package pq is a pure Go Postgres driver for the database/sql package.
_workspace/src/github.com/lib/pq/listen_example
Below you will find a self-contained Go program which uses the LISTEN / NOTIFY mechanism to avoid polling the database while waiting for more work to arrive.
Below you will find a self-contained Go program which uses the LISTEN / NOTIFY mechanism to avoid polling the database while waiting for more work to arrive.
_workspace/src/github.com/lib/pq/oid
Package oid contains OID constants as defined by the Postgres server.
Package oid contains OID constants as defined by the Postgres server.
_workspace/src/github.com/pebbe/zmq4
A Go interface to ZeroMQ (zmq, 0mq) version 4.
A Go interface to ZeroMQ (zmq, 0mq) version 4.
bstar - Binary Star reactor.
_workspace/src/github.com/pebbe/zmq4/examples/clone
Clone client API stack (multithreaded).
Clone client API stack (multithreaded).
_workspace/src/github.com/pebbe/zmq4/examples/flcliapi
flcliapi - Freelance Pattern agent class.
flcliapi - Freelance Pattern agent class.
Interface class for Chapter 8.
_workspace/src/github.com/pebbe/zmq4/examples/kvmsg
kvmsg class - key-value message class for example applications
kvmsg class - key-value message class for example applications
_workspace/src/github.com/pebbe/zmq4/examples/kvsimple
kvsimple - simple key-value message class for example applications.
kvsimple - simple key-value message class for example applications.
_workspace/src/github.com/pebbe/zmq4/examples/mdapi
Majordomo Protocol Client and Worker API.
Majordomo Protocol Client and Worker API.
_workspace/src/github.com/stretchr/testify/assert
A set of comprehensive testing tools for use with the normal Go testing system.
A set of comprehensive testing tools for use with the normal Go testing system.
Package main provides ...
Package main provides ...

Jump to

Keyboard shortcuts

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