search

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: 9 Imported by: 0

Documentation

Overview

Package search implements search interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	DB            *sql.DB
	Latitude      float64
	Longitude     float64
	Radius        float64
	IgnoreExpired bool
	Limit         int
	OrderBy       string
}

Options represents the options which can be set when calling search method.

type Record

type Record struct {
	// contains filtered or unexported fields
}

Record represents a search result record.

func Search(o Options) ([]*Record, error)

Search returns mobile food facilities and their current locations.

func (*Record) Address

func (record *Record) Address() string

Address returns the location address.

func (*Record) CloseAt

func (record *Record) CloseAt() string

CloseAt returns the location closing hour.

func (*Record) Company

func (record *Record) Company() string

Company returns the company name.

func (*Record) Distance

func (record *Record) Distance() float64

Distance returns the distance (miles) based on the search request.

func (*Record) FoodItems

func (record *Record) FoodItems() []string

FoodItems returns the food items.

func (record *Record) GoogleMapLink() string

GoogleMapLink returns the Google Map link for the record.

func (*Record) Latitude

func (record *Record) Latitude() float64

Latitude returns the latitude value.

func (*Record) Longitude

func (record *Record) Longitude() float64

Longitude returns the longitude value.

func (*Record) OpenAt

func (record *Record) OpenAt() string

OpenAt returns the location opening hour.

func (*Record) Status

func (record *Record) Status() Status

Status returns the location status.

func (*Record) StatusText

func (record *Record) StatusText() string

StatusText returns the location status as text.

type Status

type Status int

Status represents the status of the location.

const (
	// StatusOpen represent the open status
	StatusOpen Status = 10
	// StatusOpeningSoon represent the opening soon status
	StatusOpeningSoon Status = 20
	// StatusClosed represent the closed status
	StatusClosed Status = 100
)

Jump to

Keyboard shortcuts

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