models

package
v0.0.0-...-a8bd3f9 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2017 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Car

type Car struct {
	StoreID       int64     `json:"store_id,omitempty" storm:"id"`
	InsertionDate time.Time `json:"insertion_date,omitempty"`
	Brand         string    `json:"brand,omitempty" storm:"index"`
	Model         string    `json:"model,omitempty" storm:"index"`
	Gearbox       string    `json:"gearbox,omitempty" storm:"index"`
	Fuel          string    `json:"fuel,omitempty" storm:"index"`
	Mileage       int       `json:"mileage,omitempty"`
	RegDate       int       `json:"reg_date,omitempty"`
	Price         float64   `json:"price,omitempty"`
	ZipCode       int       `json:"zip_code,omitempty"`
	City          string    `json:"city,omitempty"`
	Department    string    `json:"department,omitempty"`
	Region        string    `json:"region,omitempty"`
	UploadType    string    `json:"upload_type,omitempty"`
	Title         string    `json:"title,omitempty"`
	BodyMD5       string    `json:"body_md_5,omitempty"`
	WordCount     int       `json:"word_count,omitempty"`
	MaxListID     int64     `json:"max_list_id,omitempty"`
}

Car is a simple struct holding car information

func NewCarFromParameters

func NewCarFromParameters(params dialogflow.CarSearchParameters) (*Car, error)

NewCarFromParameters returns a new car from dialogflow's parameters

func NewFromCSV

func NewFromCSV(line []string) (*Car, error)

NewFromCSV parses a single CSV line into an actual Car struct

func (Car) Estimate

func (c Car) Estimate() string

Estimate gets the estimated value and formats it

func (Car) GetEstimate

func (c Car) GetEstimate() (float64, error)

GetEstimate estimates the price of a car

func (Car) Save

func (c Car) Save() error

Save saves the given car to the database

func (Car) Summarize

func (c Car) Summarize() string

Summarize returns a string representing the car

Jump to

Keyboard shortcuts

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