listing

package
v0.0.0-...-63c59c6 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ad struct {
	Id            int
	Url           string
	Created       time.Time
	Price         string
	SqFootage     string
	Street        string
	Neighbourhood string
	Location      string
}

type Repository

type Repository interface {
	GetById(id int) (Ad, error)
	Add(listing Ad) error
}

type Scraper

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

func NewScraper

func NewScraper(allowedDomains ...string) *Scraper

func (*Scraper) GetListings

func (s *Scraper) GetListings(url string) []Ad

type Service

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

func NewService

func NewService(repo *Storage) *Service

func (*Service) GetNewListings

func (s *Service) GetNewListings(searchUrl string, scraper *Scraper) ([]Ad, error)

type Storage

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

func NewStorage

func NewStorage(db *sql.DB) *Storage

func (*Storage) Add

func (r *Storage) Add(listing Ad) error

func (*Storage) GetById

func (r *Storage) GetById(id int) (Ad, error)

Jump to

Keyboard shortcuts

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