예제 #1
0
파일: urlimporter.go 프로젝트: pzsz/sp0rkle
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(),
	}
}