Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultUserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36" AmazonAcceptHeader = "" /* 164-byte string literal not displayed */ AmazonTokenUrl = "https://www.amazon.com/dp/B0BZWRSRWV" // * One of many Amazon product pages that contains an embedded api token AmazonBaseUrl = "https://data.amazon.com/api/marketplaces/ATVPDKIKX0DER/products/" BestbuyBaseUrl = "https://www.bestbuy.com/button-state/api/v5/button-state?context=pdp&source=buttonView&skus=" NeweggBaseUrl = "https://www.newegg.com/product/api/ProductRealtime?ItemNumber=" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MonitorClient ¶
type MonitorClient struct { HttpClient tls_client.HttpClient AlertChannel chan bool // * Alert channel for when the monitor finds stock // contains filtered or unexported fields }
func NewMonitorClient ¶
func NewMonitorClient(opts MonitorOpts) (*MonitorClient, error)
* NewMonitorClient intializes a new http client and returns a new monitor instance
func (*MonitorClient) AmazonTask ¶
func (m *MonitorClient) AmazonTask(priceLimit float64) error
* AmazonTask continuously refreshes the api token and checks stock until the cancel channel is triggered
func (*MonitorClient) BestbuyTask ¶
func (m *MonitorClient) BestbuyTask() error
* BestbuyTask continuously checks stock until the cancel channel is triggered
func (*MonitorClient) Cancel ¶
func (m *MonitorClient) Cancel()
func (*MonitorClient) NeweggTask ¶
func (m *MonitorClient) NeweggTask() error
* NeweggTask continuously checks stock until the cancel channel is triggered
Click to show internal directories.
Click to hide internal directories.