carparkstore

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

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

Go to latest
Published: Sep 24, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Carpark

type Carpark struct {
	gorm.Model
	Number        string  `gorm:"primary_key;unique_index"`
	Address       string  `gorm:"not null"`
	Latitude      float64 `gorm:"not null"`
	Longitude     float64 `gorm:"not null"`
	TotalLots     int     `gorm:"not null"`
	AvailableLots int     `gorm:"not null;index:availableLots"`
}

type Store

type Store interface {
	Add(*Carpark) error
	UpdateAvailability(string, int, int) error
	NearestAvailable(latitude float64, longitude float64, page int, pagesize int) ([]Carpark, error)
}

func New

func New(db *gorm.DB) Store

Jump to

Keyboard shortcuts

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