client

package
v0.0.0-...-3c90a67 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDates

func GetDates(service DmvService, office FieldOffice) (dates []string, err error)

GetDates ["2024-02-16T00:00:00", "2024-03-22T00:00:00"]

func GetTimes

func GetTimes(service DmvService, office FieldOffice, date string) (times []string, err error)

GetTimes 24h format, f.e. ["10:20","11:00","11:20","13:40","14:20","14:40","15:20","15:40"]

func NewRetryableClient

func NewRetryableClient() *http.Client

Types

type Appointment

type Appointment struct {
	NumberItems           int    `json:"numberItems"`
	OfficeID              string `json:"officeId"`
	RequestDate           string `json:"requestDate"`
	RequestTime           string `json:"requestTime"`
	RequestTask           string `json:"requestTask"`
	FirstName             string `json:"firstName"`
	LastName              string `json:"lastName"`
	TelNumber             string `json:"telNumber"`
	Token                 string `json:"token"`
	HasPrevPermit         bool   `json:"hasPrevPermit"`
	Dob                   string `json:"dob"`
	DlNumber              string `json:"dlNumber"`
	SafetyCourseCompleted string `json:"safetyCourseCompleted"`
}

type AppointmentResponse

type AppointmentResponse struct {
	FindApptResponse struct {
		Cheader []any `json:"cheader,omitempty"`
		Status  struct {
			Success string `json:"bsuccess,omitempty"`
		} `json:"bstatus,omitempty"`
		Payload struct {
			Hold          []any `json:"dhold,omitempty"`
			Office        []any `json:"doffice,omitempty"`
			FoaStatusCode struct {
				StatusCode string `json:"dstatusCode,omitempty"`
			} `json:"dfoaStatusCode,omitempty"`
		} `json:"dpayload,omitempty"`
	} `json:"dFindApptResponse,omitempty"`
}

func PostAppointment

func PostAppointment(appointment Appointment) (response *AppointmentResponse, err error)

type AuthCheck

type AuthCheck struct {
	User      string `json:"user,omitempty"`
	FirstName string `json:"first_name,omitempty"`
	LastName  string `json:"last_name,omitempty"`
	UID       bool   `json:"uid,omitempty"`
}

func GetAuthCheck

func GetAuthCheck() (auth *AuthCheck, err error)

type Availability

type Availability struct {
	PublicID     string `json:"publicId,omitempty"`
	Name         string `json:"name,omitempty"`
	AddressLine1 string `json:"addressLine1,omitempty"`
	AddressZip   string `json:"addressZip,omitempty"`
}

func GetAvailable

func GetAvailable(service DmvService) (availabilityList []Availability, err error)

type Branch

type Branch struct {
	PublicID     string `json:"publicId,omitempty"`
	Name         string `json:"name,omitempty"`
	AddressLine1 string `json:"addressLine1,omitempty"`
	AddressZip   string `json:"addressZip,omitempty"`
}

func GetBranches

func GetBranches() (branches []Branch, err error)

type DmvFieldOfficeHours

type DmvFieldOfficeHours struct {
	Sunday    Sunday    `json:"sunday,omitempty"`
	Monday    Monday    `json:"monday,omitempty"`
	Tuesday   Tuesday   `json:"tuesday,omitempty"`
	Wednesday Wednesday `json:"wednesday,omitempty"`
	Thursday  Thursday  `json:"thursday,omitempty"`
	Friday    Friday    `json:"friday,omitempty"`
	Saturday  Saturday  `json:"saturday,omitempty"`
}

type DmvService

type DmvService struct {
	PublicID      string `json:"publicId,omitempty"`
	Name          string `json:"name,omitempty"`
	Active        bool   `json:"active,omitempty"`
	PublicEnabled bool   `json:"publicEnabled,omitempty"`
}

func GetServices

func GetServices() (services []DmvService, err error)

type FieldOffice

type FieldOffice struct {
	ID       int    `json:"id,omitempty"`
	Slug     string `json:"slug,omitempty"`
	Link     string `json:"link,omitempty"`
	Title    Title  `json:"title,omitempty"`
	Meta     Meta   `json:"meta,omitempty"`
	Distance bool   `json:"distance,omitempty"`
}

func GetFieldOffices

func GetFieldOffices(query string) (offices []FieldOffice, err error)

func (FieldOffice) LatLon

func (o FieldOffice) LatLon() (lat, lon float64)

func (FieldOffice) String

func (o FieldOffice) String() string

type Friday

type Friday struct {
	Start string `json:"start,omitempty"`
	End   string `json:"end,omitempty"`
}

type Meta

type Meta struct {
	PublicID    string              `json:"dmv_field_office_public_id,omitempty"`
	Appointment string              `json:"dmv_field_office_appointment,omitempty"`
	Street      string              `json:"dmv_field_office_street,omitempty"`
	City        string              `json:"dmv_field_office_city,omitempty"`
	Zipcode     string              `json:"dmv_field_office_zipcode,omitempty"`
	Latitude    string              `json:"dmv_field_office_latitude,omitempty"`
	Longitude   string              `json:"dmv_field_office_longitude,omitempty"`
	Hours       DmvFieldOfficeHours `json:"dmv_field_office_hours,omitempty"`
	Phone       string              `json:"dmv_field_office_phone,omitempty"`
}

type Monday

type Monday struct {
	Start string `json:"start,omitempty"`
	End   string `json:"end,omitempty"`
}

type Saturday

type Saturday struct {
	Start string `json:"start,omitempty"`
	End   string `json:"end,omitempty"`
}

type Sunday

type Sunday struct {
	Start string `json:"start,omitempty"`
	End   string `json:"end,omitempty"`
}

type Thursday

type Thursday struct {
	Start string `json:"start,omitempty"`
	End   string `json:"end,omitempty"`
}

type Title

type Title struct {
	Rendered string `json:"rendered,omitempty"`
}

type Tuesday

type Tuesday struct {
	Start string `json:"start,omitempty"`
	End   string `json:"end,omitempty"`
}

type Wednesday

type Wednesday struct {
	Start string `json:"start,omitempty"`
	End   string `json:"end,omitempty"`
}

Jump to

Keyboard shortcuts

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