autoria

package
v0.0.34 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

func New

func New(key string) *API

func (*API) CarInfo

func (api *API) CarInfo(ID string) (car *CarInfo, err error)

func (*API) CarPhotos

func (api *API) CarPhotos(ID string) (res *PhotosResponse, err error)

func (*API) ConvertNewToOld

func (api *API) ConvertNewToOld(values url.Values) (url.Values, error)

func (*API) ConvertOldToNew

func (api *API) ConvertOldToNew(values url.Values) (url.Values, error)

func (*API) SearchCars

func (api *API) SearchCars(values url.Values) (*SearchResponse, error)

type Car

type Car struct {
	Description  string `json:"description"`
	Version      string `json:"version"`
	OnModeration bool   `json:"onModeration"`
	Year         int    `json:"year"`
	AutoID       int    `json:"autoId"`
	StatusID     int    `json:"statusId"`
	WithVideo    bool   `json:"withVideo"`
	Race         string `json:"race"`
	RaceInt      int    `json:"raceInt"`
	FuelName     string `json:"fuelName"`
	GearboxName  string `json:"gearboxName"`
	IsSold       bool   `json:"isSold"`
	MainCurrency string `json:"mainCurrency"`
	CategoryID   int    `json:"categoryId"`
}

type CarInfo

type CarInfo struct {
	LocationCityName string `json:"locationCityName"`
	MarkName         string `json:"markName"`
	MarkID           uint32 `json:"markId"`
	ModelName        string `json:"modelName"`
	ModelID          uint32 `json:"modelId"`
	LinkToView       string `json:"linkToView"`
	PriceUSD         int64  `json:"USD"`
	PriceHRN         int64  `json:"UAH"`
	PriceEUR         int64  `json:"EUR"`
	Car              Car    `json:"autoData"`
}

type Photo

type Photo struct {
	PhotoID  int      `json:"photo_id"`
	AutoID   int      `json:"auto_id"`
	Status   int      `json:"status"`
	Checked  int      `json:"checked"`
	Standard int      `json:"standard"`
	DateAdd  string   `json:"date_add"`
	URLPath  string   `json:"url"`
	Formats  []string `json:"formats"`
}

func (Photo) URL

func (photo Photo) URL() string

type PhotosResponse

type PhotosResponse struct {
	Status int                    `json:"status"`
	Data   map[string]interface{} `json:"data"`
	Photos []Photo
}

type SearchResponse

type SearchResponse struct {
	Result struct {
		SearchResult SearchResultResponse `json:"search_result"`
	} `json:"result"`
}

type SearchResultResponse

type SearchResultResponse struct {
	Cars   []string `json:"ids"`
	Count  int64    `json:"count"`
	LastID int64    `json:"last_id"`
}

Jump to

Keyboard shortcuts

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