cargotypes

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2023 License: MIT Imports: 1 Imported by: 0

README

Go Types of Car

This repository provides shared data types for the Car domain microservice API.

In particular, they were derived from the OpenAPI Specification of Car.

Usage

To use the types in your project, add the following to your go.mod file:

require github.com/ccsapp/cargotypes v1.1.0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddCarJSONRequestBody

type AddCarJSONRequestBody = Car

AddCarJSONRequestBody defines body for AddCar for application/json ContentType.

type Car

type Car struct {
	// Brand Data that specifies the brand name of the Vehicle manufacturer
	Brand string `json:"brand"`

	// DynamicData Data that changes during a car's operation
	DynamicData DynamicData `json:"dynamicData"`

	// Model Data that specifies the particular type of Vehicle
	Model string `json:"model"`

	// ProductionDate Data that specifies the official date the vehicle was declared to have exited production by the manufacturer.
	ProductionDate         openapiTypes.Date      `json:"productionDate"`
	TechnicalSpecification TechnicalSpecification `json:"technicalSpecification"`

	// Vin A Vehicle Identification Number (VIN) which uniquely identifies a car
	Vin Vin `json:"vin"`
}

Car A specific type of vehicle

type DynamicData

type DynamicData struct {
	// DoorsLockState Data that specifies whether an object is locked or unlocked
	DoorsLockState DynamicDataLockState   `json:"doorsLockState"`
	EngineState    DynamicDataEngineState `json:"engineState"`

	// FuelLevelPercentage Data that specifies the relation of remaining fuelCapacity to the maximum fuelCapacity in percentage
	FuelLevelPercentage int `json:"fuelLevelPercentage"`

	// Position Data that specifies the GeoCoordinate of a car
	Position DynamicDataPosition `json:"position"`

	// TrunkLockState Data that specifies whether an object is locked or unlocked
	TrunkLockState DynamicDataLockState `json:"trunkLockState"`
}

DynamicData Data that changes during a car's operation

type DynamicDataEngineState

type DynamicDataEngineState string

DynamicDataEngineState defines model for DynamicData.EngineState.

const (
	OFF DynamicDataEngineState = "OFF"
	ON  DynamicDataEngineState = "ON"
)

Defines values for DynamicDataEngineState.

type DynamicDataLockState

type DynamicDataLockState string

DynamicDataLockState defines model for DynamicData.DoorsLockState.

const (
	LOCKED   DynamicDataLockState = "LOCKED"
	UNLOCKED DynamicDataLockState = "UNLOCKED"
)

Defines values for DynamicDataLockState.

type DynamicDataPosition

type DynamicDataPosition struct {
	// Latitude Data that specifies the distance from the equator
	Latitude float32 `json:"latitude"`

	// Longitude Data that specifies the distance east or west from a line (meridian) passing through Greenwich
	Longitude float32 `json:"longitude"`
}

type TechnicalSpecification

type TechnicalSpecification struct {
	// Color Data on the description of the paint job of a car
	Color string `json:"color"`

	// Consumption Data that specifies the amount of fuel consumed during car operation in units per 100 kilometers
	Consumption TechnicalSpecificationConsumption `json:"consumption"`

	// Emissions Data that specifies the CO2 emitted by a car during operation in gram per kilometer
	Emissions TechnicalSpecificationEmissions `json:"emissions"`

	// Engine A physical unit that converts fuel into movement
	Engine TechnicalSpecificationEngine `json:"engine"`

	// Fuel Data that defines the source of energy that powers the car
	Fuel TechnicalSpecificationFuel `json:"fuel"`

	// FuelCapacity Data that specifies the amount of fuel that can be carried with the car
	FuelCapacity string `json:"fuelCapacity"`

	// NumberOfDoors Data that defines the number of doors that are built into a car
	NumberOfDoors int `json:"numberOfDoors"`

	// NumberOfSeats Data that defines the number of seats that are built into a car
	NumberOfSeats int `json:"numberOfSeats"`

	// Tire A physical unit that serves as the point of contact between a car and the ground
	Tire TechnicalSpecificationTire `json:"tire"`

	// Transmission A physical unit responsible for managing the conversion rate of the engine (can be automated or manually operated)
	Transmission TechnicalSpecificationTransmission `json:"transmission"`

	// TrunkVolume Data on the physical volume of the trunk in liters
	TrunkVolume int `json:"trunkVolume"`

	// Weight Data that specifies the total weight of a car when empty in kilograms (kg)
	Weight int `json:"weight"`
}

TechnicalSpecification defines model for technicalSpecification.

type TechnicalSpecificationConsumption

type TechnicalSpecificationConsumption struct {
	// City Data that specifies the amount of fuel that is consumed when driving within the city in: kW/100km or l/100km
	City float32 `json:"city"`

	// Combined Data that specifies the combined amount of fuel that is consumed in: kW / 100 km or l / 100 km
	Combined float32 `json:"combined"`

	// Overland Data that specifies the amount of fuel that is consumed when driving outside of a city in: kW/100km or l/100km
	Overland float32 `json:"overland"`
}

type TechnicalSpecificationEmissions

type TechnicalSpecificationEmissions struct {
	// City Data that specifies the amount of emissions when driving within the city in: g CO2 / km
	City float32 `json:"city"`

	// Combined Data that specifies the combined amount of emissions in: g CO2 / km. The combination is done by the manufacturer according to an industry-specific standard
	Combined float32 `json:"combined"`

	// Overland Data that specifies the amount of emissions when driving outside of a city in: g CO2 / km
	Overland float32 `json:"overland"`
}

type TechnicalSpecificationEngine

type TechnicalSpecificationEngine struct {
	// Power Data on the power the engine can provide in kW
	Power int `json:"power"`

	// Type Data that contains the manufacturer-given type description of the engine
	Type string `json:"type"`
}

type TechnicalSpecificationFuel

type TechnicalSpecificationFuel string

TechnicalSpecificationFuel Data that defines the source of energy that powers the car

const (
	DIESEL       TechnicalSpecificationFuel = "DIESEL"
	ELECTRIC     TechnicalSpecificationFuel = "ELECTRIC"
	HYBRIDDIESEL TechnicalSpecificationFuel = "HYBRID_DIESEL"
	HYBRIDPETROL TechnicalSpecificationFuel = "HYBRID_PETROL"
	PETROL       TechnicalSpecificationFuel = "PETROL"
)

Defines values for TechnicalSpecificationFuel.

type TechnicalSpecificationTire

type TechnicalSpecificationTire struct {
	// Manufacturer Data denoting the company responsible for the creation of a physical unit
	Manufacturer string `json:"manufacturer"`

	// Type Data that contains the manufacturer-given type description of the tire
	Type string `json:"type"`
}

type TechnicalSpecificationTransmission

type TechnicalSpecificationTransmission string

TechnicalSpecificationTransmission A physical unit responsible for managing the conversion rate of the engine (can be automated or manually operated)

const (
	AUTOMATIC TechnicalSpecificationTransmission = "AUTOMATIC"
	MANUAL    TechnicalSpecificationTransmission = "MANUAL"
)

Defines values for TechnicalSpecificationTransmission.

type Vin

type Vin = string

Vin A Vehicle Identification Number (VIN) which uniquely identifies a car

type VinParam

type VinParam = Vin

VinParam A Vehicle Identification Number (VIN) which uniquely identifies a car

Jump to

Keyboard shortcuts

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