runner

package
v0.0.0-...-0ef06cd Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorDailyLimit    = errors.New("the daily limit for saving leads has been hit")
	ErrorNoCredits     = errors.New("no more credits available for saving leads")
	ErrorTargetReached = errors.New("target number of leads have been saved")
)

Functions

This section is empty.

Types

type Runner

type Runner struct {
	// contains filtered or unexported fields
}

Runner is a type that manages and orchestrates the process of scraping leads from Apollo.

func New

func New(accounts []*models.Account, opts ...RunnerOpt) (*Runner, error)

New returns a newly insantiated and configured instance of Runner.

func (*Runner) Start

func (r *Runner) Start() error

type RunnerOpt

type RunnerOpt func(r *Runner)

RunnerOpt represents a function that is used to configure an instance of Runner.

func Annoyances

func Annoyances(values []string) RunnerOpt

Annoyances is a RunnerOpt func that is used to specify which annoyances on Apollo to look out for.

func CookieFile

func CookieFile(file string) RunnerOpt

CookieFile is a RunnerOpt func that specifies the path to a file containing login cookies for the provided Apollo accounts.

func CsvOutput

func CsvOutput() RunnerOpt

CsvOutput is a RunnerOpt func that sets the desired output format to CSV.

func Dailyimit

func Dailyimit(l int) RunnerOpt

Dailyimit is a RunnerOpt func that configures the Runner's daily limit for saving leads on Apollo.

func Debug

func Debug(b bool) RunnerOpt

Debug is a RunnerOpt func that configures the Runner to print useful debugging information.

func FetchCredits

func FetchCredits(b bool) RunnerOpt

FetchCredits is a RunnerOpt func that configures the Runner to fetch the credits for each models.Account before scraping.

func Headless

func Headless(b bool) RunnerOpt

Headless is a RunnerOpt func that configures whether or not the Runner launches the browser in headless mode.

func JsonOutput

func JsonOutput() RunnerOpt

JsonOutput is a RunnerOpt func that sets the desired output format to CSV.

func OutputDir

func OutputDir(outputDir string) RunnerOpt

OutputDir is a RunnerOpt func that specifies the output directory for Runner's output files.

func SaveProgress

func SaveProgress(b bool) RunnerOpt

SaveProgress is a RunnerOpt func that specifies whether or not the Runner saves the intermediary state for each of the [models.Account]s.

func Stealth

func Stealth(s bool) RunnerOpt

Stealth is a RunnerOpt func that specifies whether or not the Runner launches the browser in stealth mode.

func Tab

func Tab(tab string) RunnerOpt

Tab is a RunnerOpt func that configures the Runner to scrape leads from the specified tab on Apollo.

func Timeout

func Timeout(t time.Duration) RunnerOpt

Timeout is a RunnerOpt func that configures the Runner's time limit for each browser action.

func VpnManager

func VpnManager(v *openvpn.Manager) RunnerOpt

VpnManager is a RunnerOpt func that configures the Runner to utilise OpenVPN for scraping leads.

Jump to

Keyboard shortcuts

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