config

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: May 24, 2022 License: MIT Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RabiConfig

type RabiConfig struct {
	// Delay the next request between from and to milliseconds
	// if only from is specified, delay exactly from milliseconds
	Delay []time.Duration `default:"2s,3s" json:"delay"`
	// Concurrency limits concurrency
	// TODO
	Concurrency int `json:"concurrency"`
	// ThrottleNum limits the request rate to ThrottleNum per ThrottleDuration
	// TODO
	ThrottleNum      int           `split_words:"true" json:"throttleNum"`
	ThrottleDuration time.Duration `split_words:"true" json:"throttleDuration"`
	// Timeout specify a timeout for each page loading and element lookup
	Timeout time.Duration `default:"10s" json:"timeout"`
	// Mode Headless or browser
	Mode string `default:"headless" json:"mode"`
	// Debug if true, it will take full screenshot of every page and output debug logs to stdout
	Debug bool `json:"debug"`
	// Out screenshot png files output path
	Out string `default:"out" json:"out"`
	// Strict useragent、browser、platform should be matched, platform should not be linux etc..
	Strict bool `json:"strict"`
	//ProxyServer proxy server
	Proxy string `json:"proxy"`
	// ScrollType scroll should be scrollBy and scrollTo. default is scrollBy
	ScrollType string `split_words:"true" json:"scroll_type" default:"scrollBy"`
	// ScrollTop refer to window.scrollTo parameters
	ScrollTop string `split_words:"true" json:"scroll_top" default:"800"`
	// ScrollLeft refer to window.scrollTo parameters
	ScrollLeft string `split_words:"true" json:"scroll_left" default:"0"`
}

func LoadFromEnv

func LoadFromEnv() *RabiConfig

Jump to

Keyboard shortcuts

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