locations

package
v1.0.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package locations implements the REST API locations endpoint.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHandler

func GetHandler(c *gin.Context)

GetHandler handles HTTP GET requests for locations/ endpoint.

Types

type GetReq

type GetReq struct {
	Lat    float64 `form:"lat" binding:"numeric,required"`
	Long   float64 `form:"long" binding:"numeric,required"`
	Radius float64 `form:"radius" binding:"omitempty,numeric"`
	Limit  int     `form:"limit" binding:"omitempty,numeric"`
}

GetReq represents the HTTP GET request for locations/ endpoint.

type GetRes

type GetRes struct {
	request.Response
	Locations []GetResLocation `json:"locations,omitempty"`
}

GetRes represents the HTTP GET response for locations/ endpoint.

type GetResLocation

type GetResLocation struct {
	Name      string   `json:"name,omitempty"`
	Status    string   `json:"status,omitempty"`
	Hours     string   `json:"hours,omitempty"`
	FoodItems []string `json:"foodItems,omitempty"`
	Address   string   `json:"address,omitempty"`
	Distance  float64  `json:"distance,omitempty"`
	MapLink   string   `json:"mapLink,omitempty"`
}

GetResLocation represents a location for GetRes.Locations slice.

Jump to

Keyboard shortcuts

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