entities

package
v0.0.0-...-ec51da4 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BusynessFeedbackType     FeedbackType = "busyness"
	AvailabilityFeedbackType              = "availability"

	Available   AvailabilityValue = "available"
	Unavailable                   = "unavailable"

	Empty   BusynessValue = "empty"
	Average               = "average"
	Busy                  = "busy"
)
View Source
const (
	IMAGES_PATH = "static/images/"

	GroceryShop ShopType = "grocery"
	Pharmacy             = "pharmacy"
)

Variables

View Source
var ErrUnknownFilterType = errors.New("unknown filter type, available filter types: busyness, available")

Functions

This section is empty.

Types

type AvailabilityValue

type AvailabilityValue string

type BusynessValue

type BusynessValue string

type Feedback

type Feedback struct {
	ShopID      string       `json:"shop_id"`
	ItemGroupID string       `json:"item_group_id"`
	Type        FeedbackType `json:"type"`
	Value       string       `json:"value"`
}

func (Feedback) IsForFilter

func (f Feedback) IsForFilter(filter Filter) bool

func (Feedback) LessThan

func (f Feedback) LessThan(filter Filter) bool

type FeedbackType

type FeedbackType string

type Filter

type Filter struct {
	Type  FilterType
	Value string
}

func (*Filter) MarshalJSON

func (f *Filter) MarshalJSON() ([]byte, error)

func (*Filter) UnmarshalJSON

func (f *Filter) UnmarshalJSON(data []byte) error

type FilterType

type FilterType string
const (
	BusynessFilter  FilterType = "busyness"
	AvailableFilter            = "available"
)

type ItemGroup

type ItemGroup struct {
	ID       string `json:"id"          bson:"id"         yaml:"id"`
	Name     string `json:"name"        bson:"name"       validate:"required" yaml:"name"`
	Icon     string `json:"icon"        bson:"icon"       yaml:"icon"`
	ShopType string `json:"shop_type"   bson:"shop_type"  yaml:"shop_type"`
}

type Shop

type Shop struct {
	ID       string      `json:"id"`
	Name     string      `json:"name"`
	Loc      maps.LatLng `json:"loc"`
	Address  string      `json:"address"`
	OpenNow  bool        `json:"open_now"`
	Photo    string      `json:"photo"`
	Distance uint        `json:"distance"`
	ShopType ShopType    `json:"shop_type"`
}

func ConvertPlacesSearchResponseToShops

func ConvertPlacesSearchResponseToShops(ctx context.Context, appUrl string, response maps.PlacesSearchResponse, startLocation maps.LatLng, gClient *maps.Client, shopType ShopType) []Shop

type ShopType

type ShopType string

Jump to

Keyboard shortcuts

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