dbmodels

package
v0.0.0-...-d1a64ea Latest Latest
Warning

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

Go to latest
Published: May 22, 2016 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Objecter

type Objecter interface {
	Equal(obj Objecter) bool
}

Objecter is an interface for defining a method for comparing two entities

type Park

type Park struct {
	ID        bson.ObjectId `bson:"_id" json:"id"`
	AppUserID bson.ObjectId `bson:"appUserID" json:"appUserID"`
	Address   string        `bson:"address" json:"address"`
	Status    int           `bson:"status" json:"status"`
	Position  Point         `bson:"position" json:"position"`
}

Park represents an entire parking lot, which has one or more slots in which cars are parked

func (Park) Equal

func (park Park) Equal(obj Objecter) bool

Equal compares two Park objects. Implements the Objecter interface

type Point

type Point struct {
	X float64 `bson:"x" json:"x"`
	Y float64 `bson:"y" json:"y"`
}

Point contains the left-upper and bottom-lower points of a rectangle in which an entire zone is located

func (Point) Equal

func (point Point) Equal(obj Objecter) bool

Equal compares two Point objects. Implements the Objecter interface

type Slot

type Slot struct {
	ID         bson.ObjectId `bson:"_id" json:"id"`
	ParkID     bson.ObjectId `bson:"parkID,omitempty" json:"parkID"`
	Position   Point         `bson:"position" json:"position"`
	IsOccupied bool          `bson:"isOccupied" json:"isOccupied"`
}

Slot reprents a square in a parking lot, where the car is parked

func (Slot) Equal

func (slot Slot) Equal(obj Objecter) bool

Equal compares two Slot objects. Implements the Objecter interface

Jump to

Keyboard shortcuts

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