Пример #1
0
func parseUrl(row []interface{}) *urls.Url {
	return &urls.Url{
		Nick:      base.Nick(row[cNick].(string)),
		Chan:      base.Chan(row[cChannel].(string)),
		Url:       row[cUrl].(string),
		Timestamp: time.Unix(row[cTime].(int64), 0),
		Id:        bson.NewObjectId(),
	}
}
Пример #2
0
func parseQuote(row []interface{}, out chan *quotes.Quote) {
	out <- &quotes.Quote{
		Quote:     row[cQuote].(string),
		QID:       int(row[cID].(int64)),
		Nick:      base.Nick(row[cNick].(string)),
		Chan:      base.Chan(row[cChannel].(string)),
		Accessed:  0,
		Timestamp: time.Unix(row[cTime].(int64), 0),
		Id:        bson.NewObjectId(),
	}
}