Documentation ¶
Index ¶
- func ExecPuppeteer(urls []string) (*map[string]string, error)
- func GenerateResultsEmail(stockMap StockMap) (string, bool)
- func GenerateUrl(site Site, product Product, keyword string) (string, error)
- func Hprintf(format string, vv ...string) string
- func MonitorProducts(w http.ResponseWriter, r *http.Request)
- func NewFalse() *bool
- func SendMail(cfg *Config, subject string, msg string) error
- func Uprintf(format string, vv ...string) string
- type Config
- type JobContext
- type KeywordScrapeFunc
- type Mail
- type Model
- type ModelMap
- type PriceCheckJob
- type PriceCheckResponse
- type Product
- type ProductMap
- type RequestMessage
- type Site
- type StockMap
- type WorkTask
- type WorkerPool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateResultsEmail ¶
func MonitorProducts ¶
func MonitorProducts(w http.ResponseWriter, r *http.Request)
Types ¶
type Config ¶
type Config struct { Environment string `envconfig:"GOLANG_ENVIRONMENT"` SendEmails *bool `json:"sendEmails"` Sites []Site `json:"sites"` Products []Product `json:"products"` Mail Mail `json:"mail"` }
func LoadConfig ¶
type JobContext ¶
type JobContext struct { }
type KeywordScrapeFunc ¶
type KeywordScrapeFunc = func(PriceCheckJob) []Model
a function that is responsible for scraping one keyword query for a given job
type Model ¶
a struct to hold quantity/price information for a specific model of a product
func QueryBestBuy ¶
func QueryBestBuy(j PriceCheckJob) []Model
func QueryMicroCenter ¶
func QueryMicroCenter(j PriceCheckJob) []Model
func QueryNewegg ¶
func QueryNewegg(j PriceCheckJob) []Model
func QueryWalMart ¶
func QueryWalMart(j PriceCheckJob) []Model
type ModelMap ¶
func ToModelMap ¶
converts the list to a map. We don't reduce by price, because the model slice should already be price-reduced
type PriceCheckJob ¶
type PriceCheckResponse ¶
type PriceCheckResponse struct { Job PriceCheckJob Error error Models []Model }
type ProductMap ¶
type RequestMessage ¶
type RequestMessage struct {
ConfigOverrides *Config `json:"configOverrides"`
}
type StockMap ¶
type StockMap map[string]ProductMap
func (StockMap) AddResult ¶
func (m StockMap) AddResult(r PriceCheckResponse)
type WorkerPool ¶
type WorkerPool struct { WorkerCount int Results chan interface{} JobCount int // contains filtered or unexported fields }
func NewWorkerPool ¶
func NewWorkerPool(workerCount int, jobs []interface{}, work WorkTask) *WorkerPool
func (WorkerPool) Start ¶
func (pool WorkerPool) Start()
Click to show internal directories.
Click to hide internal directories.