Documentation
¶
Index ¶
- func SortPages(webpages []*Webpage)
- type Cache
- type Config
- func (cfg *Config) CreatePool()
- func (cfg *Config) Feed(ctx context.Context, urlStr string) error
- func (cfg *Config) FeedFlickr(ctx context.Context, flickrId string) error
- func (cfg *Config) GetErrorInPool() error
- func (cfg *Config) GetPagesFromPool() []*Webpage
- func (cfg *Config) GetWebpage(ctx context.Context, urlStr string) (*Webpage, bool, error)
- func (cfg *Config) Logger() *zap.Logger
- func (cfg *Config) Lookup(ctx context.Context, urlStr string) (*Webpage, error)
- func (cfg *Config) Save(ctx context.Context, list []*Webpage) error
- func (cfg *Config) StopPool() ([]*Webpage, error)
- type FeedList
- type Webpage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cache ¶ added in v0.6.0
type Cache struct {
// contains filtered or unexported fields
}
Cache is cache data for Web page informations.
type Config ¶ added in v0.10.0
type Config struct {
// contains filtered or unexported fields
}
Config is configuration for webpage
func (*Config) CreatePool ¶ added in v0.10.0
func (cfg *Config) CreatePool()
CreatePool creates pool and starts goroutine,
func (*Config) FeedFlickr ¶ added in v0.10.0
Feed fetches feed URL and gets webpage informations.
func (*Config) GetErrorInPool ¶ added in v0.10.0
func (*Config) GetPagesFromPool ¶ added in v0.10.0
func (*Config) GetWebpage ¶ added in v0.10.0
type FeedList ¶ added in v0.9.0
type FeedList []string
FeedList is list of feed URLs.
func NewFeedList ¶ added in v0.9.0
NewFeedList function returns new instance of FeedList.
type Webpage ¶ added in v0.8.0
type Webpage struct { URL string `json:"url,omitempty"` Canonical string `json:"canonical,omitempty"` Title string `json:"title,omitempty"` Description string `json:"description,omitempty"` ImageURL string `json:"image_url,omitempty"` Published *time.Time `json:"published,omitempty"` }
Webpage is information of web page
func (*Webpage) MakeMessage ¶ added in v0.10.0
Source Files
¶
Click to show internal directories.
Click to hide internal directories.