leboncoin

package
v0.0.0-...-f7b771d Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const BaseURI = "https://api.leboncoin.fr/finder/search"

BaseURI is the base URI of the REST API.

Variables

View Source
var Categories = map[int]string{
	1:  "vehicules",
	2:  "voitures",
	3:  "motos",
	4:  "caravaning",
	5:  "utilitaires",
	6:  "equipement_auto",
	7:  "nautisme",
	8:  "immobilier",
	9:  "ventes_immobilieres",
	10: "locations",
	11: "colocations",
	12: "locations_gites",
	13: "bureaux_commerces",
}

Categories is the list of categories.

View Source
var Enums = map[string][]string{
	"moto_type":        []string{"moto", "scooter", "quad"},
	"moto_brand":       []string{"aprilia", "bmw"},
	"fuel":             []string{},
	"gearbox":          []string{},
	"brand":            []string{},
	"real_estate_type": []string{},
	"clothing_type":    []string{"1", "2"},
	"clothing_st":      []string{"4"},
	"clothing_tag":     []string{"robe"},
	"clothing_brand_a": []string{"abercrombiefitch"},
	"clothing_color_a": []string{"noir"},
}

Enums is the list of enums with the possible values available for filtering.

View Source
var ErrCategoryEmpty = errors.New("category must not be empty")

ErrCategoryEmpty is raised when the category is empty.

View Source
var ErrCategoryNotExists = errors.New("category does not exist")

ErrCategoryNotExists is raised when the category does not exist.

View Source
var ErrDepartmentFormatIncorrect = errors.New("format of department is incorrect")

ErrDepartmentFormatIncorrect is raised when department format is incorrect.

View Source
var Ranges = []string{"cubic_capacity", "price", "regdate", "mileage", "rooms"}

Ranges is the list of ranges available for filtering.

Functions

This section is empty.

Types

type Filters

type Filters struct {
	Ranges map[string]map[string]int
	Enums  map[string][]string
}

Filters are the filters of the search.

type LeBonCoin

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

LeBonCoin is a client for LeBonCoin REST API.

func New

func New() *LeBonCoin

New returns a new client for LeBonCoin REST API.

func (*LeBonCoin) Search

func (lbc *LeBonCoin) Search(search *Search) (*protocols.Response, error)

Search ...

type Location

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

Location is the location for the search.

func NewDepartmentLocation

func NewDepartmentLocation(department int) Location

NewDepartmentLocation returns a new Location from the given department.

func NewRegionLocation

func NewRegionLocation(region int) Location

NewRegionLocation returns a new Location from the given region.

func (*Location) String

func (l *Location) String() string

String returns a string representation of the Location.

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

Search is the searching structure.

func NewSearch

func NewSearch(categoryID int, keywords string, location Location, filters *Filters) (*Search, error)

NewSearch returns a new Search.

func NewSearchFromURL

func NewSearchFromURL(u string) (*Search, error)

NewSearchFromURL returns a new Search from the given URL.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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