core

package
v1.1.0 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: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateContext

func CreateContext()

func GetVehicle

func GetVehicle(key hsk.Key) (hsk.Record, error)

func GetVehicles

func GetVehicles(page, pagesize int) (records.Page, 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 Engine

type Engine struct {
	Code         string
	SerialNo     string
	Output       uint //kw
	Fuel         string
	Displacement string
}

type Gearbox

type Gearbox struct {
	Code     string
	SerialNo string
	Gears    int
	Type     string
}

type SeriesInfo

type SeriesInfo struct {
	Model         string
	Manufacturer  string
	AssemblyPlant string
	Month         int
	Year          int
	Trim          string
}

type Vehicle

type Vehicle struct {
	VINKey    hsk.Key
	FullVIN   string
	Series    SeriesInfo
	Colour    string
	PaintNo   string
	Engine    Engine
	Gearbox   Gearbox
	BodyStyle bodytype.Enum
	Doors     int
	Extra     []string
	Spare     bool
	Service   bool
	Condition string
	Issues    string `hsk:"null"`
	Mileage   int

	Info          string `hsk:"size(128)"`
	Year          int    `hsk:"null"`
	HasNatis      bool   `hsk:"default(false)"`
	EstValue      int64
	LicenseExpiry time.Time
}

func NewVehicle added in v1.1.0

func NewVehicle() Vehicle

func (Vehicle) Create

func (obj Vehicle) Create() (hsk.Key, error)

func (Vehicle) Valid

func (o Vehicle) Valid() error

type VehicleContext

type VehicleContext interface {
	GetManufacturers(year int) (map[string]struct{}, error)
	GetModels(year int, manufacturer string) (map[string]struct{}, error)
	GetTrims(year int, manufacturer, model string) (map[string]struct{}, error)
	GetVehicle(key hsk.Key) (Vehicle, error)
	FindVehicles(page, size int) (records.Page, error)
	CreateVehicle(obj Vehicle) (hsk.Key, error)
	UpdateVehicle(key hsk.Key, obj Vehicle) error
}

func Context added in v1.0.10

func Context() VehicleContext

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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