parser

package
v0.0.0-...-eb89b7e Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CachDate

func CachDate() string

CachDate ...

func Save

func Save(lands Lands, client *mongo.Client) error

Save ...

Types

type Config

type Config struct {
	Vladis        string `toml:"vladis"`
	Domofond      string `toml:"domofond"`
	Cian          string `toml:"cian"`
	Avito         string `toml:"avito"`
	Ioffepartners string `toml:"ioffepartners"`
}

Config ...

func NewConfig

func NewConfig(path string) Config

NewConfig ...

type Image

type Image struct {
	Name string
	Path string
	URL  string
}

Image ...

func (Image) BuildFileName

func (i Image) BuildFileName() string

BuildFileName ...

type Images

type Images []Image

Images ...

type Land

type Land struct {
	UID         string
	Name        string
	Link        string
	Info        string
	Area        string
	Price       string
	Description string
	Date        string
	AddedAt     time.Time
	Images      Images
	Source      string
}

Land info about land

func (Land) DownloadImage

func (l Land) DownloadImage()

DownloadImage ...

func (Land) Save

func (l Land) Save(client *mongo.Client) error

Save ...

type Lands

type Lands []Land

Lands ...

func ParseAvito

func ParseAvito(r Realestate, c *colly.Collector) (lands Lands)

ParseAvito ...

func ParseVladis

func ParseVladis(r Realestate, c *colly.Collector) (lands Lands)

ParseVladis ...

func Run

func Run(conf Config) Lands

Run ...

func (Lands) Append

func (lx Lands) Append(lands Lands) Lands

Append ...

type Realestate

type Realestate struct {
	Name      string
	URL       string
	URLPrefix string
}

Realestate ...

func (Realestate) ParseList

func (r Realestate) ParseList(parse RealestateParse) Lands

ParseList ...

type RealestateParse

type RealestateParse func(r Realestate, c *colly.Collector) Lands

RealestateParse ...

Jump to

Keyboard shortcuts

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