utils

package
v0.0.0-...-c4a26ae Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const GenericProviderErrorMsg = "Error occurred while searching"
View Source
const IndisponibilMsg = "Indisponibil"
View Source
const LaCerereMsg = "La cerere"
View Source
const ProductNotFoundMsg = "Product not found"

Variables

View Source
var Client = &http.Client{}
View Source
var Headers = &http.Header{
	"Accept":     {"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"},
	"User-Agent": {"Mozilla/5.0 (Windows NT 10.0; rv:114.0) Gecko/20100101 Firefox/114.0"},
	"Connection": {"keep-alive"},
}

Functions

func CheckGenericProviderError

func CheckGenericProviderError(err error, p *structs.ProviderStruct, out chan<- *structs.Deal)

func GenericGoQueryDoc

func GenericGoQueryDoc(p *structs.ProviderStruct, productCode *string, out chan<- *structs.Deal) *goquery.Document

func HttpGet

func HttpGet(url string) (*http.Response, error)

func IsProviderNotFound

func IsProviderNotFound(err error) bool

Types

type ProviderNotFoundError

type ProviderNotFoundError struct {
	Provider string
}

func (*ProviderNotFoundError) Error

func (p *ProviderNotFoundError) Error() string

Jump to

Keyboard shortcuts

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