models

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2022 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package models provides various abstractions/representations of real-world concepts or objects.

Index

Constants

View Source
const (
	Amsterdam      = City("Amsterdam")
	TheHague       = City("The Hague")
	Rotterdam      = City("Rotterdam")
	Zwolle         = City("Zwolle")
	DenBosch       = City("Den Bosch")
	Haarlem        = City("IND Haarlem")
	Utrecht        = City("Expat center Utrecht")
	ExpatRotterdam = City("Expat center Rotterdam")
	ExpatEnschede  = City("Expat center Enschede")
)

Constants for various cities in The Netherlands.

Variables

View Source
var BiometricCities = map[string]City{
	"AM":                               Amsterdam,
	"DH":                               TheHague,
	"RO":                               Rotterdam,
	"ZW":                               Zwolle,
	"DB":                               DenBosch,
	"6b425ff9f87de136a36b813cccf26e23": Haarlem,
	"fa24ccf0acbc76a7793765937eaee440": Utrecht,
	"3535aca0fb9a2e8e8015f768fb3fa69d": ExpatEnschede,
	"f0ef3c8f0973875936329d713a68c5f3": ExpatRotterdam,
}

BiometricCities is the list of cities that offer appointments for biometrics.

View Source
var ResidenceCardCities = map[string]City{
	"AM": Amsterdam,
	"DH": TheHague,
	"RO": Rotterdam,
	"ZW": Zwolle,
	"DB": DenBosch,
}

ResidenceCardCities is the list of cities that offer appointments to collect the residence card.

View Source
var ResidenceStickerCities = map[string]City{
	"AM": Amsterdam,
	"DH": TheHague,
	"RO": Rotterdam,
	"ZW": Zwolle,
	"DB": DenBosch,
}

ResidenceStickerCities is the list of cities that offer appointments for the residence sticker.

Functions

This section is empty.

Types

type Availabilities

type Availabilities struct {
	City   City
	Status string         `json:"status"`
	Data   []Availability `json:"data"`
}

Availabilities is a representation of the response received from IND when after selecting a city.

The City field has been added for convenience to associate the availabilities to the city.

func (Availabilities) Equal

func (a Availabilities) Equal(other Availabilities) bool

Equal verifies the Availabilities structs are identical.

type Availability

type Availability struct {
	Key       string `json:"key"`
	Date      string `json:"date"`
	StartTime string `json:"startTime"`
	EndTime   string `json:"endTime"`
	Parts     int    `json:"parts"`
}

Availability is a representation of the response.data field of the response received from IND when after selecting a city.

func (Availability) Equal

func (a Availability) Equal(other Availability) bool

Equal verifies the Availability structs are identical.

type City

type City string

City is an abstraction over string for the name of a city.

func (City) Abbrev

func (c City) Abbrev() string

Abbrev abbreviates the city to its initials.

func (City) String

func (c City) String() string

String provides the string representation of the City.

type URL

type URL struct {
	City       City
	Endpoint   string
	ProductKey string
}

URL holds a URL and the name of the city the URL is associated with.

func NewURL

func NewURL(city City, productKey string) URL

NewURL creates a Req model from the input City and product key.

func (URL) Equal

func (u URL) Equal(other URL) bool

Equal verifies the URLs are identical.

func (URL) Process

func (u URL) Process(c client.Client) (Availabilities, error)

Process fetches appointments for the URL struct.

Jump to

Keyboard shortcuts

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