Documentation
¶
Index ¶
- Constants
- Variables
- func NormalizeFeedURL(raw string) (string, string, error)
- type AddOptions
- type DiscoveryCandidate
- type FetchResult
- type Fetcher
- type HTTPFetcher
- type Options
- type Result
- type RunFunc
- type Stats
- func Add(ctx context.Context, cfg config.Config, st *store.Store, rawURL string, ...) (store.Feed, bool, Stats, error)
- func CheckFeed(ctx context.Context, cfg config.Config, st *store.Store, feed store.Feed, ...) (Stats, error)
- func Run(ctx context.Context, cfg config.Config, st *store.Store, opts Options) (Stats, error)
Constants ¶
View Source
const ( DefaultPollInterval = time.Hour DefaultTimeout = 30 * time.Second DefaultMaxBodyBytes = 10 << 20 DefaultConcurrency = 6 DefaultUserAgent = "dbrain feed importer" )
Variables ¶
Functions ¶
Types ¶
type AddOptions ¶
type DiscoveryCandidate ¶
type DiscoveryCandidate struct {
URL string `json:"url"`
Title string `json:"title,omitempty"`
Type string `json:"type,omitempty"`
}
func DiscoverFromHTML ¶
func DiscoverFromHTML(pageURL, htmlBody string) ([]DiscoveryCandidate, error)
func DiscoverURL ¶
func DiscoverURL(ctx context.Context, rawURL string, opts AddOptions) ([]DiscoveryCandidate, bool)
type FetchResult ¶
type HTTPFetcher ¶
type HTTPFetcher struct {
// contains filtered or unexported fields
}
func NewHTTPFetcher ¶
func NewHTTPFetcher(client *http.Client) HTTPFetcher
func (HTTPFetcher) Fetch ¶
func (f HTTPFetcher) Fetch(ctx context.Context, feed store.Feed, opts Options) (FetchResult, error)
type Result ¶
type Result struct {
FeedKey string `json:"feed_key"`
URL string `json:"url"`
Status string `json:"status"`
HTTPStatus int `json:"http_status,omitempty"`
EntriesSeen int `json:"entries_seen"`
ItemsCreated int `json:"items_created"`
ItemsUpdated int `json:"items_updated"`
ItemsUnchanged int `json:"items_unchanged"`
Error string `json:"error,omitempty"`
}
type Stats ¶
type Stats struct {
FeedsChecked int `json:"feeds_checked"`
FeedsChanged int `json:"feeds_changed"`
FeedsUnchanged int `json:"feeds_unchanged"`
FeedsFailed int `json:"feeds_failed"`
EntriesSeen int `json:"entries_seen"`
ItemsCreated int `json:"items_created"`
ItemsUpdated int `json:"items_updated"`
ItemsUnchanged int `json:"items_unchanged"`
VersionsCreated int `json:"versions_created"`
SourcesCreated int `json:"sources_created"`
SourcesLinked int `json:"sources_linked"`
ItemsRendered int `json:"items_rendered"`
IdentityConflicts int `json:"identity_conflicts"`
Errors int `json:"errors"`
Results []Result `json:"results,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.