model

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2019 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Airport

type Airport struct {
	AirportFields AirportFields `json:"fields,omitempty"`
}

Airport holds airport related record - only "fields" is required from it right now

type AirportFields

type AirportFields struct {
	Name string `json:"name,omitempty"`
	Location
}

AirportFields holds airport fields (name + geo location)

type AirportResponse

type AirportResponse struct {
	Airports []Airport `json:"rows,omitempty"`
}

AirportResponse response from airport db

type FieldQuery

type FieldQuery struct {
	FieldName   string
	RangeValue  *RangeValue
	SimpleValue *SimpleValue
}

FieldQuery holds field expressions with name and values

func (*FieldQuery) And

func (f *FieldQuery) And(field *FieldQuery) string

And provide 'and' logical expression for field query

func (*FieldQuery) Negate

func (f *FieldQuery) Negate() string

Negate provide 'negate' logical expression for field query

func (*FieldQuery) Or

func (f *FieldQuery) Or(field *FieldQuery) string

Or provide 'or' logical expression for field query

func (*FieldQuery) ToQueryString

func (f *FieldQuery) ToQueryString() string

ToQueryString generate a string from a field query object

type Location

type Location struct {
	Latitude  float64 `json:"lat,omitempty"`
	Longitude float64 `json:"lon,omitempty"`
}

Location holds position (geo location) data

type Query

type Query struct {
	Params *url.Values
}

Query holds query object that holds uri query params

func CreateQuery

func CreateQuery(fieldsQueryExpression string) *Query

CreateQuery create query from fields expression

func (*Query) AddDistanceSort

func (q *Query) AddDistanceSort(location *Location) *Query

AddDistanceSort extend query with distance sorting

func (*Query) AddLimit

func (q *Query) AddLimit(rows int) *Query

AddLimit extend query with row limits

type RangeValue

type RangeValue struct {
	RangeStart string
	RangeEnd   string
}

RangeValue holds 'from' and 'to' range values for field queries

type SimpleValue

type SimpleValue struct {
	Value string
}

SimpleValue holds simple values for field queries (equals)

Jump to

Keyboard shortcuts

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