rentals

package
v0.0.0-...-f23cead Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRental

func GetRental(c *gin.Context)

GetRental endpoint returns a single rental

func GetRentals

func GetRentals(c *gin.Context)

GetRentals endpoint returns a list of rentals

Types

type Rental

type Rental struct {
	ID              int            `json:"id"`
	Name            string         `json:"name"`
	Description     string         `json:"description"`
	Type            string         `json:"type"`
	Make            string         `json:"make"`
	Model           string         `json:"model"`
	Year            int            `json:"year"`
	Length          float64        `json:"length"`
	Sleeps          int            `json:"sleeps"`
	PrimaryImageURL string         `json:"primary_image_url"`
	Price           RentalPrice    `json:"price"`
	Location        RentalLocation `json:"location"`
	User            models.User    `json:"user"`
}

type RentalLocation

type RentalLocation struct {
	City    string  `json:"city"`
	State   string  `json:"state"`
	Zip     string  `json:"zip"`
	Country string  `json:"country"`
	Lat     float64 `json:"lat"`
	Lng     float64 `json:"lng"`
}

type RentalPrice

type RentalPrice struct {
	Day int `json:"day"`
}

type RentalQuery

type RentalQuery struct {
	Query *gorm.DB
}

func NewRentalQuery

func NewRentalQuery(db *gorm.DB) *RentalQuery

NewRentalQuery returns a new RentalQuery struct

func (*RentalQuery) FindRentals

func (q *RentalQuery) FindRentals() ([]models.Rental, error)

FindRentals returns a list of rentals

Jump to

Keyboard shortcuts

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