core

package
Version: v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2020 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateContext

func CreateContext()

func GetAllRegions

func GetAllRegions(page, size int) (records.Page, error)

func GetManufacturers

func GetManufacturers(year int) (map[string]struct{}, error)

func GetModels

func GetModels(year int, manufacturer string) (map[string]struct{}, error)

func GetTrims

func GetTrims(year int, manufacturer, model string) (map[string]struct{}, error)

func Manufacturers

func Manufacturers(year int) regionCalc

func Models

func Models(year int, manufacturerName string) regionCalc

func Shutdown

func Shutdown()

func Trim

func Trim(year int, manufacturer, model string) regionCalc

Types

type AssemblyPlant

type AssemblyPlant struct {
	Code      string
	Name      string
	Country   string
	StartYear int
	EndYear   int
	Series    []Series
}

func (AssemblyPlant) Valid

func (m AssemblyPlant) Valid() error

type Body

type Body struct {
	Code      string
	Layout    string
	Doors     int
	StartYear int
	EndYear   int
}

func (Body) Valid

func (m Body) Valid() error

type BodyLayout

type BodyLayout = int
const (
	Sedan BodyLayout = iota
	Coupe
	Hatchback
	Van
	PickupTruck
	StationWagon
	Convertible
	SUV
	Fastback
)

type Country

type Country struct {
	RegionCode    string
	Name          string
	StartChar     string
	EndChar       string
	Manufacturers []Manufacturer
}

func (*Country) HasCode

func (r *Country) HasCode(regionCode string) bool

func (Country) Valid

func (m Country) Valid() error

type DriveLayout

type DriveLayout = int
const (
	FrontFront DriveLayout = iota
	FrontRear
	FrontFour
	MidFront
	MidRear
	MidFour
	RearFront
	RearRear
	RearFour
)

type Engine

type Engine struct {
	Family            string
	Series            string
	Code              string
	Displacement      int
	FuelType          string
	Layout            string
	Cylinders         int
	Valvetrain        string
	ValvesPerCylinder int
	PowerKW           int
	PowerAt           int
	TorqueNm          int
	TorqueAt          int
	Induction         string
	StartYear         int
	EndYear           int
}

func (Engine) Valid

func (m Engine) Valid() error

type EngineLayout

type EngineLayout = int
const (
	Inline EngineLayout = iota
	V
	Rotary
	W
	Boxer
)

type FuelType

type FuelType = int
const (
	Petrol FuelType = iota
	Diesel
	Hybrid
	Electric
	LPG
)

type Gearbox

type Gearbox struct {
	SeriesCode string
	Code       string
	Gears      int
	Type       string
	StartYear  int
	EndYear    int
}

func (Gearbox) Valid

func (m Gearbox) Valid() error

type GearboxType

type GearboxType = int
const (
	Manual GearboxType = iota
	Automatic
	CVT
	Sequential
)

type Induction

type Induction = int
const (
	NA Induction = iota
	Turbo
	Supercharger
)

type Manufacturer

type Manufacturer struct {
	WMICode        string
	Name           string
	Description    string
	VehicleType    VehicleType
	AssemblyPlants []AssemblyPlant
}

func (Manufacturer) Valid

func (m Manufacturer) Valid() error

type Platform

type Platform struct {
	Code        string
	Engine      Engine
	Gearbox     Gearbox
	Body        Body
	DriveLayout string
	StartYear   int
	EndYear     int
}

func (Platform) Valid

func (m Platform) Valid() error

type Region

type Region struct {
	Name      string
	StartChar string
	EndChar   string
	Countries []Country
}

func GetRegion

func GetRegion(key hsk.Key) (Region, error)

func GetRegionByCode

func GetRegionByCode(uniquevin string) (Region, error)

func (Region) HasCode

func (r Region) HasCode(regionCode string) bool

func (Region) Update

func (p Region) Update(key hsk.Key) error

func (Region) Valid

func (m Region) Valid() error

type Series

type Series struct {
	Platform  Platform
	Spec      string
	StartYear int
	EndYear   int
}

func (Series) Valid

func (m Series) Valid() error

type VIN

type VIN struct {
	Full    string `hsk:"size(17)"`
	Unique  string `hsk:"min(2)"`
	Serial  int
	WMInfo  WMInfo
	VDSInfo vds.VDSInfo
}

VIN is the key to the entire vehicle database.

func (VIN) Valid

func (m VIN) Valid() error

Valid checks if the object's values meets the data requirements

type VINContext

type VINContext interface {
	CreateVIN(vin VIN) (hsk.Key, error)
	ValidateVIN(fullvin string) error
	BuildInfo(fullvin string) (VIN, error)
	FindVIN(fullvin string) (hsk.Record, error)
	GetVIN(key hsk.Key) (VIN, error)
	GetAllVINS(page, size int) (records.Page, error)
}

func Context

func Context() VINContext

type VehicleType

type VehicleType int
const (
	PassengerCar VehicleType = iota
	Motorcycle
	Truck
	MPV
	Trailer
	LSV // Low speed vehicle
	ATV
	Incomplete
)

func (VehicleType) String

func (s VehicleType) String() string

type WMInfo

type WMInfo struct {
	Region       string
	Country      string
	Manufacturer string
	VehicleType  string // VehicleType
}

func FindWMInfo

func FindWMInfo(uniquevin string) (WMInfo, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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