matches

package
v0.0.0-...-6dfde0d Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2017 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrGenderGroup = errors.New("Couldn't find gender group")
)

Functions

This section is empty.

Types

type Match

type Match struct {
	User  users.User `json:"user"`
	Match float64    `json:"match"`
}

type Matches

type Matches []Match

func List

func List(user users.User, search SearchBinding, db *gorm.DB) (matches Matches, err error)

func (Matches) Len

func (ms Matches) Len() int

Len satisfies sort.Interface

func (Matches) Less

func (ms Matches) Less(a, b int) bool

Less satisfies sort.Interface

func (Matches) Swap

func (ms Matches) Swap(a, b int)

Swap satisfies sort.Interface

type SearchBinding

type SearchBinding struct {
	Gender     string  `json:"gender"`
	MinAge     int     `json:"min_age"`
	MaxAge     int     `json:"max_age"`
	Radius     float64 `json:"radius"` // in miles
	LookingFor int     `json:"looking_for"`
	Page       int     `json:"page"`
}

func (SearchBinding) Degrees

func (s SearchBinding) Degrees() float64

Degrees converts miles into coordinate degrees

func (SearchBinding) GenderGroup

func (s SearchBinding) GenderGroup() ([]string, error)

Jump to

Keyboard shortcuts

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