houser

package module
v0.0.0-...-ccf0337 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2014 License: MIT Imports: 2 Imported by: 0

README

houser

Find a place

Documentation

Index

Constants

View Source
const (
	EURO   Currency = "EUR"
	DOLLAR          = "USD"
	POUND           = "GBP"
)

Variables

This section is empty.

Functions

func OrderedBy

func OrderedBy(less ...lessFunc) *multiSorter

OrderedBy returns a Sorter that sorts using the less functions, in order. Call its Sort method to sort the data.

Types

type Address

type Address struct {
	City     string
	Street   string
	Number   uint
	Postcode string
}

type Currency

type Currency string

type Listing

type Listing struct {
	Address

	Title            string       // short title of the listing
	Description      string       // description given by the owner
	URL              string       // URL for the listing
	Rooms            float64      // number of rooms in the property
	Area             uint         // area (in m2) of the property
	ConstructionYear uint         // year in which the property was constructed
	Type             PropertyType // the type of the listing (apartment, ...)
	Keywords         []string     // keywords identifying the property

	Posted          time.Time // timestamp of when the listing was posted
	Updated         time.Time // timestamp of when the listing was last updated
	DaysSinceUpdate float64

	PriceBare uint // bare price (per month)
	Price     uint // price with energy and other costs included (per month)
	Deposit   uint // security deposit (0 if none)
	Currency  Currency
}

type Listings

type Listings []*Listing

func (Listings) Filter

func (ls Listings) Filter(fs ...func(l *Listing) bool) Listings

filters a list of Listings according to the passed in filters

type PropertyType

type PropertyType string
const (
	APARTMENT PropertyType = "apartment"
	HOUSE                  = "house"
)

type Query

type Query struct {
	City            string
	PriceMin        uint
	PriceMax        uint
	RoomMin         uint
	RoomMax         uint
	AreaMin         uint
	AreaMax         uint
	PropertyType    PropertyType    // type of the desired property
	TransactionType TransactionType // type of the desired transaction
	UpdatedSince    time.Time
}

type Repo

type Repo interface {
	Search(query *Query) ([]*Listing, error)
}

type TransactionType

type TransactionType string
const (
	RENT  TransactionType = "rent"  // renting a flat/house
	BUY   TransactionType = "buy"   // buying a flat/house
	SHARE TransactionType = "share" // shared flat/house
)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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