Documentation ¶
Index ¶
- Constants
- Variables
- func EventRefresh(na *mgo.Collection, ne *mgo.Collection, eventTime time.Time, ...) error
- func FetchMail(ctx context.Context, cfg *Config, sess *mgo.Session, ...)
- func MapReduce(sess *mgo.Session) error
- func NewNewsAlert(msg eazye.Email, host, address string) (newshound.NewsAlert, error)
- func NewNewsEvent(id bson.ObjectId, alerts []newshound.NewsAlert, eventTags []string) newshound.NewsEvent
- func ReParse(cfg *Config, sess *mgo.Session) error
- func ReParseNewsAlert(na newshound.NewsAlert, host, address string) (newshound.NewsAlert, error)
- func UpdateEvents(na *mgo.Collection, ne *mgo.Collection, a newshound.NewsAlert, ...) error
- type Config
Constants ¶
View Source
const ( LastSevenDays = "7days" ThreeMonths = "3months" SixMonths = "6months" TwelveMonths = "12months" )
Variables ¶
View Source
var Senders = map[string]bool{ "cnn": true, "foxnews.com": true, "foxbusiness.com": true, "nbcnews.com": true, "nbc": true, "nytimes.com": true, "the new york times": true, "the washington post": true, "wsj.com": true, "the wall street journal": true, "the wall street journal.": true, "politico": true, "los angeles times": true, "cbs": true, "abc": true, "usatoday.com": true, "usa today": true, "yahoo": true, "ft": true, "bbc": true, "npr": true, "time": true, "bloomberg.com": true, }
View Source
var Timeframes map[string][]time.Time
Functions ¶
func EventRefresh ¶
func FetchMail ¶
func FetchMail(ctx context.Context, cfg *Config, sess *mgo.Session, apub, epub pubsub.MultiPublisher)
func NewNewsAlert ¶
func NewNewsEvent ¶
func ReParseNewsAlert ¶
Types ¶
type Config ¶
type Config struct { DBURL string `envconfig:"DB_URL"` DBUser string `envconfig:"DB_USER"` DBPassword string `envconfig:"DB_PASSWORD"` MarkRead bool `envconfig:"MARK_READ"` Mailbox eazye.MailboxInfo `envconfig:"MAILBOX"` NPHost string `envconfig:"NP_HOST"` }
func (*Config) MgoSession ¶
Click to show internal directories.
Click to hide internal directories.