service

package
v0.0.0-...-0c534cb Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Messanger

type Messanger interface {
	Message(text string) error
}

type Notifier

type Notifier interface {
	Notify(products domain.Products)
}

type ProductCollector

type ProductCollector struct {
	// contains filtered or unexported fields
}

func NewCollector

func NewCollector() ProductCollector

func (*ProductCollector) Collect

func (p *ProductCollector) Collect(ch chan<- prometheus.Metric)

func (*ProductCollector) Describe

func (p *ProductCollector) Describe(descs chan<- *prometheus.Desc)

func (*ProductCollector) TrackProduct

func (pc *ProductCollector) TrackProduct(name string, price float64)

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(collector ProductCollector, messanger Messanger, logger *zap.Logger) Service

func (Service) Check

func (s Service) Check() []string

func (Service) Notify

func (s Service) Notify(products domain.Products)

type ShopClient

type ShopClient interface {
	Search(query string) (domain.Products, error)
}

type ShopScraper

type ShopScraper struct {
	// contains filtered or unexported fields
}

func NewScraper

func NewScraper(client ShopClient, publisher Notifier, logger *zap.Logger) ShopScraper

func (*ShopScraper) Run

func (scraper *ShopScraper) Run(ctx context.Context, interval time.Duration, query string)

Jump to

Keyboard shortcuts

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