models

package
v0.0.0-...-4009bd7 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2012 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const DATE_FORMAT = "Jan _2, 2006"

Variables

This section is empty.

Functions

This section is empty.

Types

type Booking

type Booking struct {
	BookingId    int
	UserId       int
	HotelId      int
	CheckInDate  time.Time
	CheckOutDate time.Time
	CardNumber   string
	NameOnCard   string
	CardExpMonth int
	CardExpYear  int
	Smoking      bool
	Beds         int

	User  *User
	Hotel *Hotel
}

func (Booking) Description

func (b Booking) Description() string

func (Booking) Nights

func (b Booking) Nights() int

func (Booking) String

func (b Booking) String() string

func (Booking) Total

func (b Booking) Total() int

func (Booking) Validate

func (b Booking) Validate(v *rev.Validation)

TODO: Make an interface for Validate() and then validation can pass in the key prefix ("booking.")

type Hotel

type Hotel struct {
	HotelId          int
	Name, Address    string
	City, State, Zip string
	Country          string
	Price            int
}

func (*Hotel) Validate

func (h *Hotel) Validate(v *rev.Validation)

type User

type User struct {
	UserId                   int
	Username, Password, Name string
}

func (*User) String

func (u *User) String() string

func (*User) Validate

func (u *User) Validate(v *rev.Validation)

Jump to

Keyboard shortcuts

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