scraper

package
v0.0.0-...-fba4924 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package scraper represents a main application logic

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Runner

type Runner interface {
	// Run the runner to get pages content
	// based on the selector
	Run(ctx context.Context, selector models.RunSelector) []models.RunResult
}

Runner interface

func NewAsyncRunner

func NewAsyncRunner(
	cfg *config.AppConfig,
	cats []models.Category,
	cache cache.Cache,
) Runner

NewAsyncRunner instance of the new asynchronous runner

type Service

type Service struct {
	Cfg config.AppConfig
	// contains filtered or unexported fields
}

Service main service representation

func NewService

func NewService(cfg *config.AppConfig) *Service

NewService create a new instance of the service

func (*Service) GetCategories

func (s *Service) GetCategories() []models.Category

GetCategories get all categories

func (*Service) InvalidateCache

func (s *Service) InvalidateCache(sel models.RunSelector)

InvalidateCache for the provided selector

func (*Service) Scrape

func (s *Service) Scrape(ctx context.Context, selector models.RunSelector) []models.RunResult

Scrape the pages based on selector

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL