Documentation
¶
Index ¶
- type MongoStorage
- func (m *MongoStorage) CreateCollection(name string) error
- func (m MongoStorage) FromEnv() (*MongoStorage, error)
- func (m *MongoStorage) GetCollection(name string) *mgm.Collection
- func (m MongoStorage) New(url, dbName string) (*MongoStorage, error)
- func (m *MongoStorage) ResetColection(name string) error
- type Post
- type RedditMongo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MongoStorage ¶ added in v1.0.6
type MongoStorage struct {
// contains filtered or unexported fields
}
func (*MongoStorage) CreateCollection ¶ added in v1.0.6
func (m *MongoStorage) CreateCollection(name string) error
func (MongoStorage) FromEnv ¶ added in v1.0.6
func (m MongoStorage) FromEnv() (*MongoStorage, error)
func (*MongoStorage) GetCollection ¶ added in v1.0.6
func (m *MongoStorage) GetCollection(name string) *mgm.Collection
func (MongoStorage) New ¶ added in v1.0.6
func (m MongoStorage) New(url, dbName string) (*MongoStorage, error)
func (*MongoStorage) ResetColection ¶ added in v1.0.6
func (m *MongoStorage) ResetColection(name string) error
type Post ¶
type Post struct {
mgm.DefaultModel `bson:",inline"`
Id string `json:"id" bson:"id"`
Title string `json:"title" bson:"title"`
Body string `json:"body" bson:"body"`
// contains filtered or unexported fields
}
func (*Post) CheckExists ¶
func (p *Post) CheckExists(m *MongoStorage) (bool, error)
func (Post) FromScraped ¶
func (p Post) FromScraped(post *redditscraper.Post, subreddit string) *Post
func (Post) GetLast ¶ added in v1.0.9
func (p Post) GetLast(m *MongoStorage, subreddit string) (*Post, error)
func (*Post) Save ¶
func (p *Post) Save(m *MongoStorage) error
type RedditMongo ¶
type RedditMongo struct {
Subreddit string
// contains filtered or unexported fields
}
func (RedditMongo) FromEnv ¶ added in v1.0.2
func (rm RedditMongo) FromEnv(subreddit string) (*RedditMongo, error)
func (RedditMongo) New ¶ added in v1.0.2
func (rm RedditMongo) New(ms *MongoStorage, rs *redditscraper.RedditScraper, subreddit string) *RedditMongo
func (*RedditMongo) Scrape ¶ added in v1.0.2
func (rm *RedditMongo) Scrape(e chan<- error)
Click to show internal directories.
Click to hide internal directories.