contract

package
v0.0.0-...-e9d3dc3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorResponse

type ErrorResponse struct {
	Message string `json:"message"`
}

ErrorResponse is a generic error response object.

type GetRentalByIDResponse

type GetRentalByIDResponse struct {
	Rental
}

GetRentalByIDResponse is a server response getting a single rental by id.

type ListRentalsQuery

type ListRentalsQuery struct {
	Ids      []int32   `schema:"ids"`
	PriceMin *int64    `schema:"price_min"`
	PriceMax *int64    `schema:"price_max"`
	Near     []float32 `schema:"near"`
	Limit    *int      `schema:"limit"`
	Offset   *int      `schema:"offset"`
	Sort     *string   `schema:"sort"`
}

ListRentalsQuery is used to decode the query parameters of ListRentals.

type ListRentalsResponse

type ListRentalsResponse []*Rental

ListRentalsResponse is a server response listing rentals by filters.

type Location

type Location struct {
	City      string  `json:"city"`
	State     string  `json:"state"`
	Zip       string  `json:"zip"`
	Country   string  `json:"country"`
	Latitude  float32 `json:"lat"`
	Longitude float32 `json:"lng"`
}

Location is a contract for the location object.

type Price

type Price struct {
	Day int64 `json:"day"`
}

Price is a contract for the price object.

type Rental

type Rental struct {
	ID              int32   `json:"id"`
	Name            string  `json:"name"`
	Description     string  `json:"description"`
	Type            string  `json:"type"`
	Make            string  `json:"make"`
	Model           string  `json:"model"`
	Year            int32   `json:"year"`
	Length          float32 `json:"length"`
	Sleeps          int32   `json:"sleeps"`
	PrimaryImageURL string  `json:"primary_image_url"`
	Price           Price
	Location        Location
	User            User
}

Rental is a contract for the rental object.

type User

type User struct {
	ID        int32  `json:"id"`
	FirstName string `json:"first_name"`
	LastName  string `json:"last_name"`
}

User is a contract for the user object.

Jump to

Keyboard shortcuts

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