Documentation ¶
Index ¶
- Variables
- func GetMongodbCluster(host chan string)
- func GetRedisHost(host chan string)
- func GoogleNewsFindIfExist(title string) bool
- func GoogleNewsInsert(hn GoogleNews, wg *sync.WaitGroup) bool
- func HackerNewsFindIfExist(title string, sc *mongodb.Session) bool
- func HackerNewsInsert(hn HackerNews, hnTitle string, wg *sync.WaitGroup)
- func IncrementNewsScore(paramsID string)
- func MongodbStart()
- func NewPool(server string) *redis.Pool
- func NewsItemPage(paramsID string) (interface{}, error)
- func NewsMainIndexNews(language string) ([]models.NewsMaster, error)
- func RedisKeyGen(keys ...string) string
- func RetrieveSessionKey(cookieKey string)
- func SessionCopy() *mongodb.Session
- func SetSessionKey(encodedKey string) bool
- func StartRedis()
- func SubstringStrToKey(str string, keyLength int) string
- type AggregatedNews
- func GetCategorizedNews(initial string) (AggregatedNews, error)
- func GetterNewsMainTopScore() (AggregatedNews, error)
- func GoogleNewsIndexNews() (AggregatedNews, error)
- func HackerNewsFeedMore(contentType string, length int) (AggregatedNews, error)
- func HackerNewsIndexNews() (AggregatedNews, error)
- func HackerNewsLatestNews() (AggregatedNews, error)
- func HeadlinesGetter() (AggregatedNews, error)
- func NewsMainIndexNewsCached(IDs ...bson.ObjectId) (AggregatedNews, error)
- func SuggestRand() (AggregatedNews, error)
- func TopRankingNews() (AggregatedNews, error)
- type GoogleNews
- type HackerNews
- type Rstring
Constants ¶
This section is empty.
Variables ¶
var ( // MongodbSession main mongodb cluster session MongodbSession *mongodb.Session // Db current app database Db = "news_aggregator" )
var (
// NewsMainCollection collection name
NewsMainCollection = "news_main"
)
var ( // RedisPool main redis pool connection RedisPool *redis.Pool )
Functions ¶
func GetMongodbCluster ¶
func GetMongodbCluster(host chan string)
GetMongodbCluster retrieve mongodb cluster node from etcd
func GoogleNewsFindIfExist ¶
GoogleNewsFindIfExist check google news current data if exist before insert
func GoogleNewsInsert ¶
func GoogleNewsInsert(hn GoogleNews, wg *sync.WaitGroup) bool
GoogleNewsInsert insert data for google news
func HackerNewsFindIfExist ¶
HackerNewsFindIfExist check if data exists already before saving
func HackerNewsInsert ¶
func HackerNewsInsert(hn HackerNews, hnTitle string, wg *sync.WaitGroup)
HackerNewsInsert insert data to mongodb
func IncrementNewsScore ¶
func IncrementNewsScore(paramsID string)
IncrementNewsScore increment news score increment news ite page view
func NewsItemPage ¶
NewsItemPage get news item data
func NewsMainIndexNews ¶
func NewsMainIndexNews(language string) ([]models.NewsMaster, error)
NewsMainIndexNews responder for index news query NEWS MAIN GETTER
func RedisKeyGen ¶
RedisKeyGen is a util that joins slices to string
func RetrieveSessionKey ¶
func RetrieveSessionKey(cookieKey string)
RetrieveSessionKey get session key from redis
func SetSessionKey ¶
SetSessionKey main session key setter to redis
func SubstringStrToKey ¶
SubstringStrToKey get a key from string by range
Types ¶
type AggregatedNews ¶
type AggregatedNews []interface{}
AggregatedNews interface struct for AggregatedNews
func GetCategorizedNews ¶
func GetCategorizedNews(initial string) (AggregatedNews, error)
GetCategorizedNews will get news with category news initials
func GetterNewsMainTopScore ¶
func GetterNewsMainTopScore() (AggregatedNews, error)
GetterNewsMainTopScore main top page news getter
func GoogleNewsIndexNews ¶
func GoogleNewsIndexNews() (AggregatedNews, error)
GoogleNewsIndexNews aggregated news list for google news
func HackerNewsFeedMore ¶
func HackerNewsFeedMore(contentType string, length int) (AggregatedNews, error)
HackerNewsFeedMore feed more data on index list
func HackerNewsIndexNews ¶
func HackerNewsIndexNews() (AggregatedNews, error)
HackerNewsIndexNews index page data
func HackerNewsLatestNews ¶
func HackerNewsLatestNews() (AggregatedNews, error)
HackerNewsLatestNews aggregate latest news
func HeadlinesGetter ¶
func HeadlinesGetter() (AggregatedNews, error)
HeadlinesGetter retrive data from mongodb
func NewsMainIndexNewsCached ¶
func NewsMainIndexNewsCached(IDs ...bson.ObjectId) (AggregatedNews, error)
NewsMainIndexNewsCached retrieve index news from cached ID TODO make this func a util!
func SuggestRand ¶
func SuggestRand() (AggregatedNews, error)
SuggestRand retrieve curated top ranking news fom cache
func TopRankingNews ¶
func TopRankingNews() (AggregatedNews, error)
TopRankingNews retrieve curated top ranking news fom cache