rdw_opendata_go

package module
v1.0.0 Latest Latest
Warning

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

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

README

codecov Go Report Card Go Reference License

rdw-opendata-go

This package provides a Go client for the RDW Open Data API available at https://opendata.rdw.nl. The client currently supports the following datasets:

...and many more

Installation

go get github.com/roccolangeweg/rdw-opendata-go

To use the client, you need to register for an App token. This can be requested free of charge.

Usage

package main

import (
    "context"
    "fmt"
    "log"

    rdwopendatago "github.com/roccolangeweg/rdw-opendata-go"
)

func main() {
    client := rdwopendatago.NewClient(nil, "YOUR_APP_TOKEN")
    
    vehicles, err := client.RegisteredVehicles.List(context.Background(), rdwopendatago.RegisteredVehiclesListOptions{})
    if err != nil {
        log.Fatal(err)
    }

    fmt.Println(vehicles)
}

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiError

type ApiError struct {
	StatusCode int
	Message    string
}

func (*ApiError) Error

func (e *ApiError) Error() string

type ApiLimitExceededError

type ApiLimitExceededError struct{}

func (*ApiLimitExceededError) Error

func (e *ApiLimitExceededError) Error() string

type AppTokenInvalidError

type AppTokenInvalidError struct{}

func (*AppTokenInvalidError) Error

func (e *AppTokenInvalidError) Error() string

type AppTokenMissingError

type AppTokenMissingError struct{}

func (*AppTokenMissingError) Error

func (e *AppTokenMissingError) Error() string

type Client

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

func NewClient

func NewClient(client *http.Client, appToken string) *Client

func (*Client) Do

func (c *Client) Do(req *http.Request, v interface{}) error

func (*Client) NewRequest

func (c *Client) NewRequest(ctx context.Context, method, relPath string, body, options interface{}) (*http.Request, error)

type ListOptions

type ListOptions struct {
	Offset int `url:"$offset,omitempty"`
	Limit  int `url:"$limit,omitempty"`
}

type RegisteredVehicle

type RegisteredVehicle struct {
	LicensePlate                         string `json:"kenteken"`
	VehicleType                          string `json:"voertuigsoort"`
	Brand                                string `json:"merk"`
	TradeName                            string `json:"handelsbenaming"`
	ExpirationDateMOT                    string `json:"vervaldatum_apk"`
	GrossPurchaseTax                     string `json:"bruto_bpm"`
	DateOfAscription                     string `json:"datum_tenaamstelling"`
	Interior                             string `json:"inrichting"`
	NumberOfSeats                        string `json:"aantal_zitplaatsen"`
	PrimaryColor                         string `json:"eerste_kleur"`
	SecondaryColor                       string `json:"tweede_kleur"`
	MassEmptyVehicle                     string `json:"massa_ledig_voertuig"`
	AllowedMaximumMassVehicle            string `json:"toegestane_maximum_massa_voertuig"`
	MassRoadworthy                       string `json:"massa_rijklaar"`
	MaximumMassPullingUninhibited        string `json:"maximum_massa_trekken_ongeremd"`
	MaximumMassPullingInhibited          string `json:"maximum_trekken_massa_geremd"`
	TechnicalMaximumMassVehicle          string `json:"technische_max_massa_voertuig"`
	DateOfFirstAdmission                 string `json:"datum_eerste_toelating"`
	DateOfFirstAscriptionNL              string `json:"datum_eerste_tenaamstelling_in_nederland"`
	CatalogPrice                         string `json:"catalogusprijs"`
	MaximumConstructionSpeed             string `json:"maximum_constructiesnelheid"`
	NumberOfDoors                        string `json:"aantal_deuren"`
	NumberOfWheels                       string `json:"aantal_wielen"`
	NumberOfCylinders                    string `json:"aantal_cilinders"`
	NumberOfStandingPlaces               string `json:"aantal_staanplaatsen"`
	CylinderCapacity                     string `json:"cilinderinhoud"`
	DistanceCentreCouplingToRearVehicle  string `json:"afstand_hart_koppeling_tot_achterzijde_voertuig"`
	DistanceFrontVehicleToCentreCoupling string `json:"afstand_voorzijde_voertuig_tot_hart_koppeling"`
	Length                               string `json:"lengte"`
	Width                                string `json:"breedte"`
	Wheelbase                            string `json:"wielbasis"`
	Height                               string `json:"hoogte"`
	EuropeanVehicleCategory              string `json:"europese_voertuigcategorie"`
	EuropeanVehicleCategoryAddition      string `json:"europese_voertuigcategorie_toevoeging"`
	EuropeanExecutionCategoryAddition    string `json:"europese_uitvoeringcategorie_toevoeging"`
	LocationChassisNumber                string `json:"plaats_chassisnummer"`
	Type                                 string `json:"type"`
	TypeApprovalNumber                   string `json:"typegoedkeuringsnummer"`
	Variant                              string `json:"variant"`
	Version                              string `json:"uitvoering"`
	SerialNumberChangeEUTypeApproval     string `json:"volgnummer_wijziging_eu_typegoedkeuring"`
	PowerMassRoadworthy                  string `json:"vermogen_massarijklaar"`
	ExportIndicator                      string `json:"export_indicator"`
	RecallIndicator                      string `json:"openstaande_terugroepactie_indicator"`
	TaxiIndicator                        string `json:"taxi_indicator"`
	MileageJudgement                     string `json:"tellerstandoordeel"`
	MileageJudgementCode                 string `json:"code_toelichting_tellerstandoordeel"`
	MileageLastRegistrationYear          string `json:"jaar_laatste_registratie_tellerstand"`
	RegistrationPossible                 string `json:"tenaamstellen_mogelijk"`
	WaitingForApproval                   string `json:"wacht_op_keuren"`
	WAMInsured                           string `json:"wam_verzekerd"`
	LoadingCapacity                      string `json:"laadvermogen"`
	TypeGasInstallation                  string `json:"soort_gasinstallatie"`
}

type RegisteredVehicles

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

func NewRegisteredVehicles

func NewRegisteredVehicles(client *Client) *RegisteredVehicles

func (*RegisteredVehicles) List

type RegisteredVehiclesListOptions

type RegisteredVehiclesListOptions struct {
	ListOptions
	LicensePlate string `url:"kenteken,omitempty"`
	Brand        string `url:"merk,omitempty"`
	Model        string `url:"handelsbenaming,omitempty"`
	VehicleType  string `url:"voertuigsoort,omitempty"`
}

Jump to

Keyboard shortcuts

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