collector

package
v0.0.0-...-a38c984 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StrategyMobile  = Strategy("mobile")
	StrategyDesktop = Strategy("desktop")

	CategoryAccessibility = "accessibility"
	CategoryBestPractices = "best-practices"
	CategorySEO           = "seo"
	CategoryPWA           = "pwa"
	CategoryPerformance   = "performance"

	Namespace = "pagespeed"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ScrapeRequests  []ScrapeRequest
	GoogleAPIKey    string
	CredentialsFile string
	Parallel        bool
	ScrapeTimeout   time.Duration
}

type Factory

type Factory interface {
	Create(config Config) (prometheus.Collector, error)
}

func NewFactory

func NewFactory() Factory

type ScrapeRequest

type ScrapeRequest struct {
	Url        string   `json:"url"`
	Strategy   Strategy `json:"strategy"`
	Campaign   string   `json:"campaign"`
	Source     string   `json:"source"`
	Locale     string   `json:"locale"`
	Categories []string `json:"categories"`
}

func CalculateScrapeRequests

func CalculateScrapeRequests(targets, categories []string) []ScrapeRequest

func (ScrapeRequest) IsValid

func (sr ScrapeRequest) IsValid() bool

type ScrapeResult

type ScrapeResult struct {
	Request ScrapeRequest
	Result  *pagespeedonline.PagespeedApiPagespeedResponseV5
}

type Strategy

type Strategy string

Jump to

Keyboard shortcuts

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