dvlaves

package
v0.0.0-...-4eb781d Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 4 Imported by: 0

README

dvlaves

Testing Locally

The UAT environment can be used for testing locally, the URL is

https://uat.driver-vehicle-licensing.api.gov.uk/vehicle-enquiry/v1/vehicles

A small number of VRMs can be used in the UAT environment, each VRM below will return a corresponding status code.

VRM         Status Code
------------------------
AA19AAA     200
A19EEE      200
AA19PPP     200
L2WPS       200
0000        400

Documentation

Index

Constants

View Source
const (
	ProductionURI = "https://driver-vehicle-licensing.api.gov.uk/"
	UATURI        = "https://uat.driver-vehicle-licensing.api.gov.uk/"

	TaxStatusTaxed              = "Taxed"
	TaxStatusUntaxed            = "Untaxed"
	TaxStatusNotTaxedForRoadUse = "Not Taxed for on Road Use"
	TaxStatusSORN               = "SORN"

	MOTStatusNotFound  = "No details held by DVLA"
	MOTStatusNoResults = "No results returned"
	MOTStatusNotValid  = "Not valid"
	MOTStatusValid     = "Valid"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*jsonclient.Client
}

func NewClient

func NewClient(baseURL, key string) *Client

NewClient creates a new vehicle service client.

func (*Client) GetVehicleByVRM

func (c *Client) GetVehicleByVRM(ctx context.Context, vrm string) (res *Vehicle, err error)

type Error

type Error struct {
	Status string `json:"status"`
	Code   string `json:"code"`
	Title  string `json:"title"`
	Detail string `json:"detail"`
}

type Errors

type Errors struct {
	Errors []Error `json:"errors"`
}

type VESVRMRequest

type VESVRMRequest struct {
	RegistrationNumber string `json:"registrationNumber"`
}

type Vehicle

type Vehicle struct {
	RegistrationNumber string `json:"registrationNumber"`

	FirstRegistrationMonth     string  `json:"monthOfFirstRegistration"`
	FirstDVLARegistrationMonth *string `json:"monthOfFirstDvlaRegistration"`
	DateOfLastV5CIssued        string  `json:"dateOfLastV5CIssued"`

	MarkedForExport bool    `json:"markedForExport"`
	TypeApproval    *string `json:"typeApproval"`
	RevenueWeight   *int    `json:"revenueWeight"`
	EuroStatus      *string `json:"euroStatus"`
	ArtEndDate      *string `json:"artEndDate"`

	TaxStatus  string  `json:"taxStatus"`
	TaxDueDate *string `json:"taxDueDate"`

	MOTStatus     string  `json:"motStatus"`
	MOTExpiryDate *string `json:"motExpiryDate"`

	Make                 string `json:"make"`
	Colour               string `json:"colour"`
	EngineCapacity       int    `json:"engineCapacity"` // cc
	CO2Emissions         *int   `json:"co2Emissions"`   // g/km
	RealDrivingEmissions string `json:"realDrivingEmissions"`
	FuelType             string `json:"fuelType"`
	Wheelplan            string `json:"wheelplan"`
	YearOfManufacture    int    `json:"yearOfManufacture"`
}

Jump to

Keyboard shortcuts

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