Documentation ¶
Index ¶
Constants ¶
const BaseURI = "https://api.leboncoin.fr/finder/search"
BaseURI is the base URI of the REST API.
Variables ¶
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.
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.
var ErrCategoryEmpty = errors.New("category must not be empty")
ErrCategoryEmpty is raised when the category is empty.
var ErrCategoryNotExists = errors.New("category does not exist")
ErrCategoryNotExists is raised when the category does not exist.
var ErrDepartmentFormatIncorrect = errors.New("format of department is incorrect")
ErrDepartmentFormatIncorrect is raised when department format is incorrect.
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 LeBonCoin ¶
type LeBonCoin struct {
// contains filtered or unexported fields
}
LeBonCoin is a client for LeBonCoin REST API.
type Location ¶
type Location struct {
// contains filtered or unexported fields
}
Location is the location for the search.
func NewDepartmentLocation ¶
NewDepartmentLocation returns a new Location from the given department.
func NewRegionLocation ¶
NewRegionLocation returns a new Location from the given region.
type Search ¶
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 ¶
NewSearchFromURL returns a new Search from the given URL.