polovniauto

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnexpectedStatusCode = errors.New("unexpected status code")
)

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(l *logger.Logger, cfg *Config) *Client

func (*Client) GetCarChassisList added in v1.1.0

func (c *Client) GetCarChassisList(ctx context.Context) (map[string]string, error)

GetCarChassisList retrieves the list of car body types.

func (*Client) GetCarsList added in v1.1.0

func (c *Client) GetCarsList(ctx context.Context) (map[string][]string, error)

GetCarsList retrieves the list of car brands and models.

func (*Client) GetNewListings

func (c *Client) GetNewListings(ctx context.Context, params map[string]string) ([]Listing, error)

GetNewListings retrieves new car listings based on the provided parameters.

func (*Client) GetRegionsList added in v1.1.0

func (c *Client) GetRegionsList(ctx context.Context) (map[string]string, error)

GetRegionsList retrieves the list of regions.

type Config

type Config struct {
	PageLimit   int    `envconfig:"PAGE_LIMIT" default:"9999"`
	ChromeWSURL string `envconfig:"CHROME_WS_URL" default:"ws://chrome:3000"`
}

func NewConfig

func NewConfig() *Config

type Listing

type Listing struct {
	ID           string
	Title        string
	Price        string
	Year         string
	EngineVolume string
	Transmission string
	BodyType     string
	Mileage      string
	Location     string
	Link         string
	Date         time.Time
}

Listing represents a car listing.

Jump to

Keyboard shortcuts

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