Help us shape the future of Go! Take the 2026 Go Developer Survey

vinner

package module
v0.0.0-...-b79b1b8 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InvalidModelsRequest = fmt.Errorf("vehicle make is required")
View Source
var InvalidVIN = fmt.Errorf("invalid VIN")

Functions

func WithTimeout

func WithTimeout(timeout time.Duration) clientOptionFunc

func WithTransport

func WithTransport(transport http.RoundTripper) clientOptionFunc

Types

type Client

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

func NewService

func NewService(opts ...clientOptionFunc) *Client

func (*Client) GetMakes

func (s *Client) GetMakes(ctx context.Context) ([]string, error)

func (*Client) GetModels

func (s *Client) GetModels(ctx context.Context, req GetModelsRequest) ([]string, error)

func (*Client) GetVehicle

func (s *Client) GetVehicle(ctx context.Context, vin string) (*Vehicle, error)

type GetModelsRequest

type GetModelsRequest struct {
	Make string
	Year int
}

type Vehicle

type Vehicle struct {
	VIN       string      `json:"vin"`
	Year      int         `json:"year"`
	Make      string      `json:"make"`
	Model     string      `json:"model"`
	Trim      string      `json:"trim"`
	Doors     int         `json:"doors"`
	BodyClass VehicleType `json:"body_class"`
}

type VehicleType

type VehicleType string
const (
	Convertible                    VehicleType = "Convertible"
	Minivan                        VehicleType = "Minivan"
	Coupe                          VehicleType = "Coupe"
	LowSpeedVehicle                VehicleType = "Low Speed Vehicle (LSV)"
	Hatchback                      VehicleType = "Hatchback"
	StandardMotorcycle             VehicleType = "Standard Motorcycle"
	SportUtilityVehicle            VehicleType = "Sport Utility Vehicle (SUV)"
	CrossoverUtilityVehicle        VehicleType = "Crossover Utility Vehicle (CUV)"
	Van                            VehicleType = "Van"
	Roadster                       VehicleType = "Roadster"
	Truck                          VehicleType = "Truck"
	Scooter                        VehicleType = "Scooter"
	Sedan                          VehicleType = "Sedan"
	Wagon                          VehicleType = "Wagon"
	Bus                            VehicleType = "Bus"
	Pickup                         VehicleType = "Pickup"
	Trailer                        VehicleType = "Trailer"
	TractorTruck                   VehicleType = "Tractor Truck"
	Streetcar                      VehicleType = "Streetcar"
	AllTerrainVehicle              VehicleType = "All Terrain Vehicle (ATV)"
	SchoolBus                      VehicleType = "School Bus"
	RacingCar                      VehicleType = "Racing Car"
	SportMotorcycle                VehicleType = "Sport Motorcycle"
	TouringMotorcycle              VehicleType = "Touring Motorcycle"
	CruiserMotorcycle              VehicleType = "Cruiser Motorcycle"
	TrikeMotorcycle                VehicleType = "Trike Motorcycle"
	DirtBike                       VehicleType = "Dirt Bike"
	DualSportMotorcycle            VehicleType = "Dual Sport Motorcycle"
	EnduroVehicle                  VehicleType = "Enduro Vehicle"
	MiniBikeMotorcycle             VehicleType = "Minibike Motorcycle"
	GoKart                         VehicleType = "Go Kart"
	SideCarMotorcycle              VehicleType = "Side Car Motorcycle"
	CustomMotorcycle               VehicleType = "Custom Motorcycle"
	CargoVan                       VehicleType = "Cargo Van"
	Snowmobile                     VehicleType = "Snowmobile"
	StreetMotorcycle               VehicleType = "Street Motorcycle"
	EnclosedThreeWheelMotorcycle   VehicleType = "Enclosed Three Wheeled Motorcycle"
	UnenclosedThreeWheelMotorcycle VehicleType = "Unenclosed Three Wheeled Motorcycle"
	Moped                          VehicleType = "Moped"
	RecreationalOffRoadVehicle     VehicleType = "Recreational Off-Road Vehicle (ROV)"
	Motorhome                      VehicleType = "Motorhome"
	CrossCountryMotorcycle         VehicleType = "Cross Country Motorcycle"
	UnderboneMotorcycle            VehicleType = "Underbone Motorcycle"
	StepVan                        VehicleType = "Step Van"
	MotocrossVehicle               VehicleType = "MotocrossVehicle"
	CompetitionMotorcycle          VehicleType = "Competition Motorcycle"
	Limousine                      VehicleType = "Limousine"
	SportUtilityTruck              VehicleType = "Sport Utility Truck (SUT)"
	GolfCart                       VehicleType = "Golf Cart"
	UnkownVehicleType              VehicleType = "Unknown"
)

Jump to

Keyboard shortcuts

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